gstreamer: registry: add support for GST_REGISTRY_REUSE_PLUGIN_SCANNER=no

Jan Schmidt thaytan at noraisin.net
Thu Oct 27 01:54:38 PDT 2011


I'm not sure what the failure mode is when it runs into trouble on
Android, but if it's just that a plugin fails to load once there are too
many shared libs and stuff, then a solution might be to let the scanner
die, and then re-launch the plugin scanner and check any plugin that
crashes twice. At worst, plugins that actually crash get checked twice,
at best you never need to re-spawn the plugin scanner.

J.

On Wed, 2011-10-26 at 03:20 -0700, Tim Müller wrote:
> Module: gstreamer
> Branch: master
> Commit: dd9f244f033ba3978d6ee26d9205d29fdd862d7c
> URL:    http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=dd9f244f033ba3978d6ee26d9205d29fdd862d7c
> 
> Author: Tim-Philipp Müller <tim.muller at collabora.co.uk>
> Date:   Tue Oct 18 23:19:47 2011 +0100
> 
> registry: add support for GST_REGISTRY_REUSE_PLUGIN_SCANNER=no
> 
> This will make sure we spawn a new plugin scanner helper for each plugin
> to be introspected, which helps with making sure we don't load too many
> shared objects (libs, plugins) at the same time on systems where there
> is a hard limit like on Android.
> 
> A better version might re-use the scanner for up to N times, though
> it's not clear whether that would actually improve things dramatically.
> 
> https://bugzilla.gnome.org/show_bug.cgi?id=662091
> 
> ---
> 
>  gst/gstregistry.c |   13 +++++++++++++
>  1 files changed, 13 insertions(+), 0 deletions(-)
> 
> diff --git a/gst/gstregistry.c b/gst/gstregistry.c
> index 56107c5..ddbb789 100644
> --- a/gst/gstregistry.c
> +++ b/gst/gstregistry.c
> @@ -175,6 +175,8 @@ extern GList *_priv_gst_plugin_paths;
>  
>  /* Set to TRUE when the registry cache should be disabled */
>  gboolean _gst_disable_registry_cache = FALSE;
> +
> +static gboolean __registry_reuse_plugin_scanner = TRUE;
>  #endif
>  
>  /* Element signals and args */
> @@ -1084,6 +1086,11 @@ gst_registry_scan_plugin_file (GstRegistryScanContext * context,
>      changed = TRUE;
>    }
>  
> +  if (!__registry_reuse_plugin_scanner) {
> +    clear_scan_context (context);
> +    context->helper_state = REGISTRY_SCAN_HELPER_NOT_STARTED;
> +  }
> +
>    return changed;
>  }
>  
> @@ -1616,6 +1623,12 @@ ensure_current_registry (GError ** error)
>    }
>  
>    if (do_update) {
> +    const gchar *reuse_env;
> +
> +    if ((reuse_env = g_getenv ("GST_REGISTRY_REUSE_PLUGIN_SCANNER"))) {
> +      /* do reuse for any value different from "no" */
> +      __registry_reuse_plugin_scanner = (strcmp (reuse_env, "no") != 0);
> +    }
>      /* now check registry */
>      GST_DEBUG ("Updating registry cache");
>      scan_and_update_registry (default_registry, registry_file, TRUE, error);
> 
> _______________________________________________
> gstreamer-commits mailing list
> gstreamer-commits at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-commits

-- 
Jan Schmidt <thaytan at noraisin.net>



More information about the gstreamer-devel mailing list