[vlc-commits] videotoolbox: Fix compilation with older SDK

David Fuhrmann git at videolan.org
Sun Nov 26 17:51:09 CET 2017


vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sun Nov 26 17:47:03 2017 +0100| [b739ebad4cab5203abbbdad525966eccad67475b] | committer: David Fuhrmann

videotoolbox: Fix compilation with older SDK

Currently, this cannot compile with an older SDK due to linker
errors. Therefore, only enable the code path using the function
if the SDK version is high enough.
For this feature to work, code needs to be compiled with the SDK
which supports this function.

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

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

diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 368e3a962c..63a780d8ac 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -67,13 +67,6 @@
 enum { kCMVideoCodecType_HEVC = 'hvc1' };
 #endif
 
-#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 (!TARGET_OS_OSX || MAC_OS_X_VERSION_MAX_ALLOWED < 1090)
 const CFStringRef kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder = CFSTR("EnableHardwareAcceleratedVideoDecoder");
 const CFStringRef kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder = CFSTR("RequireHardwareAcceleratedVideoDecoder");
@@ -1445,10 +1438,15 @@ static BOOL deviceSupportsHEVC()
 {
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wpartial-availability"
+
+#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)
     if (VTIsHardwareDecodeSupported != nil)
         return VTIsHardwareDecodeSupported(kCMVideoCodecType_HEVC);
-#pragma clang diagnostic pop
     else
+#endif
+#pragma clang diagnostic pop
         return NO;
 }
 



More information about the vlc-commits mailing list