[vlc-commits] VT: Improve SDK version checks

Marvin Scholz git at videolan.org
Sat Nov 25 15:20:01 CET 2017


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Sat Nov 25 15:14:58 2017 +0100| [80ac12378f3593a33a36c706c40935c57a6e0e8e] | committer: Marvin Scholz

VT: Improve SDK version checks

- Not only the macOS SDK should be checked, since VT is supported on
  iOS, macOS and tvOS.
- Add missing SDK check for VTIsHardwareDecodeSupported.
- Fix SDK check for the kVTVideoDecoderSpecification_* constants.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=80ac12378f3593a33a36c706c40935c57a6e0e8e
---

 modules/codec/videotoolbox.m | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 8b85b1a303..368e3a962c 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -60,20 +60,30 @@
 
 #endif
 
-#ifndef MAC_OS_X_VERSION_10_11
+// Define stuff for older SDKs
+#if (TARGET_OS_OSX && MAC_OS_X_VERSION_MAX_ALLOWED < 101100) || \
+    (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED < 90000) || \
+    (TARGET_OS_TV && __TV_OS_VERSION_MAX_ALLOWED < 90000)
 enum { kCMVideoCodecType_HEVC = 'hvc1' };
 #endif
 
-#pragma mark - module descriptor
-
-static int OpenDecoder(vlc_object_t *);
-static void CloseDecoder(vlc_object_t *);
+#if (TARGET_OS_OSX && MAC_OS_X_VERSION_MAX_ALLOWED < 101300) || \
+    (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED < 110000) || \
+    (TARGET_OS_TV && __TV_OS_VERSION_MAX_ALLOWED < 110000)
+Boolean
+VTIsHardwareDecodeSupported( CMVideoCodecType codecType ) API_AVAILABLE(macosx(10.13), ios(11.0), tvos(11.0));
+#endif
 
-#if MAC_OS_X_VERSION_MIN_ALLOWED < 1090
+#if (!TARGET_OS_OSX || MAC_OS_X_VERSION_MAX_ALLOWED < 1090)
 const CFStringRef kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder = CFSTR("EnableHardwareAcceleratedVideoDecoder");
 const CFStringRef kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder = CFSTR("RequireHardwareAcceleratedVideoDecoder");
 #endif
 
+#pragma mark - module descriptor
+
+static int OpenDecoder(vlc_object_t *);
+static void CloseDecoder(vlc_object_t *);
+
 #define VT_REQUIRE_HW_DEC N_("Use Hardware decoders only")
 #define VT_TEMPO_DEINTERLACE N_("Deinterlacing")
 #define VT_TEMPO_DEINTERLACE_LONG N_("If interlaced content is detected, temporal deinterlacing is enabled at the expense of a pipeline delay.")



More information about the vlc-commits mailing list