Upstream commit: https://webrtc.googlesource.com/src/+/7e3a9ce99d832687d1eef3eaa270754970a761b0 Rely on TaskQueueBase interface in modules/rtp_rtcp Instead of requiring Thread to be passed to the RtpVideoStreamReceiverFrameTransformerDelegate. This class already uses it only though the TaskQueueBase interface. In tests rely on RunLoop helper when test makes calls that are required to be done on the same task queue, and rely on TaskQueueForTests where test does not make such calls. Bug: webrtc:42225410 Change-Id: I7aba5c696436d8ce43c85ccba5b9448e852ea81d Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/470880 Auto-Submit: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Erik Språng <sprang@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/main@{#47662}
67 lines
3.0 KiB
Diff
67 lines
3.0 KiB
Diff
From: Nico Grunbaum <na-g@nostrum.com>
|
|
Date: Wed, 15 Nov 2023 22:33:00 +0000
|
|
Subject: Bug 1863041 - P0 - add device filter control to
|
|
RTCCameraVideoCapturer;r=pehrsons,webrtc-reviewers
|
|
|
|
I have filed this bug upstream: https://bugs.chromium.org/p/webrtc/issues/detail?id=15639
|
|
|
|
Differential Revision: https://phabricator.services.mozilla.com/D193172
|
|
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/91a763d768b74acc9cf4828f91a86df4a7b092ce
|
|
---
|
|
.../capturer/RTCCameraVideoCapturer.h | 5 ++++-
|
|
.../capturer/RTCCameraVideoCapturer.m | 19 +++++++++++++++----
|
|
2 files changed, 19 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/sdk/objc/components/capturer/RTCCameraVideoCapturer.h b/sdk/objc/components/capturer/RTCCameraVideoCapturer.h
|
|
index 5185fa866e..6aeb577b13 100644
|
|
--- a/sdk/objc/components/capturer/RTCCameraVideoCapturer.h
|
|
+++ b/sdk/objc/components/capturer/RTCCameraVideoCapturer.h
|
|
@@ -26,7 +26,10 @@ RTC_OBJC_EXPORT
|
|
@property(readonly, nonatomic) AVCaptureSession *captureSession;
|
|
|
|
// Returns list of available capture devices that support video capture.
|
|
-+ (NSArray<AVCaptureDevice *> *)captureDevices;
|
|
++ (NSArray<AVCaptureDevice *> *)captureDevicesWithDeviceTypes:
|
|
+ (NSArray<AVCaptureDeviceType> *)deviceTypes;
|
|
+// Returns list of default capture devices types
|
|
++ (NSArray<AVCaptureDeviceType> *)defaultCaptureDeviceTypes;
|
|
// Returns list of formats that are supported by this class for this device.
|
|
+ (NSArray<AVCaptureDeviceFormat *> *)supportedFormatsForDevice:
|
|
(AVCaptureDevice *)device;
|
|
diff --git a/sdk/objc/components/capturer/RTCCameraVideoCapturer.m b/sdk/objc/components/capturer/RTCCameraVideoCapturer.m
|
|
index ff55bd7f19..60b1dbbfb5 100644
|
|
--- a/sdk/objc/components/capturer/RTCCameraVideoCapturer.m
|
|
+++ b/sdk/objc/components/capturer/RTCCameraVideoCapturer.m
|
|
@@ -124,16 +124,27 @@ const int64_t kNanosecondsPerSecond = 1000000000;
|
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
|
}
|
|
|
|
-+ (NSArray<AVCaptureDevice *> *)captureDevices {
|
|
++ (NSArray<AVCaptureDevice *> *)captureDevicesWithDeviceTypes:
|
|
+ (NSArray<AVCaptureDeviceType> *)deviceTypes {
|
|
AVCaptureDeviceDiscoverySession *session = [AVCaptureDeviceDiscoverySession
|
|
- discoverySessionWithDeviceTypes:@[
|
|
- AVCaptureDeviceTypeBuiltInWideAngleCamera
|
|
- ]
|
|
+ discoverySessionWithDeviceTypes:deviceTypes
|
|
mediaType:AVMediaTypeVideo
|
|
position:AVCaptureDevicePositionUnspecified];
|
|
return session.devices;
|
|
}
|
|
|
|
++ (NSArray<AVCaptureDeviceType> *)defaultCaptureDeviceTypes {
|
|
+ NSArray *types = @[ AVCaptureDeviceTypeBuiltInWideAngleCamera ];
|
|
+#if !defined(WEBRTC_IOS)
|
|
+ if (@available(macOS 14.0, *)) {
|
|
+ types = [types arrayByAddingObject:AVCaptureDeviceTypeExternal];
|
|
+ } else {
|
|
+ types = [types arrayByAddingObject:AVCaptureDeviceTypeExternalUnknown];
|
|
+ }
|
|
+#endif
|
|
+ return types;
|
|
+}
|
|
+
|
|
+ (NSArray<AVCaptureDeviceFormat *> *)supportedFormatsForDevice:
|
|
(AVCaptureDevice *)device {
|
|
// Support opening the device in any format. We make sure it's converted to a
|