From: Stian Selnes Date: Thu, 2 May 2013 08:09:29 +0000 (+0200) Subject: registry: set env GST_REGISTRY_DISABLE=yes to disable registry X-Git-Tag: 1.12.0~292 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fd728c253139daa1ced5fdedf78540ee14a9f480;p=platform%2Fupstream%2Fgstreamer.git registry: set env GST_REGISTRY_DISABLE=yes to disable registry If GST_REGISTRY_DISABLE=yes the registry is disabled similar to compile time switch GST_DISABLE_REGISTRY. https://bugzilla.gnome.org/show_bug.cgi?id=773089 --- diff --git a/gst/gst.c b/gst/gst.c index 6c2953d..3cf067e 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -131,6 +131,7 @@ HMODULE _priv_gst_dll_handle = NULL; #ifndef GST_DISABLE_REGISTRY GList *_priv_gst_plugin_paths = NULL; /* for delayed processing in init_post */ +extern gboolean _priv_gst_disable_registry; extern gboolean _priv_gst_disable_registry_update; #endif @@ -511,6 +512,15 @@ init_pre (GOptionContext * context, GOptionGroup * group, gpointer data, GST_INFO ("Using library installed in %s", libdir); g_free (libdir); +#ifndef GST_DISABLE_REGISTRY + { + const gchar *disable_registry; + if ((disable_registry = g_getenv ("GST_REGISTRY_DISABLE"))) { + _priv_gst_disable_registry = (strcmp (disable_registry, "yes") == 0); + } + } +#endif + /* Print some basic system details if possible (OS/architecture) */ #ifdef HAVE_SYS_UTSNAME_H { @@ -899,7 +909,8 @@ parse_one_option (gint opt, const gchar * arg, GError ** err) break; case ARG_PLUGIN_PATH: #ifndef GST_DISABLE_REGISTRY - split_and_iterate (arg, G_SEARCHPATH_SEPARATOR_S, add_path_func, NULL); + if (!_priv_gst_disable_registry) + split_and_iterate (arg, G_SEARCHPATH_SEPARATOR_S, add_path_func, NULL); #endif /* GST_DISABLE_REGISTRY */ break; case ARG_PLUGIN_LOAD: @@ -910,7 +921,8 @@ parse_one_option (gint opt, const gchar * arg, GError ** err) break; case ARG_REGISTRY_UPDATE_DISABLE: #ifndef GST_DISABLE_REGISTRY - _priv_gst_disable_registry_update = TRUE; + if (!_priv_gst_disable_registry) + _priv_gst_disable_registry_update = TRUE; #endif break; case ARG_REGISTRY_FORK_DISABLE: diff --git a/gst/gstregistry.c b/gst/gstregistry.c index 541e31c..f16d2eb 100644 --- a/gst/gstregistry.c +++ b/gst/gstregistry.c @@ -185,6 +185,8 @@ static gboolean _gst_enable_registry_fork = DEFAULT_FORK; extern GSList *_priv_gst_preload_plugins; #ifndef GST_DISABLE_REGISTRY +/* Set to TRUE to disable registry, behaves similar to GST_DISABLE_REGISTRY */ +gboolean _priv_gst_disable_registry = FALSE; /*set to TRUE when registry needn't to be updated */ gboolean _priv_gst_disable_registry_update = FALSE; extern GList *_priv_gst_plugin_paths; @@ -1838,14 +1840,19 @@ gst_update_registry (void) gboolean res; #ifndef GST_DISABLE_REGISTRY - GError *err = NULL; + if (!_priv_gst_disable_registry) { + GError *err = NULL; - res = ensure_current_registry (&err); - if (err) { - GST_WARNING ("registry update failed: %s", err->message); - g_error_free (err); + res = ensure_current_registry (&err); + if (err) { + GST_WARNING ("registry update failed: %s", err->message); + g_error_free (err); + } else { + GST_LOG ("registry update succeeded"); + } } else { - GST_LOG ("registry update succeeded"); + GST_INFO ("registry update disabled by environment"); + res = TRUE; } #else