From 0d74dc802acb8be3d28e9c1a844e09d9801e0a16 Mon Sep 17 00:00:00 2001 From: Matthieu Bouron Date: Wed, 30 Oct 2013 12:40:01 +0000 Subject: [PATCH] applemedia: enable avfvideosrc if AVFoundation is present --- sys/applemedia/Makefile.am | 11 +++++++++-- sys/applemedia/plugin.m | 11 ++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/sys/applemedia/Makefile.am b/sys/applemedia/Makefile.am index ebd760223f..28a2ac24f6 100644 --- a/sys/applemedia/Makefile.am +++ b/sys/applemedia/Makefile.am @@ -75,12 +75,10 @@ if HAVE_IOS libgstapplemedia_la_SOURCES += \ iosassetsrc.m -# avfvideosrc.m libgstapplemedia_la_LDFLAGS += \ -Wl,-framework -Wl,Foundation \ -Wl,-framework -Wl,AssetsLibrary -# -Wl,-framework -Wl,AVFoundation else @@ -95,3 +93,12 @@ libgstapplemedia_la_LDFLAGS += \ endif +if HAVE_AVFOUNDATION + +libgstapplemedia_la_SOURCES += \ + avfvideosrc.m + +libgstapplemedia_la_LDFLAGS += \ + -Wl,-framework -Wl,AVFoundation + +endif diff --git a/sys/applemedia/plugin.m b/sys/applemedia/plugin.m index ae8279f3ca..e6292521e1 100644 --- a/sys/applemedia/plugin.m +++ b/sys/applemedia/plugin.m @@ -22,11 +22,13 @@ #endif #ifdef HAVE_IOS -#include "avfvideosrc.h" #include "iosassetsrc.h" #else #include "qtkitvideosrc.h" +#endif +#ifdef HAVE_AVFOUNDATION #include +#include "avfvideosrc.h" #endif #include "vth264decbin.h" #include "vth264encbin.h" @@ -53,8 +55,6 @@ plugin_init (GstPlugin * plugin) #ifdef HAVE_IOS res &= gst_element_register (plugin, "iosassetsrc", GST_RANK_SECONDARY, GST_TYPE_IOS_ASSET_SRC); - res &= gst_element_register (plugin, "avfvideosrc", GST_RANK_NONE, - GST_TYPE_AVF_VIDEO_SRC); #else enable_mt_mode (); @@ -62,6 +62,11 @@ plugin_init (GstPlugin * plugin) GST_TYPE_QTKIT_VIDEO_SRC); #endif +#ifdef HAVE_AVFOUNDATION + res &= gst_element_register (plugin, "avfvideosrc", GST_RANK_NONE, + GST_TYPE_AVF_VIDEO_SRC); +#endif + #if 0 res &= gst_element_register (plugin, "vth264decbin", GST_RANK_NONE, GST_TYPE_VT_H264_DEC_BIN);