[FFmpeg-trac] #11015(undetermined:open): Mac arm64, AVFoundation not listing video device part of usb cameras, Logitech?
FFmpeg
trac at avcodec.org
Mon Jun 3 03:38:04 EEST 2024
#11015: Mac arm64, AVFoundation not listing video device part of usb cameras,
Logitech?
-------------------------------------+-------------------------------------
Reporter: Dave | Owner: Thilo
| Borgmann
Type: defect | Status: open
Priority: important | Component:
| undetermined
Version: 7.0 | Resolution:
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Comment (by ddennedy):
The #5 above gives the deprecation warning on `devicesWithMediaType` the
commit fixed. Here is a version of my change that also works and compiles
without warning:
{{{
diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m
index e558ad7d90..abce705d25 100644
--- a/libavdevice/avfoundation.m
+++ b/libavdevice/avfoundation.m
@@ -783,20 +783,25 @@ static NSArray* getDevicesWithMediaType(AVMediaType
mediaType) {
#if (TARGET_OS_OSX && __MAC_OS_X_VERSION_MIN_REQUIRED >= 130000)
[deviceTypes addObject: AVCaptureDeviceTypeDeskViewCamera];
#endif
+ #if (TARGET_OS_OSX && __MAC_OS_X_VERSION_MIN_REQUIRED >= 140000)
+ [deviceTypes addObject: AVCaptureDeviceTypeExternal];
+ #else
+ [deviceTypes addObject: AVCaptureDeviceTypeExternalUnknown];
+ #endif
#if (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >=
150400)
[deviceTypes addObject:
AVCaptureDeviceTypeBuiltInLiDARDepthCamera];
#endif
- #if (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >=
170000 || (TARGET_OS_OSX && __MAC_OS_X_VERSION_MIN_REQUIRED >= 140000))
+ #if ((TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >=
170000) || (TARGET_OS_OSX && __MAC_OS_X_VERSION_MIN_REQUIRED >= 140000))
[deviceTypes addObject: AVCaptureDeviceTypeContinuityCamera];
#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))
+ #if ((TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >=
170000) || (TARGET_OS_OSX && __MAC_OS_X_VERSION_MIN_REQUIRED >= 140000))
deviceTypes = [NSMutableArray
arrayWithArray:@[AVCaptureDeviceTypeMicrophone]];
#else
deviceTypes = [NSMutableArray
arrayWithArray:@[AVCaptureDeviceTypeBuiltInMicrophone]];
#endif
} else if (mediaType == AVMediaTypeMuxed) {
- #if (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >=
170000 || (TARGET_OS_OSX && __MAC_OS_X_VERSION_MIN_REQUIRED >= 140000))
+ #if ((TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >=
170000) || (TARGET_OS_OSX && __MAC_OS_X_VERSION_MIN_REQUIRED >= 140000))
deviceTypes = [NSMutableArray
arrayWithArray:@[AVCaptureDeviceTypeExternal]];
#elif (TARGET_OS_OSX && __MAC_OS_X_VERSION_MIN_REQUIRED < 140000)
deviceTypes = [NSMutableArray
arrayWithArray:@[AVCaptureDeviceTypeExternalUnknown]];
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/11015#comment:6>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list