From e6b538402764a29351ffeecdbf2407ed8e7398a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 30 Aug 2016 16:21:25 +0300 Subject: applemedia: Conditionally compile qtkitvideosrc The API was deprecated in 10.9 and apparently does not exist in the SDK for macOS Sierra anymore. https://bugzilla.gnome.org/show_bug.cgi?id=770587 --- configure.ac | 5 +++++ sys/applemedia/Makefile.am | 10 ++++++++-- sys/applemedia/plugin.m | 5 ++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index f0a1e1713..418268c35 100644 --- a/configure.ac +++ b/configure.ac @@ -531,6 +531,7 @@ dnl *** plug-ins to exclude *** AC_CHECK_HEADER(AVFoundation/AVFoundation.h, HAVE_AVFOUNDATION="yes", HAVE_AVFOUNDATION="no", [-]) AC_CHECK_HEADER(MobileCoreServices/MobileCoreServices.h, HAVE_IOS="yes", HAVE_IOS="no", [-]) AC_CHECK_HEADER(VideoToolbox/VideoToolbox.h, HAVE_VIDEOTOOLBOX="yes", HAVE_VIDEOTOOLBOX="no", [-]) +AC_CHECK_HEADER(QTKit/QTKit.h, HAVE_QTKIT="yes", HAVE_QTKIT="no", [-]) if test "x$HAVE_VIDEOTOOLBOX" = "xyes"; then old_LIBS=$LIBS @@ -557,6 +558,10 @@ if test "x$HAVE_VIDEOTOOLBOX" = "xyes"; then AC_DEFINE(HAVE_VIDEOTOOLBOX, 1, [Define if building with VideoToolbox]) fi +AM_CONDITIONAL(HAVE_QTKIT, test "x$HAVE_QTKIT" = "xyes") +if test "x$HAVE_QTKIT" = "xyes"; then + AC_DEFINE(HAVE_QTKIT, 1, [Define if building with QTKit]) +fi dnl disable gst plugins we might not be able to build on this dnl platform: (ugly but minimally invasive) dnl FIXME: maybe move to sys, or make work with winsock2 diff --git a/sys/applemedia/Makefile.am b/sys/applemedia/Makefile.am index 4e415249d..f1e678558 100644 --- a/sys/applemedia/Makefile.am +++ b/sys/applemedia/Makefile.am @@ -92,16 +92,22 @@ libgstapplemedia_la_LDFLAGS += \ else libgstapplemedia_la_SOURCES += \ - qtkitvideosrc.m \ iosurfacememory.c libgstapplemedia_la_LDFLAGS += \ -Wl,-framework -Wl,Cocoa \ - -Wl,-framework -Wl,QTKit \ -Wl,-framework -Wl,IOSurface endif +if HAVE_QTKIT +libgstapplemedia_la_SOURCES += \ + qtkitvideosrc.m + +libgstapplemedia_la_LDFLAGS += \ + -Wl,-framework -Wl,QTKit +endif + if HAVE_AVFOUNDATION libgstapplemedia_la_SOURCES += \ diff --git a/sys/applemedia/plugin.m b/sys/applemedia/plugin.m index 0ff4ec1a5..1b341c916 100644 --- a/sys/applemedia/plugin.m +++ b/sys/applemedia/plugin.m @@ -25,7 +25,8 @@ #include "corevideomemory.h" #ifdef HAVE_IOS #include "iosassetsrc.h" -#else +#endif +#ifdef HAVE_QTKIT #include "qtkitvideosrc.h" #endif #ifdef HAVE_AVFOUNDATION @@ -71,7 +72,9 @@ plugin_init (GstPlugin * plugin) GST_TYPE_IOS_ASSET_SRC); #else enable_mt_mode (); +#endif +#ifdef HAVE_QTKIT res = gst_element_register (plugin, "qtkitvideosrc", GST_RANK_SECONDARY, GST_TYPE_QTKIT_VIDEO_SRC); #endif -- cgit v1.2.1