[vlc-devel] [PATCH 2/2] avcodec: conditionally link SecureTransport and VideoToolbox if included

Felix Paul Kühne fkuehne at videolan.org
Mon Sep 28 14:50:10 CEST 2015


---
 configure.ac              | 23 +++++++++++++++++++++++
 modules/codec/Makefile.am |  6 ++++++
 2 files changed, 29 insertions(+)

diff --git a/configure.ac b/configure.ac
index 55513bd..5ab9760 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2482,6 +2482,29 @@ AS_IF([test "${enable_vda}" != "no"], [
 AM_CONDITIONAL([HAVE_AVCODEC_VDA], [test "${have_avcodec_vda}" = "yes"])
 
 dnl
+dnl avcodec may contain a VideoToolbox decoder,
+dnl so we need to conditionally link the framework
+dnl
+have_avcodec_videotoolbox="no"
+if test "${SYS}" = "darwin"; then
+AS_IF([test "x${have_avcodec}" = "xyes"], [
+AC_CHECK_HEADERS(VideoToolbox/VideoToolbox.h,
+  [
+	AC_CHECK_HEADERS(libavcodec/videotoolbox.h, [
+	   have_avcodec_videotoolbox="yes"
+	],)
+],)
+],)
+AS_IF([test "${have_avcodec_videotoolbox}" = "yes"], [
+ SAVE_LIBS=$LIBS
+ LIBS="$LIBS $AVCODEC_LIBS"
+ AC_CHECK_FUNCS([av_videotoolbox_alloc_context])
+ LIBS=$SAVE_LIBS
+])
+fi
+AM_CONDITIONAL([HAVE_AVCODEC_VIDEOTOOLBOX], [test "${have_avcodec_videotoolbox}" = "yes"])
+
+dnl
 dnl  avformat demuxer/muxer plugin
 dnl
 
diff --git a/modules/codec/Makefile.am b/modules/codec/Makefile.am
index 868bdcc..90099be 100644
--- a/modules/codec/Makefile.am
+++ b/modules/codec/Makefile.am
@@ -319,6 +319,12 @@ libavcodec_plugin_la_SOURCES += demux/avformat/mux.c
 endif
 libavcodec_plugin_la_CFLAGS += -DMERGE_FFMPEG
 endif
+if HAVE_DARWIN
+libavcodec_plugin_la_LDFLAGS += -Wl,-framework,Foundation -Wl,-framework,Security,-framework,CoreFoundation
+if HAVE_AVCODEC_VIDEOTOOLBOX
+libavcodec_plugin_la_LDFLAGS += -Wl,-framework,VideoToolbox -Wl,-framework,CoreMedia -Wl,-framework,CoreVideo
+endif
+endif
 if HAVE_AVCODEC
 codec_LTLIBRARIES += libavcodec_plugin.la
 endif
-- 
2.5.1



More information about the vlc-devel mailing list