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 <fabi.theo@gmail.com>
This commit is contained in:
Theo Fabi 2024-06-09 15:51:08 -04:00 committed by Thilo Borgmann
parent 8d6014dbc6
commit d6d14b3a15
1 changed files with 3 additions and 0 deletions

View File

@ -788,6 +788,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))