Remove guards for older macOS and SDK versions

This commit is contained in:
Cameron Gutman 2024-07-26 00:38:54 -05:00
parent e548697a36
commit eb6d16fdcf
3 changed files with 16 additions and 33 deletions

View File

@ -303,16 +303,11 @@ public:
case COLORSPACE_REC_2020: case COLORSPACE_REC_2020:
// This is necessary to ensure HDR works properly with external displays on macOS Sonoma. // This is necessary to ensure HDR works properly with external displays on macOS Sonoma.
if (frame->color_trc == AVCOL_TRC_SMPTE2084) { if (frame->color_trc == AVCOL_TRC_SMPTE2084) {
if (@available(macOS 11.0, *)) {
m_ColorSpace = CGColorSpaceCreateWithName(kCGColorSpaceITUR_2100_PQ); m_ColorSpace = CGColorSpaceCreateWithName(kCGColorSpaceITUR_2100_PQ);
} }
else { else {
m_ColorSpace = CGColorSpaceCreateWithName(kCGColorSpaceITUR_2020); m_ColorSpace = CGColorSpaceCreateWithName(kCGColorSpaceITUR_2020);
} }
}
else {
m_ColorSpace = CGColorSpaceCreateWithName(kCGColorSpaceITUR_2020);
}
break; break;
case COLORSPACE_REC_601: case COLORSPACE_REC_601:
m_ColorSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB); m_ColorSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);

View File

@ -58,7 +58,6 @@ bool VTBaseRenderer::checkDecoderCapabilities(id<MTLDevice> device, PDECODER_PAR
} }
} }
else if (params->videoFormat & VIDEO_FORMAT_MASK_AV1) { else if (params->videoFormat & VIDEO_FORMAT_MASK_AV1) {
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 130000
if (!VTIsHardwareDecodeSupported(kCMVideoCodecType_AV1)) { if (!VTIsHardwareDecodeSupported(kCMVideoCodecType_AV1)) {
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
"No HW accelerated AV1 decode via VT"); "No HW accelerated AV1 decode via VT");
@ -67,11 +66,6 @@ bool VTBaseRenderer::checkDecoderCapabilities(id<MTLDevice> device, PDECODER_PAR
// 10-bit is part of the Main profile for AV1, so it will always // 10-bit is part of the Main profile for AV1, so it will always
// be present on hardware that supports 8-bit. // be present on hardware that supports 8-bit.
#else
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
"AV1 requires building with Xcode 14 or later");
return false;
#endif
} }
return true; return true;

View File

@ -525,7 +525,6 @@ public:
return nullptr; return nullptr;
} }
if (@available(macOS 11.0, *)) {
NSArray<id<MTLDevice>> *devices = [MTLCopyAllDevices() autorelease]; NSArray<id<MTLDevice>> *devices = [MTLCopyAllDevices() autorelease];
if (devices.count == 0) { if (devices.count == 0) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
@ -548,11 +547,6 @@ public:
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
"Avoiding Metal renderer due to use of dGPU/eGPU. Use VT_FORCE_METAL=1 to override."); "Avoiding Metal renderer due to use of dGPU/eGPU. Use VT_FORCE_METAL=1 to override.");
} }
}
else {
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
"Metal renderer requires macOS Big Sur or later");
}
return nullptr; return nullptr;
} }