setExif: would create a CFDictionary using NULL for keyCallBacks and
valueCallBacks. This has the effect of comparing the keys of the
dictionary by pointer instead of by value. With ld64, this works
because it always dedupes identical constant CFSTR("foo") literal,
but lld currently doesn't do this.
Using kCFTypeDictionaryKeyCallBacks and kCFTypeDictionaryValueCallBacks
fixes the problem with lld and is "more correct" in general: Now the
dictionary would work with computed CFStrings too, it shows up better
in CFShow() output, etc.
While here, also fix a memory leak in setExif:.
Bug: chromium:1251763
Change-Id: I43c96d2189a4a77fe3bd0dfb3e33623925b0f900
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232760
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#35067}
This CL is for the same behavior as before [1], to emit the NSError
when an application is not using the RTCAudioSession lock correctly.
[1] https://webrtc-review.googlesource.com/c/src/+/207432
Bug: webrtc:13091
Change-Id: I031b0e963d33c92ce1af7a306edfa6be005e043d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/229461
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#35018}
* Replace "AV1X" with "AV1";
* Keep mapping of "AV1X" payload name to kVideoCodecAv1 to not break
support of injectable "AV1X".
Bug: webrtc:13166
Change-Id: I9a50481209209f3857bbf28f4ed529ee6972377e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231560
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Emil Lundmark <lndmrk@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34987}
Fatal Exception: java.lang.NullPointerException: Attempt to get length of null array
at org.webrtc.Camera2Session$CaptureSessionCallback.chooseStabilizationMode(Camera2Session.java:234)
at org.webrtc.Camera2Session$CaptureSessionCallback.onConfigured(Camera2Session.java:172)
at android.hardware.camera2.impl.CallbackProxies$SessionStateCallbackProxy.lambda$onConfigured$0(CallbackProxies.java:53)
at android.hardware.camera2.impl.-$$Lambda$CallbackProxies$SessionStateCallbackProxy$soW0qC12Osypoky6AfL3P2-TeDw.run(-.java:4)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.os.HandlerThread.run(HandlerThread.java:65)
Bug: webrtc:13032
Change-Id: Ifb6ef920b700ca03d37c64803c0b34230785846f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227292
Reviewed-by: Xavier Lepaul <xalep@webrtc.org>
Commit-Queue: Xavier Lepaul <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34874}
StreamConfigurationMap.getOutputSizes() may return null:
https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputSizes(java.lang.Class%3CT%3E)
Fixes:
Fatal Exception: java.lang.NullPointerException: Attempt to get length of null array
at org.webrtc.Camera2Enumerator.convertSizes(Camera2Enumerator.java:234)
at org.webrtc.Camera2Enumerator.getSupportedSizes(Camera2Enumerator.java:147)
at org.webrtc.Camera2Session.findCaptureFormat(Camera2Session.java:325)
at org.webrtc.Camera2Session.start(Camera2Session.java:313)
at org.webrtc.Camera2Session.<init>(Camera2Session.java:296)
at org.webrtc.Camera2Session.create(Camera2Session.java:274)
at org.webrtc.Camera2Capturer.createCameraSession(Camera2Capturer.java:35)
at org.webrtc.CameraCapturer$5.run(CameraCapturer.java:272)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.os.HandlerThread.run(HandlerThread.java:67)
Bug: webrtc:13032
Change-Id: I9154be567cd12c066087818ba22e9cd69e75a22f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227291
Reviewed-by: Xavier Lepaul <xalep@webrtc.org>
Commit-Queue: Xavier Lepaul <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34872}
Remove android.support.test.rule.UiThreadTestRule as chromium did in [1] and
Replace android.support.test.annotation.UiThreadTest
with org.chromium.base.test.UiThreadTest.
Also remove unused uiThreadHandler from NetworkMonitorTest.
[1] https://crrev.com/c/2332301
Bug: webrtc:11962
Change-Id: I8f3781d43d4d53d8158c39c81568d8b09b2bec6a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/230220
Reviewed-by: Xavier Lepaul <xalep@webrtc.org>
Commit-Queue: Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#34864}
With this change, we catch audio unit start errors and pipe them to the
audio session. The audio session notifies its delegate, which can then
take appropriate action based on the error code.
The signal follows the same path as the playout glitch detection.
Bug: webrtc:13119
Change-Id: I8c9f9d2a1e3457447d0ce61ad197f7e1c6392837
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/230240
Commit-Queue: Peter Hanspers <peterhanspers@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Xavier Lepaul <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34862}
Specifically, defer getting the camera index so the error can be
reported instead of crashing:
Fatal Exception: java.lang.IllegalArgumentException: No such camera: Camera 1, Facing front, Orientation 270
at org.webrtc.Camera1Enumerator.getCameraIndex(Camera1Enumerator.java:170)
at org.webrtc.Camera1Capturer.createCameraSession(Camera1Capturer.java:31)
at org.webrtc.CameraCapturer$5.run(CameraCapturer.java:272)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.os.HandlerThread.run(HandlerThread.java:65)
Bug: webrtc:13032
Change-Id: Ida6bc65046770c11c2b3ee832906e8454cec10df
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227290
Reviewed-by: Xavier Lepaul <xalep@webrtc.org>
Commit-Queue: Xavier Lepaul <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34855}
getCameraCharacteristics() may throw IllegalArgumentException:
Fatal Exception: java.lang.IllegalArgumentException: supportsCameraApi:2569: Unknown camera ID 1
at android.hardware.camera2.CameraManager.throwAsPublicException(CameraManager.java:1119)
at android.hardware.camera2.CameraManager.getCameraCharacteristics(CameraManager.java:531)
at org.webrtc.Camera2Session.start(Camera2Session.java:304)
at org.webrtc.Camera2Session.<init>(Camera2Session.java:296)
at org.webrtc.Camera2Session.create(Camera2Session.java:274)
at org.webrtc.Camera2Capturer.createCameraSession(Camera2Capturer.java:35)
at org.webrtc.CameraCapturer$5.run(CameraCapturer.java:272)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.os.HandlerThread.run(HandlerThread.java:67)
Bug: webrtc:13032
Change-Id: I30b6d6da40bc90a94c0c3c79f9dff523182d3da4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227289
Reviewed-by: Xavier Lepaul <xalep@webrtc.org>
Commit-Queue: Xavier Lepaul <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34854}
Fatal Exception: java.lang.NullPointerException: Attempt to read from field 'int org.webrtc.CameraEnumerationAndroid$CaptureFormat.width' on a null object reference
at org.webrtc.Camera2Session$CameraStateCallback.onOpened(Camera2Session.java:122)
at android.hardware.camera2.impl.CameraDeviceImpl$1.run(CameraDeviceImpl.java:151)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:246)
at android.os.HandlerThread.run(HandlerThread.java:67)
Fix NPE when setting the camera2 stabilization mode
Fatal Exception: java.lang.NullPointerException: Attempt to get length of null array
at org.webrtc.Camera2Session$CaptureSessionCallback.chooseStabilizationMode(Camera2Session.java:234)
at org.webrtc.Camera2Session$CaptureSessionCallback.onConfigured(Camera2Session.java:172)
at android.hardware.camera2.impl.CallbackProxies$SessionStateCallbackProxy.lambda$onConfigured$0(CallbackProxies.java:53)
at android.hardware.camera2.impl.-$$Lambda$CallbackProxies$SessionStateCallbackProxy$soW0qC12Osypoky6AfL3P2-TeDw.run(-.java:4)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.os.HandlerThread.run(HandlerThread.java:65)
Bug: webrtc:13032
Change-Id: I6edd9f0061c445f90ab0881d78183077f89e391f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227294
Reviewed-by: Xavier Lepaul <xalep@webrtc.org>
Commit-Queue: Xavier Lepaul <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34851}
This change does not affect downstream dependencies as androidx.annotation
is fully compatible with android.support.annotation.
Bug: webrtc:11962
Change-Id: I714b473df8d0fee8000ddf3a9beca7c5613db5ff
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226881
Commit-Queue: Xavier Lepaul <xalep@webrtc.org>
Reviewed-by: Xavier Lepaul <xalep@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34839}
PeerConnectionFactory to break off the dependency.
- This is required so that Android app that doesn't use the
peerconnection_java as dependency can include android monitor
directly without incurring size bloat.
Bug: None
Change-Id: I7b3453f268467550c0a4b3a0bbf858d55d2fd8a4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/229322
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Tim Na <natim@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34829}
Before this change HardwareVideoEncoder used capture time as frame
timestamp passed to HW encoder. That led to buffer overshoots with
HW encoders which infer frame rate from timestamps when frames were
dropped before encoding (i.e., frame rate decreases according to frame
timestamps) or when FramerateBitrateAdjuster was used.
Fixed this by using synthetic monotonically increasing timestamps
calculated based on target frame rate provided by bitrate adjuster.
Bug: webrtc:12982
Change-Id: I2454cd4e574bbea1cb9855ced4d998104845415c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228902
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34810}
The simulcast_encoder_adapter expects codecs that specify
supports_native_handle to perform resampling/scaling (through
GetEncoderInfo).
This change adds a method to the RTCVideoEncoder to let objc encoders
specify this rather than relying on the default.
Bug: webrtc:13044
Change-Id: I2efcbd42aa4f2048285f451c7b691fdeca111e62
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227641
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Peter Hanspers <peterhanspers@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34683}
RTCIceCandidate.nativeCandidate returns a unique_ptr that
can be null. As with the previous CL, this is used without checking
whether it is null or not, so it should be fixed.
Bug: None
Change-Id: I70a84f7a2a9a9d47b8cefa198204f9b6d63a7c7f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227620
Commit-Queue: Byoungchan Lee <daniel.l@hpcnt.com>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34649}
There are two problems with setLocalDescription / setRemoteDescription
in ObjC SDK.
First, RTCSessionDescription.nativeDescription returns a raw
nullableSessionDescriptionInterface pointer, where sLD/sRD are calling
Clone() method unconditionally, so it might crash.
Second, unnecessary sLD/sRD calls Clone() of the raw pointer and
does not delete it, so this pointer will leak.
To solve these problems, I changed the return type of nativeDescription to
std::unique_ptr and removed the call to Clone() method.
Bug: webrtc:13022, webrtc:13035
Change-Id: Icbb87dda62d3a11af47ec74621cf64b8a6c05228
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227380
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/master@{#34647}
This is useful when building the .framework which doesn't need to
export C++ symbols.
Bug: webrtc:12408
Change-Id: Ied775811a72a06b9ad678c9fb549bca286dd7f37
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227089
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34613}
This allows to get encoder implementation name and other properties
without the need of initializing encoder.
Bug: none
Change-Id: I263a358d562a65a31c420ddb7c4b195316fa5ec8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226867
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Mirta Dvornicic <mirtad@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34559}
Need someone from video team devs to be in the list. Working on projects
related to Android media codecs for couple of years and have enough
experience to review the changes. A concrete short-term motivation is
the need to land https://webrtc-review.googlesource.com/c/src/+/226867
Bug: none
Change-Id: I1d0a672f6b497bbe1e2d446386284d568f84664a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226951
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34556}
Uppercase constants are more likely to conflict with macros (for
example rtc::SRTP_AES128_CM_SHA1_80 and OpenSSL SRTP_AES128_CM_SHA1_80).
This CL renames some constants and follows the C++ style guide.
Bug: webrtc:12997
Change-Id: I2398232568b352f88afed571a9b698040bb81c30
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226564
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34553}
Just like the C++ API, add a method in Java VideoFrame.Buffer that
describes the underlying implementation.
Use this method to properly select AndroidVideoBuffer
or AndroidVideoI420Buffer in Java -> C++ Video Frame Conversion.
Also, add a test case for WrappedNativeI420Buffer
in VideoFrameBufferTest for consistency.
Bug: webrtc:12602
Change-Id: I4c0444e8af6f6a1109bc514e7ab6c2214f1f6d60
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/223080
Commit-Queue: Byoungchan Lee <daniel.l@hpcnt.com>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Xavier Lepaul <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34545}
This is a step to ensure that the Java to C++ Video Frame Buffer
conversion respects its types.
Bug: webrtc:12602
Change-Id: I1b688b1f421f44474e022b433f9075e75744d86f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/223082
Reviewed-by: Xavier Lepaul <xalep@webrtc.org>
Commit-Queue: Xavier Lepaul <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34487}
The deprecation warning started to trigger after the iOS deployment
target has been updated from 10 to 12 by
https://webrtc-review.googlesource.com/c/src/+/224543.
This macro was not defined in tests because the relevant bots were
excluded from CQ when that happened.
Bug: webrtc:12928, webrtc:12937
Change-Id: I6e1891c5080b172cbd74649e0a115b25d6c87d56
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225020
Reviewed-by: Victor Boivie <boivie@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34417}
Also changed the logging of exceptions to give more details
Bug: webrtc:10804
Change-Id: Ifba6dee3d1c8ba4ecab408ca7715c3b792d9c004
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222641
Commit-Queue: Xavier Lepaul <xalep@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34325}