add A GST_PLUGIN_PATH_ONLY env var; if it is set, it will only scan the GST_PLUGIN_PA...
authorThomas Vander Stichele <thomas@apestaart.org>
Wed, 29 Jun 2005 12:25:05 +0000 (12:25 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Wed, 29 Jun 2005 12:25:05 +0000 (12:25 +0000)
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

ChangeLog
check/Makefile.am
gst/gst.c
gst/gstregistry.c
tests/check/Makefile.am

index 11d4018..4bf06d5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2005-06-29  Thomas Vander Stichele  <thomas at apestaart dot org>
 
+       * 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  <thomas at apestaart dot org>
+
        * docs/gst/gstreamer-sections.txt:
        * docs/gst/tmpl/gstbasesrc.sgml:
        * gst/gstelement.c:
index 01e8e6e..17db866 100644 (file)
@@ -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@
index a5e6ab8..1337d40 100644 (file)
--- 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")) {
index 44352fb..1d43232 100644 (file)
@@ -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));
 }
 
index 01e8e6e..17db866 100644 (file)
@@ -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@