From 75a7b9e47799749dd9d147bb0c3153227bcaeba7 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 4 Nov 2023 01:08:56 -0500 Subject: [PATCH] Add guards around AV1 checks --- Limelight/ViewControllers/MainFrameViewController.m | 4 ++++ Limelight/ViewControllers/SettingsViewController.m | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Limelight/ViewControllers/MainFrameViewController.m b/Limelight/ViewControllers/MainFrameViewController.m index b900df0..169bb13 100644 --- a/Limelight/ViewControllers/MainFrameViewController.m +++ b/Limelight/ViewControllers/MainFrameViewController.m @@ -664,9 +664,11 @@ static NSMutableSet* hostList; switch (streamSettings.preferredCodec) { case CODEC_PREF_AV1: +#if defined(__IPHONE_16_0) || defined(__TVOS_16_0) if (VTIsHardwareDecodeSupported(kCMVideoCodecType_AV1)) { _streamConfig.supportedVideoFormats |= VIDEO_FORMAT_AV1_MAIN8; } +#endif // Fall-through case CODEC_PREF_AUTO: @@ -691,11 +693,13 @@ static NSMutableSet* hostList; } } +#if defined(__IPHONE_16_0) || defined(__TVOS_16_0) // Add the AV1 Main10 format if AV1 and HDR are both enabled and supported if ((_streamConfig.supportedVideoFormats & VIDEO_FORMAT_MASK_AV1) && streamSettings.enableHdr && VTIsHardwareDecodeSupported(kCMVideoCodecType_AV1) && (AVPlayer.availableHDRModes & AVPlayerHDRModeHDR10) != 0) { _streamConfig.supportedVideoFormats |= VIDEO_FORMAT_AV1_MAIN10; } +#endif } - (void)appLongClicked:(TemporaryApp *)app view:(UIView *)view { diff --git a/Limelight/ViewControllers/SettingsViewController.m b/Limelight/ViewControllers/SettingsViewController.m index 8e105c8..7114c32 100644 --- a/Limelight/ViewControllers/SettingsViewController.m +++ b/Limelight/ViewControllers/SettingsViewController.m @@ -200,7 +200,10 @@ BOOL isCustomResolution(CGSize res) { } // Disable codec selector segments for unsupported codecs - if (!VTIsHardwareDecodeSupported(kCMVideoCodecType_AV1)) { +#if defined(__IPHONE_16_0) || defined(__TVOS_16_0) + if (!VTIsHardwareDecodeSupported(kCMVideoCodecType_AV1)) +#endif + { [self.codecSelector setEnabled:NO forSegmentAtIndex:2]; } if (!VTIsHardwareDecodeSupported(kCMVideoCodecType_HEVC)) {