Skip to content

Instantly share code, notes, and snippets.

@ramcq
Created March 23, 2016 13:57
Show Gist options
  • Save ramcq/6919a17a59d4b4be915d to your computer and use it in GitHub Desktop.
Save ramcq/6919a17a59d4b4be915d to your computer and use it in GitHub Desktop.
extra plugin dir for GStreamer
Index: gstreamer-1.6.1/common/m4/gst-plugindir.m4
===================================================================
--- gstreamer-1.6.1.orig/common/m4/gst-plugindir.m4
+++ gstreamer-1.6.1/common/m4/gst-plugindir.m4
@@ -15,3 +15,20 @@ AC_DEFUN([AG_GST_SET_PLUGINDIR],
plugindir="\$(libdir)/gstreamer-$GST_API_VERSION"
AC_SUBST(plugindir)
])
+
+dnl AC_DEFINE EXTRA_PLUGINDIR to the full location where additional plug-ins
+dnl that can't be distributed with the core image will be installed.
+dnl AC_SUBST extra_plugindir, to be used in Makefile.am's
+
+AC_DEFUN([AG_GST_SET_EXTRA_PLUGINDIR],
+[
+ dnl define location of the directory for extra plugins
+ AS_AC_EXPAND(EXTRA_PLUGINDIR, ${localstatedir}/lib/codecs/gstreamer-$GST_API_VERSION)
+ AC_DEFINE_UNQUOTED(EXTRA_PLUGINDIR, "$EXTRA_PLUGINDIR",
+ [directory where extra plugins are located])
+ AC_MSG_NOTICE([Using $EXTRA_PLUGINDIR as the plugin install location])
+
+ dnl extra plugin directory configure-time variable for use in Makefile.am
+ extra_plugindir="\${localstatedir}/lib/codecs/gstreamer-$GST_API_VERSION"
+ AC_SUBST(extra_plugindir)
+])
Index: gstreamer-1.6.1/configure.ac
===================================================================
--- gstreamer-1.6.1.orig/configure.ac
+++ gstreamer-1.6.1/configure.ac
@@ -842,8 +842,9 @@ AC_DEFINE_UNQUOTED(LIBDIR, "$LIBDIR", [l
AS_AC_EXPAND(DATADIR, $datadir)
AC_DEFINE_UNQUOTED(GST_DATADIR, "$DATADIR", [data dir])
-dnl set location of plugin directory
+dnl set location of plugin directories
AG_GST_SET_PLUGINDIR
+AG_GST_SET_EXTRA_PLUGINDIR
dnl make sure it doesn't complain about unused variables if debugging is disabled
NO_WARNINGS=""
@@ -1060,6 +1061,7 @@ sed \
-e 's/.* PACKAGE_TARNAME$/#define PACKAGE_TARNAME "'$PACKAGE_TARNAME'"/' \
-e 's/.* PACKAGE_VERSION$/#define PACKAGE_VERSION "'$PACKAGE_VERSION'"/' \
-e 's/.* PLUGINDIR$/#ifdef _DEBUG\n# define PLUGINDIR PREFIX "\\\\debug\\\\lib\\\\gstreamer-1.0"\n#else\n# define PLUGINDIR PREFIX "\\\\lib\\\\gstreamer-1.0"\n#endif/' \
+ -e 's/.* EXTRA_PLUGINDIR$/#ifdef _DEBUG\n# define EXTRA_PLUGINDIR PREFIX "\\\\debug\\\\var\\\\lib\\\\codecs\\\\gstreamer-1.0"\n#else\n# define EXTRA_PLUGINDIR PREFIX "\\\\var\\\\lib\\\\codecs\\\\gstreamer-1.0"\n#endif/' \
-e 's/.* GST_PLUGIN_SCANNER_INSTALLED$/#define GST_PLUGIN_SCANNER_INSTALLED LIBDIR "\\\\gst-plugin-scanner"/' \
-e 's/.* VERSION$/#define VERSION "'$VERSION'"/' \
config.h.in >win32/common/config.h-new
Index: gstreamer-1.6.1/gst/gstregistry.c
===================================================================
--- gstreamer-1.6.1.orig/gst/gstregistry.c
+++ gstreamer-1.6.1/gst/gstregistry.c
@@ -1674,6 +1674,11 @@ scan_and_update_registry (GstRegistry *
g_free (base_dir);
}
#else
+ /* plugins in /var/lib/codecs also take precedence
+ * over system-installed ones */
+ GST_DEBUG ("scanning extra plugins %s", EXTRA_PLUGINDIR);
+ changed |= gst_registry_scan_path_internal (&context, EXTRA_PLUGINDIR);
+
GST_DEBUG ("scanning main plugins %s", PLUGINDIR);
changed |= gst_registry_scan_path_internal (&context, PLUGINDIR);
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment