From 99486230276947428cca6066f3c3c3c960ed5c35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1ri=20Tristan=20Helgason?= Date: Fri, 30 Jun 2023 10:40:40 +0200 Subject: [PATCH] Use AVCaptureDeviceDiscoverySession on all platforms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: b/288827308 Change-Id: I345d62bb44f947412a0a448f0feadca8b0dc9d2d Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/310621 Commit-Queue: Kári Helgason Reviewed-by: Mirko Bonadei Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/main@{#40383} --- .gn | 1 - examples/objc/AppRTCMobile/mac/APPRTCViewController.m | 4 ++-- sdk/objc/components/capturer/RTCCameraVideoCapturer.m | 5 ----- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.gn b/.gn index 65b7a6b158..ed92a1b296 100644 --- a/.gn +++ b/.gn @@ -50,7 +50,6 @@ default_args = { mac_sdk_min = "10.12" ios_deployment_target = "12.0" - mac_deployment_target = "10.13" # The SDK API level, in contrast, is set by build/android/AndroidManifest.xml. android32_ndk_api_level = 21 diff --git a/examples/objc/AppRTCMobile/mac/APPRTCViewController.m b/examples/objc/AppRTCMobile/mac/APPRTCViewController.m index 7b65d4f058..982fa56b43 100644 --- a/examples/objc/AppRTCMobile/mac/APPRTCViewController.m +++ b/examples/objc/AppRTCMobile/mac/APPRTCViewController.m @@ -238,7 +238,7 @@ static NSUInteger const kBottomViewHeight = 200; _connectButton = [[NSButton alloc] initWithFrame:NSZeroRect]; [_connectButton setTranslatesAutoresizingMaskIntoConstraints:NO]; _connectButton.title = @"Start call"; - _connectButton.bezelStyle = NSRoundedBezelStyle; + _connectButton.bezelStyle = NSBezelStyleSmallSquare; _connectButton.target = self; _connectButton.action = @selector(startCall:); [_actionItemsView addSubview:_connectButton]; @@ -246,7 +246,7 @@ static NSUInteger const kBottomViewHeight = 200; _loopbackButton = [[NSButton alloc] initWithFrame:NSZeroRect]; [_loopbackButton setTranslatesAutoresizingMaskIntoConstraints:NO]; _loopbackButton.title = @"Loopback"; - [_loopbackButton setButtonType:NSSwitchButton]; + [_loopbackButton setButtonType:NSButtonTypeSwitch]; [_actionItemsView addSubview:_loopbackButton]; } diff --git a/sdk/objc/components/capturer/RTCCameraVideoCapturer.m b/sdk/objc/components/capturer/RTCCameraVideoCapturer.m index 98d3cf9f45..e7c47b4e99 100644 --- a/sdk/objc/components/capturer/RTCCameraVideoCapturer.m +++ b/sdk/objc/components/capturer/RTCCameraVideoCapturer.m @@ -118,16 +118,11 @@ const int64_t kNanosecondsPerSecond = 1000000000; } + (NSArray *)captureDevices { -#if defined(WEBRTC_IOS) && defined(__IPHONE_10_0) && \ - __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_10_0 AVCaptureDeviceDiscoverySession *session = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:@[ AVCaptureDeviceTypeBuiltInWideAngleCamera ] mediaType:AVMediaTypeVideo position:AVCaptureDevicePositionUnspecified]; return session.devices; -#else - return [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]; -#endif } + (NSArray *)supportedFormatsForDevice:(AVCaptureDevice *)device {