From 82aae4df74c269765ccfe66c486fbcf3ae01f086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 17 Sep 2014 10:38:20 +0300 Subject: [PATCH] applemedia: Do weak linking with the VideoToolbox framework It does not exist on older OSX and iOS but we still want to be able to use it when it's available. --- sys/applemedia/Makefile.am | 2 +- sys/applemedia/plugin.m | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/applemedia/Makefile.am b/sys/applemedia/Makefile.am index 36f3b9e242..746744245d 100644 --- a/sys/applemedia/Makefile.am +++ b/sys/applemedia/Makefile.am @@ -96,5 +96,5 @@ libgstapplemedia_la_SOURCES += \ vtenc.c \ vtdec.c -libgstapplemedia_la_LDFLAGS += -Wl,-framework -Wl,VideoToolbox +libgstapplemedia_la_LDFLAGS += -Wl,-weak_framework -Wl,VideoToolbox endif diff --git a/sys/applemedia/plugin.m b/sys/applemedia/plugin.m index e85f67a6aa..b9d82b3a76 100644 --- a/sys/applemedia/plugin.m +++ b/sys/applemedia/plugin.m @@ -90,8 +90,11 @@ plugin_init (GstPlugin * plugin) res &= gst_element_register (plugin, "atdec", GST_RANK_MARGINAL, GST_TYPE_ATDEC); #ifdef HAVE_VIDEOTOOLBOX - res &= gst_element_register (plugin, "vtdec", GST_RANK_PRIMARY, GST_TYPE_VTDEC); - gst_vtenc_register_elements (plugin); + /* Check if the framework actually exists at runtime */ + if (VTCompressionSessionCreate != NULL) { + res &= gst_element_register (plugin, "vtdec", GST_RANK_PRIMARY, GST_TYPE_VTDEC); + gst_vtenc_register_elements (plugin); + } #endif return res;