From 40ddddca45c326cb474b3b2cd29f1474369af2ce Mon Sep 17 00:00:00 2001 From: Theo Fabi Date: Sun, 9 Jun 2024 15:51:08 -0400 Subject: [PATCH] avdevice/avfoundation: add external video devices Video devices categorized by AVFoundation as 'AVCaptureDeviceTypeExternal(Unknown)' (like USB video streams) were not recognized by libavdevice. Signed-off-by: Theo Fabi --- libavdevice/avfoundation.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m index d9b17ccdae..3fe3df2cb7 100644 --- a/libavdevice/avfoundation.m +++ b/libavdevice/avfoundation.m @@ -787,6 +787,9 @@ static NSArray* getDevicesWithMediaType(AVMediaType mediaType) { #endif #if (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >= 170000 || (TARGET_OS_OSX && __MAC_OS_X_VERSION_MIN_REQUIRED >= 140000)) [deviceTypes addObject: AVCaptureDeviceTypeContinuityCamera]; + [deviceTypes addObject: AVCaptureDeviceTypeExternal]; + #elif (TARGET_OS_OSX && __MAC_OS_X_VERSION_MIN_REQUIRED < 140000) + [deviceTypes addObject: AVCaptureDeviceTypeExternalUnknown]; #endif } else if (mediaType == AVMediaTypeAudio) { #if (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >= 170000 || (TARGET_OS_OSX && __MAC_OS_X_VERSION_MIN_REQUIRED >= 140000))