From 90022710ab6e5490e4b1e563f163bc5edc9b9735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 29 Sep 2021 14:12:33 +0200 Subject: [PATCH] Revert "[macOS] Request camera permission before session init." This reverts commit 3fea85a6f0c7beb18841b68e5bed5c8ff01a8a51. The commit is good but to use `@available(macOS 10.14, *)` with osxcross one needs to build `compiler-rt`, which can be done but might surprise some users who have their custom build pipelines for 3.3.x (including the official build system). --- modules/camera/camera_osx.mm | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/modules/camera/camera_osx.mm b/modules/camera/camera_osx.mm index f7cd419a3ce..815b9d53402 100644 --- a/modules/camera/camera_osx.mm +++ b/modules/camera/camera_osx.mm @@ -33,7 +33,6 @@ #include "camera_osx.h" #include "servers/camera/camera_feed.h" - #import ////////////////////////////////////////////////////////////////////////// @@ -254,25 +253,10 @@ CameraFeedOSX::~CameraFeedOSX() { bool CameraFeedOSX::activate_feed() { if (capture_session) { - // Already recording! + // already recording! } else { - // Start camera capture, check permission. - if (@available(macOS 10.14, *)) { - AVAuthorizationStatus status = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]; - if (status == AVAuthorizationStatusAuthorized) { - capture_session = [[MyCaptureSession alloc] initForFeed:this andDevice:device]; - } else if (status == AVAuthorizationStatusNotDetermined) { - // Request permission. - [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo - completionHandler:^(BOOL granted) { - if (granted) { - capture_session = [[MyCaptureSession alloc] initForFeed:this andDevice:device]; - } - }]; - } - } else { - capture_session = [[MyCaptureSession alloc] initForFeed:this andDevice:device]; - } + // start camera capture + capture_session = [[MyCaptureSession alloc] initForFeed:this andDevice:device]; }; return true;