summaryrefslogtreecommitdiff
path: root/modules/camera
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2020-06-23 22:01:42 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2020-06-29 12:33:51 +0300
commit00299f15b46b695d6809f7f812daaad1ad520b4a (patch)
tree527781843f15ef421089ca02b119583d9e8e815e /modules/camera
parent9fc65fd1f15b2ae2e26cf69c54819e7d6598fa05 (diff)
[macOS] Add support for the Apple Silicon (ARM64) build target.
Diffstat (limited to 'modules/camera')
-rw-r--r--modules/camera/camera_osx.mm6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/camera/camera_osx.mm b/modules/camera/camera_osx.mm
index 9a72174723..306632a016 100644
--- a/modules/camera/camera_osx.mm
+++ b/modules/camera/camera_osx.mm
@@ -313,7 +313,12 @@ MyDeviceNotifications *device_notifications = nil;
// CameraOSX - Subclass for our camera server on OSX
void CameraOSX::update_feeds() {
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101500
+ AVCaptureDeviceDiscoverySession *session = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:[NSArray arrayWithObjects:AVCaptureDeviceTypeExternalUnknown, AVCaptureDeviceTypeBuiltInWideAngleCamera, nil] mediaType:AVMediaTypeVideo position:AVCaptureDevicePositionUnspecified];
+ NSArray *devices = session.devices;
+#else
NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
+#endif
// remove devices that are gone..
for (int i = feeds.size() - 1; i >= 0; i--) {
@@ -325,7 +330,6 @@ void CameraOSX::update_feeds() {
};
};
- // add new devices..
for (AVCaptureDevice *device in devices) {
bool found = false;
for (int i = 0; i < feeds.size() && !found; i++) {