From c82fa4f845fb6140b90177186fa87fe4cd9a1411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 15 Sep 2014 15:12:31 +0300 Subject: [PATCH] applemedia: Don't include VideoToolbox on iOS < 8.0 It's private API and does not work without a jailbroken device. --- configure.ac | 13 +++++++++++++ sys/applemedia/vtdec.c | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7abdd353b3..5d9c75c246 100644 --- a/configure.ac +++ b/configure.ac @@ -514,6 +514,19 @@ if test "x$HAVE_IOS" = "xyes"; then fi AM_CONDITIONAL(HAVE_VIDEOTOOLBOX, test "x$HAVE_VIDEOTOOLBOX" = "xyes") +if test "x$HAVE_IOS" = "xyes"; then + AC_MSG_CHECKING([Checking for __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0]) + + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ + #if !defined(__IPHONE_OS_VERSION_MIN_REQUIRED) || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0) + #error "Need iOS >= 8.0 for VideoToolbox" + #endif + ]])], [ AC_MSG_RESULT(yes) + HAVE_VIDEOTOOLBOX="yes" + ], [ AC_MSG_RESULT(no) + HAVE_VIDEOTOOLBOX="no" + ]) +fi if test "x$HAVE_VIDEOTOOLBOX" = "xyes"; then AC_DEFINE(HAVE_VIDEOTOOLBOX, 1, [Define if building with VideoToolbox]) fi diff --git a/sys/applemedia/vtdec.c b/sys/applemedia/vtdec.c index 6417e3454d..2d2e0b5f38 100644 --- a/sys/applemedia/vtdec.c +++ b/sys/applemedia/vtdec.c @@ -97,7 +97,7 @@ static GstStaticPadTemplate gst_vtdec_sink_template = #endif /* define EnableHardwareAcceleratedVideoDecoder in < 10.9 */ -#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0) || (defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED < 1090) +#if defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED < 1090 const CFStringRef kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder = CFSTR ("EnableHardwareAcceleratedVideoDecoder");