[vlc-devel] [PATCH 3/5] videotoolbox: Do not set unsupported properties for iOS

Marvin Scholz epirat07 at gmail.com
Fri Jan 24 15:21:38 CET 2020


Instead of defining these constants when not building for macOS and
setting them anyway on iOS even though those are not supported there,
just set them on macOS and never do this for iOS.
---
 modules/codec/videotoolbox.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/modules/codec/videotoolbox.c b/modules/codec/videotoolbox.c
index 28d97703a0..b14aa527d6 100644
--- a/modules/codec/videotoolbox.c
+++ b/modules/codec/videotoolbox.c
@@ -51,11 +51,6 @@
 #define ALIGN_16( x ) ( ( ( x ) + 15 ) / 16 * 16 )
 #define VT_RESTART_MAX 1
 
-#if (!TARGET_OS_OSX)
-const CFStringRef kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder = CFSTR("EnableHardwareAcceleratedVideoDecoder");
-const CFStringRef kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder = CFSTR("RequireHardwareAcceleratedVideoDecoder");
-#endif
-
 #pragma mark - module descriptor
 
 static int OpenDecoder(vlc_object_t *);
@@ -1136,6 +1131,7 @@ static CFMutableDictionaryRef CreateSessionDescriptionFormat(decoder_t *p_dec,
     CFDictionarySetValue(decoderConfiguration, kCVImageBufferYCbCrMatrixKey,
                          yuvmatrix);
 
+#if TARGET_OS_OSX
     /* enable HW accelerated playback, since this is optional on OS X
      * note that the backend may still fallback on software mode if no
      * suitable hardware is available */
@@ -1149,6 +1145,7 @@ static CFMutableDictionaryRef CreateSessionDescriptionFormat(decoder_t *p_dec,
         CFDictionarySetValue(decoderConfiguration,
                              kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder,
                              kCFBooleanTrue);
+#endif
 
     CFDictionarySetValue(decoderConfiguration,
                          kVTDecompressionPropertyKey_FieldMode,
-- 
2.20.1 (Apple Git-117)



More information about the vlc-devel mailing list