mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
macOS: Fix deprecations in macOS 14.0
This commit is contained in:
parent
a22e423fc6
commit
f0aacca62c
2 changed files with 27 additions and 2 deletions
|
|
@ -146,8 +146,19 @@ struct CameraDevice::Pimpl
|
|||
#if JUCE_USE_NEW_CAMERA_API
|
||||
if (@available (macOS 10.15, *))
|
||||
{
|
||||
auto* discovery = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes: @[AVCaptureDeviceTypeBuiltInWideAngleCamera,
|
||||
AVCaptureDeviceTypeExternalUnknown]
|
||||
const auto deviceType = [&]
|
||||
{
|
||||
#if defined (MAC_OS_VERSION_14_0) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_14_0
|
||||
if (@available (macOS 14.0, *))
|
||||
return AVCaptureDeviceTypeExternal;
|
||||
#endif
|
||||
|
||||
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations", "-Wunguarded-availability-new")
|
||||
return AVCaptureDeviceTypeExternalUnknown;
|
||||
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
|
||||
}();
|
||||
|
||||
auto* discovery = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes: @[AVCaptureDeviceTypeBuiltInWideAngleCamera, deviceType]
|
||||
mediaType: AVMediaTypeVideo
|
||||
position: AVCaptureDevicePositionUnspecified];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue