diff options
Diffstat (limited to 'modules/camera/camera_osx.mm')
-rw-r--r-- | modules/camera/camera_osx.mm | 6 |
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++) { |