mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-04-19 02:04:19 +03:00
avfoundation: Fix compilation for OSes other than macOS and iOS
E.g. tvOS doesn't have devicesWithMediaType. In principle, we could probably disable building the whole input device on such OSes, but that would either require testing explicitly for the OS type in configure (which we don't do anywhere so far), or test for individual objective C methods. This approach allows the code to compile, but no input devices will be found at runtime. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
46762c8b82
commit
69bab4e74f
@ -814,8 +814,10 @@ static NSArray* getDevicesWithMediaType(AVMediaType mediaType) {
|
||||
mediaType:mediaType
|
||||
position:AVCaptureDevicePositionUnspecified];
|
||||
return [captureDeviceDiscoverySession devices];
|
||||
#else
|
||||
#elif TARGET_OS_OSX
|
||||
return [AVCaptureDevice devicesWithMediaType:mediaType];
|
||||
#else
|
||||
return nil;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user