Skip to content

Commit

Permalink
Camera (macOS): try silence system deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
CarterLi committed Apr 30, 2024
1 parent 367264e commit c42711e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/detection/camera/camera_apple.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@

const char* ffDetectCamera(FFlist* result)
{
AVCaptureDeviceDiscoverySession* session = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:@[AVCaptureDeviceTypeBuiltInWideAngleCamera] mediaType:AVMediaTypeVideo position:AVCaptureDevicePositionUnspecified];
AVCaptureDeviceType externalType;
if (@available(macOS 14, *)) // #822
externalType = AVCaptureDeviceTypeContinuityCamera;
else
externalType = AVCaptureDeviceTypeExternalUnknown;
AVCaptureDeviceDiscoverySession* session = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:@[AVCaptureDeviceTypeBuiltInWideAngleCamera, externalType]
mediaType:AVMediaTypeVideo
position:AVCaptureDevicePositionUnspecified];
if (!session)
return "Failed to create AVCaptureDeviceDiscoverySession";

Expand Down

0 comments on commit c42711e

Please sign in to comment.