From: Thomas Vander Stichele Date: Wed, 29 Jun 2005 12:25:05 +0000 (+0000) Subject: add A GST_PLUGIN_PATH_ONLY env var; if it is set, it will only scan the GST_PLUGIN_PA... X-Git-Tag: RELEASE-0_9_2~333 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a30e9069d104fd65c7baccad04eda329fb320531;p=platform%2Fupstream%2Fgstreamer.git add A GST_PLUGIN_PATH_ONLY env var; if it is set, it will only scan the GST_PLUGIN_PATH locations, and not add system... Original commit message from CVS: * check/Makefile.am: * gst/gst.c: (add_path_func), (init_pre): * gst/gstregistry.c: (gst_registry_add_path): add A GST_PLUGIN_PATH_ONLY env var; if it is set, it will only scan the GST_PLUGIN_PATH locations, and not add system locations --- diff --git a/ChangeLog b/ChangeLog index 11d4018..4bf06d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2005-06-29 Thomas Vander Stichele + * check/Makefile.am: + * gst/gst.c: (add_path_func), (init_pre): + * gst/gstregistry.c: (gst_registry_add_path): + add A GST_PLUGIN_PATH_ONLY env var; if it is set, it will + only scan the GST_PLUGIN_PATH locations, and not add + system locations + +2005-06-29 Thomas Vander Stichele + * docs/gst/gstreamer-sections.txt: * docs/gst/tmpl/gstbasesrc.sgml: * gst/gstelement.c: diff --git a/check/Makefile.am b/check/Makefile.am index 01e8e6e..17db866 100644 --- a/check/Makefile.am +++ b/check/Makefile.am @@ -1,5 +1,6 @@ TESTS_ENVIRONMENT=\ - GST_PLUGIN_PATH=$(top_builddir)/gst:$(top_builddir)/check \ + GST_PLUGIN_PATH_ONLY=yes \ + GST_PLUGIN_PATH=$(top_builddir)/gst \ GST_REGISTRY=$(top_builddir)/check/test-registry.xml plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@ diff --git a/gst/gst.c b/gst/gst.c index a5e6ab8..1337d40 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -388,7 +388,6 @@ add_path_func (gpointer data, gpointer user_data) { GstRegistry *registry = GST_REGISTRY (user_data); - GST_INFO ("Adding plugin path: \"%s\"", (gchar *) data); gst_registry_add_path (registry, (gchar *) data); } #endif @@ -504,8 +503,10 @@ init_pre (void) PLUGINS_BUILDDIR "/gst/schedulers"); gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/indexers"); #else - /* add the main (installed) library path */ - gst_registry_add_path (_global_registry, PLUGINS_DIR); + /* add the main (installed) library path if GST_PLUGIN_PATH_ONLY not set */ + if (g_getenv ("GST_PLUGIN_PATH_ONLY") != NULL) { + gst_registry_add_path (_global_registry, PLUGINS_DIR); + } #endif /* PLUGINS_USE_BUILDDIR */ if (g_getenv ("GST_REGISTRY")) { diff --git a/gst/gstregistry.c b/gst/gstregistry.c index 44352fb..1d43232 100644 --- a/gst/gstregistry.c +++ b/gst/gstregistry.c @@ -41,6 +41,8 @@ #include "gstmarshal.h" #include "gstfilter.h" +#define GST_CAT_DEFAULT GST_CAT_GST_INIT + /* Element signals and args */ enum { @@ -227,11 +229,17 @@ gst_registry_add_path (GstRegistry * registry, const gchar * path) g_return_if_fail (GST_IS_REGISTRY (registry)); g_return_if_fail (path != NULL); + if (strlen (path) == 0) { + GST_INFO ("Ignoring empty plugin path"); + return; + } + if (g_list_find_custom (registry->paths, path, (GCompareFunc) strcmp)) { g_warning ("path %s already added to registry", path); return; } + GST_INFO ("Adding plugin path: \"%s\"", path); registry->paths = g_list_append (registry->paths, g_strdup (path)); } diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am index 01e8e6e..17db866 100644 --- a/tests/check/Makefile.am +++ b/tests/check/Makefile.am @@ -1,5 +1,6 @@ TESTS_ENVIRONMENT=\ - GST_PLUGIN_PATH=$(top_builddir)/gst:$(top_builddir)/check \ + GST_PLUGIN_PATH_ONLY=yes \ + GST_PLUGIN_PATH=$(top_builddir)/gst \ GST_REGISTRY=$(top_builddir)/check/test-registry.xml plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@