diff options
author | Roman Shpuntov <roman.shpuntov@gmail.com> | 2019-12-11 14:17:37 +0700 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2019-12-11 19:53:45 +0000 |
commit | 6ff7988109ad3cc48e23da7c9156eadc3e15ebb4 (patch) | |
tree | fda06fa1be3c9b9a1ec6126667e7173aca2720b5 | |
parent | 39a67657d7153662ed08eab6cb8da6d4e621f055 (diff) | |
download | gstreamer-plugins-bad-6ff7988109ad3cc48e23da7c9156eadc3e15ebb4.tar.gz |
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.
-rw-r--r-- | sys/applemedia/avfvideosrc.m | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/applemedia/avfvideosrc.m b/sys/applemedia/avfvideosrc.m index 5a91d1d6e..25e0e3483 100644 --- a/sys/applemedia/avfvideosrc.m +++ b/sys/applemedia/avfvideosrc.m @@ -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; |