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
1 changed files with 3 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue