avfvideosrc: element requests camera permissions even with capture-screen property is true

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1137

macOS has different dialogs for camera capture and screen capture.
No need to request screen capture permissions, the system detect
screen capture automatically and create request dialog.
This commit is contained in:
Roman Shpuntov 2019-12-11 14:17:37 +07:00 committed by GStreamer Merge Bot
parent a400126889
commit 5da2938244

View file

@ -430,6 +430,9 @@ static AVCaptureVideoOrientation GstAVFVideoSourceOrientation2AVCaptureVideoOrie
// Since Mojave, permissions are now supposed to be explicitly granted
// before performing anything on a device
if (@available(macOS 10.14, *)) {
if (captureScreen)
goto checked;
// Check if permission has already been granted (or denied)
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
switch (authStatus) {
@ -466,6 +469,7 @@ static AVCaptureVideoOrientation GstAVFVideoSourceOrientation2AVCaptureVideoOrie
}
}
checked:
dispatch_sync (mainQueue, ^{
BOOL ret;