2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3 * 2000 Wim Taymans <wtay@chello.be>
4 * 2005 David A. Schleef <ds@schleef.org>
6 * gstregistry.c: handle registry
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the
20 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, USA.
26 * @short_description: Abstract base class for management of #GstPlugin objects
27 * @see_also: #GstPlugin, #GstPluginFeature
29 * One registry holds the metadata of a set of plugins.
31 * <emphasis role="bold">Design:</emphasis>
33 * The #GstRegistry object is a list of plugins and some functions for dealing
34 * with them. Each #GstPlugin is matched 1-1 with a file on disk, and may or may
35 * not be loaded at a given time. There may be multiple #GstRegistry objects,
36 * but the "default registry" is the only object that has any meaning to the
39 * The registry.xml file is actually a cache of plugin information. This is
40 * unlike versions prior to 0.10, where the registry file was the primary source
41 * of plugin information, and was created by the gst-register command.
43 * The primary source, at all times, of plugin information is each plugin file
44 * itself. Thus, if an application wants information about a particular plugin,
45 * or wants to search for a feature that satisfies given criteria, the primary
46 * means of doing so is to load every plugin and look at the resulting
47 * information that is gathered in the default registry. Clearly, this is a time
48 * consuming process, so we cache information in the registry.xml file.
50 * On startup, plugins are searched for in the plugin search path. This path can
51 * be set directly using the GST_PLUGIN_PATH environment variable. The registry
52 * file is loaded from ~/.gstreamer-$GST_MAJORMINOR/registry-$ARCH.xml or the
53 * file listed in the GST_REGISTRY env var. The only reason to change the
54 * registry location is for testing.
56 * For each plugin that is found in the plugin search path, there could be 3
57 * possibilities for cached information:
60 * <para>the cache may not contain information about a given file.</para>
63 * <para>the cache may have stale information.</para>
66 * <para>the cache may have current information.</para>
70 * In the first two cases, the plugin is loaded and the cache updated. In
71 * addition to these cases, the cache may have entries for plugins that are not
72 * relevant to the current process. These are marked as not available to the
73 * current process. If the cache is updated for whatever reason, it is marked
76 * A dirty cache is written out at the end of initialization. Each entry is
77 * checked to make sure the information is minimally valid. If not, the entry is
80 * <emphasis role="bold">Implementation notes:</emphasis>
82 * The "cache" and "default registry" are different concepts and can represent
83 * different sets of plugins. For various reasons, at init time, the cache is
84 * stored in the default registry, and plugins not relevant to the current
85 * process are marked with the %GST_PLUGIN_FLAG_CACHED bit. These plugins are
86 * removed at the end of intitialization.
92 #include "gstconfig.h"
93 #include "gst_private.h"
95 #include <sys/types.h>
105 #include <glib/gstdio.h>
108 #include "gsterror.h"
109 #include "gstregistry.h"
110 #include "gstmarshal.h"
111 #include "gstfilter.h"
113 #include "gstpluginloader.h"
115 #include "gst-i18n-lib.h"
117 /* needed for fast retrieval of element and typefind factory lists */
118 extern GType gst_type_find_factory_get_type (void);
119 #define GST_TYPE_TYPE_FIND_FACTORY (gst_type_find_factory_get_type())
120 extern GType gst_element_factory_get_type (void);
121 #define GST_TYPE_ELEMENT_FACTORY (gst_element_factory_get_type())
125 extern HMODULE _priv_gst_dll_handle;
128 #define GST_CAT_DEFAULT GST_CAT_REGISTRY
130 struct _GstRegistryPrivate
132 /* updated whenever the feature list changes */
134 /* speedup for searching features */
135 GList *element_factory_list;
137 GList *typefind_factory_list;
141 /* the one instance of the default registry and the mutex protecting the
143 static GStaticMutex _gst_registry_mutex = G_STATIC_MUTEX_INIT;
144 static GstRegistry *_gst_registry_default = NULL;
147 #define DEFAULT_FORK TRUE
149 /* control the behaviour of registry rebuild */
150 static gboolean _gst_enable_registry_fork = DEFAULT_FORK;
151 /* List of plugins that need preloading/reloading after scanning registry */
152 extern GSList *_priv_gst_preload_plugins;
154 #ifndef GST_DISABLE_REGISTRY
155 /*set to TRUE when registry needn't to be updated */
156 gboolean _priv_gst_disable_registry_update = FALSE;
157 extern GList *_priv_gst_plugin_paths;
159 /* Set to TRUE when the registry cache should be disabled */
160 gboolean _gst_disable_registry_cache = FALSE;
163 /* Element signals and args */
171 static void gst_registry_finalize (GObject * object);
173 static guint gst_registry_signals[LAST_SIGNAL] = { 0 };
175 static GstPluginFeature *gst_registry_lookup_feature_locked (GstRegistry *
176 registry, const char *name);
177 static GstPlugin *gst_registry_lookup_bn_locked (GstRegistry * registry,
178 const char *basename);
180 G_DEFINE_TYPE (GstRegistry, gst_registry, GST_TYPE_OBJECT);
181 static GstObjectClass *parent_class = NULL;
184 gst_registry_class_init (GstRegistryClass * klass)
186 GObjectClass *gobject_class;
188 gobject_class = (GObjectClass *) klass;
190 parent_class = g_type_class_peek_parent (klass);
191 g_type_class_add_private (klass, sizeof (GstRegistryPrivate));
194 * GstRegistry::plugin-added:
195 * @registry: the registry that emitted the signal
196 * @plugin: the plugin that has been added
198 * Signals that a plugin has been added to the registry (possibly
199 * replacing a previously-added one by the same name)
201 gst_registry_signals[PLUGIN_ADDED] =
202 g_signal_new ("plugin-added", G_TYPE_FROM_CLASS (klass),
203 G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRegistryClass, plugin_added), NULL,
204 NULL, gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER);
207 * GstRegistry::feature-added:
208 * @registry: the registry that emitted the signal
209 * @feature: the feature that has been added
211 * Signals that a feature has been added to the registry (possibly
212 * replacing a previously-added one by the same name)
214 gst_registry_signals[FEATURE_ADDED] =
215 g_signal_new ("feature-added", G_TYPE_FROM_CLASS (klass),
216 G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRegistryClass, feature_added),
217 NULL, NULL, gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER);
219 gobject_class->finalize = gst_registry_finalize;
223 gst_registry_init (GstRegistry * registry)
225 registry->feature_hash = g_hash_table_new (g_str_hash, g_str_equal);
226 registry->basename_hash = g_hash_table_new (g_str_hash, g_str_equal);
228 G_TYPE_INSTANCE_GET_PRIVATE (registry, GST_TYPE_REGISTRY,
233 gst_registry_finalize (GObject * object)
235 GstRegistry *registry = GST_REGISTRY (object);
239 plugins = registry->plugins;
240 registry->plugins = NULL;
242 GST_DEBUG_OBJECT (registry, "registry finalize");
245 GstPlugin *plugin = p->data;
248 GST_LOG_OBJECT (registry, "removing plugin %s",
249 gst_plugin_get_name (plugin));
250 gst_object_unref (plugin);
254 g_list_free (plugins);
256 features = registry->features;
257 registry->features = NULL;
261 GstPluginFeature *feature = f->data;
264 GST_LOG_OBJECT (registry, "removing feature %p (%s)",
265 feature, gst_plugin_feature_get_name (feature));
266 gst_object_unref (feature);
270 g_list_free (features);
272 g_hash_table_destroy (registry->feature_hash);
273 registry->feature_hash = NULL;
274 g_hash_table_destroy (registry->basename_hash);
275 registry->basename_hash = NULL;
277 if (registry->priv->element_factory_list) {
278 GST_DEBUG_OBJECT (registry, "Cleaning up cached element factory list");
279 gst_plugin_feature_list_free (registry->priv->element_factory_list);
282 if (registry->priv->typefind_factory_list) {
283 GST_DEBUG_OBJECT (registry, "Cleaning up cached typefind factory list");
284 gst_plugin_feature_list_free (registry->priv->typefind_factory_list);
287 G_OBJECT_CLASS (parent_class)->finalize (object);
291 * gst_registry_get_default:
293 * Retrieves the default registry. The caller does not own a reference on the
294 * registry, as it is alive as long as GStreamer is initialized.
296 * Returns: The default #GstRegistry.
299 gst_registry_get_default (void)
301 GstRegistry *registry;
303 g_static_mutex_lock (&_gst_registry_mutex);
304 if (G_UNLIKELY (!_gst_registry_default)) {
305 _gst_registry_default = g_object_newv (GST_TYPE_REGISTRY, 0, NULL);
306 gst_object_ref_sink (GST_OBJECT_CAST (_gst_registry_default));
308 registry = _gst_registry_default;
309 g_static_mutex_unlock (&_gst_registry_mutex);
315 * gst_registry_add_path:
316 * @registry: the registry to add the path to
317 * @path: the path to add to the registry
319 * Add the given path to the registry. The syntax of the
320 * path is specific to the registry. If the path has already been
324 gst_registry_add_path (GstRegistry * registry, const gchar * path)
326 g_return_if_fail (GST_IS_REGISTRY (registry));
327 g_return_if_fail (path != NULL);
329 if (strlen (path) == 0)
332 GST_OBJECT_LOCK (registry);
333 if (g_list_find_custom (registry->paths, path, (GCompareFunc) strcmp))
336 GST_INFO ("Adding plugin path: \"%s\"", path);
337 registry->paths = g_list_append (registry->paths, g_strdup (path));
338 GST_OBJECT_UNLOCK (registry);
344 GST_INFO ("Ignoring empty plugin path");
349 g_warning ("path %s already added to registry", path);
350 GST_OBJECT_UNLOCK (registry);
356 * gst_registry_get_path_list:
357 * @registry: the registry to get the pathlist of
359 * Get the list of paths for the given registry.
361 * Returns: A Glist of paths as strings. g_list_free after use.
366 gst_registry_get_path_list (GstRegistry * registry)
370 g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
372 GST_OBJECT_LOCK (registry);
373 /* We don't need to copy the strings, because they won't be deleted
374 * as long as the GstRegistry is around */
375 list = g_list_copy (registry->paths);
376 GST_OBJECT_UNLOCK (registry);
383 * gst_registry_add_plugin:
384 * @registry: the registry to add the plugin to
385 * @plugin: the plugin to add
387 * Add the plugin to the registry. The plugin-added signal will be emitted.
388 * This function will sink @plugin.
390 * Returns: TRUE on success.
395 gst_registry_add_plugin (GstRegistry * registry, GstPlugin * plugin)
397 GstPlugin *existing_plugin;
399 g_return_val_if_fail (GST_IS_REGISTRY (registry), FALSE);
400 g_return_val_if_fail (GST_IS_PLUGIN (plugin), FALSE);
402 GST_OBJECT_LOCK (registry);
403 if (G_LIKELY (plugin->basename)) {
404 /* we have a basename, see if we find the plugin */
406 gst_registry_lookup_bn_locked (registry, plugin->basename);
407 if (existing_plugin) {
408 GST_DEBUG_OBJECT (registry,
409 "Replacing existing plugin %p with new plugin %p for filename \"%s\"",
410 existing_plugin, plugin, GST_STR_NULL (plugin->filename));
411 registry->plugins = g_list_remove (registry->plugins, existing_plugin);
412 if (G_LIKELY (existing_plugin->basename))
413 g_hash_table_remove (registry->basename_hash,
414 existing_plugin->basename);
415 gst_object_unref (existing_plugin);
419 GST_DEBUG_OBJECT (registry, "adding plugin %p for filename \"%s\"",
420 plugin, GST_STR_NULL (plugin->filename));
422 registry->plugins = g_list_prepend (registry->plugins, plugin);
423 if (G_LIKELY (plugin->basename))
424 g_hash_table_replace (registry->basename_hash, plugin->basename, plugin);
426 gst_object_ref_sink (plugin);
427 GST_OBJECT_UNLOCK (registry);
429 GST_LOG_OBJECT (registry, "emitting plugin-added for filename \"%s\"",
430 GST_STR_NULL (plugin->filename));
431 g_signal_emit (registry, gst_registry_signals[PLUGIN_ADDED], 0, plugin);
437 gst_registry_remove_features_for_plugin_unlocked (GstRegistry * registry,
443 g_return_if_fail (GST_IS_REGISTRY (registry));
444 g_return_if_fail (GST_IS_PLUGIN (plugin));
446 name = gst_plugin_get_name (plugin);
448 /* Remove all features for this plugin */
449 f = registry->features;
451 GList *next = g_list_next (f);
452 GstPluginFeature *feature = f->data;
454 if (G_UNLIKELY (feature && !strcmp (feature->plugin_name, name))) {
455 GST_DEBUG_OBJECT (registry, "removing feature %p (%s) for plugin %s",
456 feature, gst_plugin_feature_get_name (feature), name);
458 registry->features = g_list_delete_link (registry->features, f);
459 g_hash_table_remove (registry->feature_hash, feature->name);
460 gst_object_unref (feature);
464 registry->priv->cookie++;
468 * gst_registry_remove_plugin:
469 * @registry: the registry to remove the plugin from
470 * @plugin: the plugin to remove
472 * Remove the plugin from the registry.
477 gst_registry_remove_plugin (GstRegistry * registry, GstPlugin * plugin)
479 g_return_if_fail (GST_IS_REGISTRY (registry));
480 g_return_if_fail (GST_IS_PLUGIN (plugin));
482 GST_DEBUG_OBJECT (registry, "removing plugin %p (%s)",
483 plugin, gst_plugin_get_name (plugin));
485 GST_OBJECT_LOCK (registry);
486 registry->plugins = g_list_remove (registry->plugins, plugin);
487 if (G_LIKELY (plugin->basename))
488 g_hash_table_remove (registry->basename_hash, plugin->basename);
489 gst_registry_remove_features_for_plugin_unlocked (registry, plugin);
490 GST_OBJECT_UNLOCK (registry);
491 gst_object_unref (plugin);
495 * gst_registry_add_feature:
496 * @registry: the registry to add the plugin to
497 * @feature: the feature to add
499 * Add the feature to the registry. The feature-added signal will be emitted.
500 * This function sinks @feature.
502 * Returns: TRUE on success.
507 gst_registry_add_feature (GstRegistry * registry, GstPluginFeature * feature)
509 GstPluginFeature *existing_feature;
511 g_return_val_if_fail (GST_IS_REGISTRY (registry), FALSE);
512 g_return_val_if_fail (GST_IS_PLUGIN_FEATURE (feature), FALSE);
513 g_return_val_if_fail (feature->name != NULL, FALSE);
514 g_return_val_if_fail (feature->plugin_name != NULL, FALSE);
516 GST_OBJECT_LOCK (registry);
517 existing_feature = gst_registry_lookup_feature_locked (registry,
519 if (G_UNLIKELY (existing_feature)) {
520 GST_DEBUG_OBJECT (registry, "replacing existing feature %p (%s)",
521 existing_feature, feature->name);
522 /* Remove the existing feature from the list now, before we insert the new
523 * one, but don't unref yet because the hash is still storing a reference to
525 registry->features = g_list_remove (registry->features, existing_feature);
528 GST_DEBUG_OBJECT (registry, "adding feature %p (%s)", feature, feature->name);
530 registry->features = g_list_prepend (registry->features, feature);
531 g_hash_table_replace (registry->feature_hash, feature->name, feature);
533 if (G_UNLIKELY (existing_feature)) {
534 /* We unref now. No need to remove the feature name from the hash table, it
535 * got replaced by the new feature */
536 gst_object_unref (existing_feature);
539 gst_object_ref_sink (feature);
541 registry->priv->cookie++;
542 GST_OBJECT_UNLOCK (registry);
544 GST_LOG_OBJECT (registry, "emitting feature-added for %s", feature->name);
545 g_signal_emit (registry, gst_registry_signals[FEATURE_ADDED], 0, feature);
551 * gst_registry_remove_feature:
552 * @registry: the registry to remove the feature from
553 * @feature: the feature to remove
555 * Remove the feature from the registry.
560 gst_registry_remove_feature (GstRegistry * registry, GstPluginFeature * feature)
562 g_return_if_fail (GST_IS_REGISTRY (registry));
563 g_return_if_fail (GST_IS_PLUGIN_FEATURE (feature));
565 GST_DEBUG_OBJECT (registry, "removing feature %p (%s)",
566 feature, gst_plugin_feature_get_name (feature));
568 GST_OBJECT_LOCK (registry);
569 registry->features = g_list_remove (registry->features, feature);
570 g_hash_table_remove (registry->feature_hash, feature->name);
571 registry->priv->cookie++;
572 GST_OBJECT_UNLOCK (registry);
573 gst_object_unref (feature);
577 * gst_registry_plugin_filter:
578 * @registry: registry to query
579 * @filter: the filter to use
580 * @first: only return first match
581 * @user_data: user data passed to the filter function
583 * Runs a filter against all plugins in the registry and returns a #GList with
584 * the results. If the first flag is set, only the first match is
585 * returned (as a list with a single object).
586 * Every plugin is reffed; use gst_plugin_list_free() after use, which
589 * Returns: a #GList of #GstPlugin. Use gst_plugin_list_free() after usage.
594 gst_registry_plugin_filter (GstRegistry * registry,
595 GstPluginFilter filter, gboolean first, gpointer user_data)
600 g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
602 GST_OBJECT_LOCK (registry);
603 list = gst_filter_run (registry->plugins, (GstFilterFunc) filter, first,
605 for (g = list; g; g = g->next) {
606 gst_object_ref (GST_PLUGIN_CAST (g->data));
608 GST_OBJECT_UNLOCK (registry);
613 /* returns TRUE if the list was changed
615 * Must be called with the object lock taken */
617 gst_registry_get_feature_list_or_create (GstRegistry * registry,
618 GList ** previous, guint32 * cookie, GType type)
620 gboolean res = FALSE;
621 GstRegistryPrivate *priv = registry->priv;
623 if (G_UNLIKELY (!*previous || priv->cookie != *cookie)) {
624 GstTypeNameData data;
627 gst_plugin_feature_list_free (*previous);
632 gst_filter_run (registry->features,
633 (GstFilterFunc) gst_plugin_feature_type_name_filter, FALSE, &data);
634 g_list_foreach (*previous, (GFunc) gst_object_ref, NULL);
635 *cookie = priv->cookie;
643 type_find_factory_rank_cmp (const GstPluginFeature * fac1,
644 const GstPluginFeature * fac2)
646 if (G_LIKELY (fac1->rank != fac2->rank))
647 return fac2->rank - fac1->rank;
649 /* to make the order in which things happen more deterministic,
650 * sort by name when the ranks are the same. */
651 return strcmp (fac1->name, fac2->name);
655 gst_registry_get_element_factory_list (GstRegistry * registry)
659 GST_OBJECT_LOCK (registry);
661 gst_registry_get_feature_list_or_create (registry,
662 ®istry->priv->element_factory_list, ®istry->priv->efl_cookie,
663 GST_TYPE_ELEMENT_FACTORY);
665 /* Return reffed copy */
666 list = gst_plugin_feature_list_copy (registry->priv->element_factory_list);
668 GST_OBJECT_UNLOCK (registry);
674 gst_registry_get_typefind_factory_list (GstRegistry * registry)
678 GST_OBJECT_LOCK (registry);
680 if (G_UNLIKELY (gst_registry_get_feature_list_or_create (registry,
681 ®istry->priv->typefind_factory_list,
682 ®istry->priv->tfl_cookie, GST_TYPE_TYPE_FIND_FACTORY)))
683 registry->priv->typefind_factory_list =
684 g_list_sort (registry->priv->typefind_factory_list,
685 (GCompareFunc) type_find_factory_rank_cmp);
687 /* Return reffed copy */
688 list = gst_plugin_feature_list_copy (registry->priv->typefind_factory_list);
690 GST_OBJECT_UNLOCK (registry);
696 * gst_registry_feature_filter:
697 * @registry: registry to query
698 * @filter: the filter to use
699 * @first: only return first match
700 * @user_data: user data passed to the filter function
702 * Runs a filter against all features of the plugins in the registry
703 * and returns a GList with the results.
704 * If the first flag is set, only the first match is
705 * returned (as a list with a single object).
707 * Returns: a #GList of #GstPluginFeature. Use gst_plugin_feature_list_free()
713 gst_registry_feature_filter (GstRegistry * registry,
714 GstPluginFeatureFilter filter, gboolean first, gpointer user_data)
719 g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
721 GST_OBJECT_LOCK (registry);
722 list = gst_filter_run (registry->features, (GstFilterFunc) filter, first,
724 for (g = list; g; g = g->next) {
725 gst_object_ref (GST_PLUGIN_FEATURE_CAST (g->data));
727 GST_OBJECT_UNLOCK (registry);
733 * gst_registry_find_plugin:
734 * @registry: the registry to search
735 * @name: the plugin name to find
737 * Find the plugin with the given name in the registry.
738 * The plugin will be reffed; caller is responsible for unreffing.
740 * Returns: The plugin with the given name or NULL if the plugin was not found.
741 * gst_object_unref() after usage.
746 gst_registry_find_plugin (GstRegistry * registry, const gchar * name)
749 GstPlugin *result = NULL;
751 g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
752 g_return_val_if_fail (name != NULL, NULL);
754 walk = gst_registry_plugin_filter (registry,
755 (GstPluginFilter) gst_plugin_name_filter, TRUE, (gpointer) name);
757 result = GST_PLUGIN_CAST (walk->data);
759 gst_object_ref (result);
760 gst_plugin_list_free (walk);
767 * gst_registry_find_feature:
768 * @registry: the registry to search
769 * @name: the pluginfeature name to find
770 * @type: the pluginfeature type to find
772 * Find the pluginfeature with the given name and type in the registry.
774 * Returns: The pluginfeature with the given name and type or NULL
775 * if the plugin was not found. gst_object_unref() after usage.
780 gst_registry_find_feature (GstRegistry * registry, const gchar * name,
783 GstPluginFeature *feature = NULL;
785 g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
786 g_return_val_if_fail (name != NULL, NULL);
787 g_return_val_if_fail (g_type_is_a (type, GST_TYPE_PLUGIN_FEATURE), NULL);
789 feature = gst_registry_lookup_feature (registry, name);
790 if (feature && !g_type_is_a (G_TYPE_FROM_INSTANCE (feature), type)) {
791 gst_object_unref (feature);
799 * gst_registry_get_feature_list:
800 * @registry: a #GstRegistry
803 * Retrieves a #GList of #GstPluginFeature of @type.
805 * Returns: a #GList of #GstPluginFeature of @type. Use
806 * gst_plugin_feature_list_free() after usage.
811 gst_registry_get_feature_list (GstRegistry * registry, GType type)
813 GstTypeNameData data;
815 g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
816 g_return_val_if_fail (g_type_is_a (type, GST_TYPE_PLUGIN_FEATURE), NULL);
819 if (type == GST_TYPE_ELEMENT_FACTORY)
820 return gst_registry_get_element_factory_list (registry);
821 else if (type == GST_TYPE_TYPE_FIND_FACTORY)
822 return gst_registry_get_typefind_factory_list (registry);
827 return gst_registry_feature_filter (registry,
828 (GstPluginFeatureFilter) gst_plugin_feature_type_name_filter,
833 * gst_registry_get_plugin_list:
834 * @registry: the registry to search
836 * Get a copy of all plugins registered in the given registry. The refcount
837 * of each element in the list in incremented.
839 * Returns: a #GList of #GstPlugin. Use gst_plugin_list_free() after usage.
844 gst_registry_get_plugin_list (GstRegistry * registry)
849 g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
851 GST_OBJECT_LOCK (registry);
852 list = g_list_copy (registry->plugins);
853 for (g = list; g; g = g->next) {
854 gst_object_ref (GST_PLUGIN_CAST (g->data));
856 GST_OBJECT_UNLOCK (registry);
861 static GstPluginFeature *
862 gst_registry_lookup_feature_locked (GstRegistry * registry, const char *name)
864 return g_hash_table_lookup (registry->feature_hash, name);
868 * gst_registry_lookup_feature:
869 * @registry: a #GstRegistry
870 * @name: a #GstPluginFeature name
872 * Find a #GstPluginFeature with @name in @registry.
874 * Returns: a #GstPluginFeature with its refcount incremented, use
875 * gst_object_unref() after usage.
880 gst_registry_lookup_feature (GstRegistry * registry, const char *name)
882 GstPluginFeature *feature;
884 g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
885 g_return_val_if_fail (name != NULL, NULL);
887 GST_OBJECT_LOCK (registry);
888 feature = gst_registry_lookup_feature_locked (registry, name);
890 gst_object_ref (feature);
891 GST_OBJECT_UNLOCK (registry);
897 gst_registry_lookup_bn_locked (GstRegistry * registry, const char *basename)
899 return g_hash_table_lookup (registry->basename_hash, basename);
903 gst_registry_lookup_bn (GstRegistry * registry, const char *basename)
907 GST_OBJECT_LOCK (registry);
908 plugin = gst_registry_lookup_bn_locked (registry, basename);
910 gst_object_ref (plugin);
911 GST_OBJECT_UNLOCK (registry);
917 * gst_registry_lookup:
918 * @registry: the registry to look up in
919 * @filename: the name of the file to look up
921 * Look up a plugin in the given registry with the given filename.
922 * If found, plugin is reffed.
924 * Returns: the #GstPlugin if found, or NULL if not. gst_object_unref()
928 gst_registry_lookup (GstRegistry * registry, const char *filename)
933 g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
934 g_return_val_if_fail (filename != NULL, NULL);
936 basename = g_path_get_basename (filename);
937 if (G_UNLIKELY (basename == NULL))
940 plugin = gst_registry_lookup_bn (registry, basename);
949 REGISTRY_SCAN_HELPER_NOT_STARTED = 0,
950 REGISTRY_SCAN_HELPER_DISABLED,
951 REGISTRY_SCAN_HELPER_RUNNING
952 } GstRegistryScanHelperState;
956 GstRegistry *registry;
957 GstRegistryScanHelperState helper_state;
958 GstPluginLoader *helper;
960 } GstRegistryScanContext;
963 init_scan_context (GstRegistryScanContext * context, GstRegistry * registry)
967 context->registry = registry;
969 /* see if forking is enabled and set up the scan helper state accordingly */
970 do_fork = _gst_enable_registry_fork;
972 const gchar *fork_env;
974 /* forking enabled, see if it is disabled with an env var */
975 if ((fork_env = g_getenv ("GST_REGISTRY_FORK"))) {
976 /* fork enabled for any value different from "no" */
977 do_fork = strcmp (fork_env, "no") != 0;
982 context->helper_state = REGISTRY_SCAN_HELPER_NOT_STARTED;
984 context->helper_state = REGISTRY_SCAN_HELPER_DISABLED;
986 context->helper = NULL;
987 context->changed = FALSE;
991 clear_scan_context (GstRegistryScanContext * context)
993 if (context->helper) {
994 context->changed |= _priv_gst_plugin_loader_funcs.destroy (context->helper);
995 context->helper = NULL;
1000 gst_registry_scan_plugin_file (GstRegistryScanContext * context,
1001 const gchar * filename, off_t file_size, time_t file_mtime)
1003 gboolean changed = FALSE;
1004 GstPlugin *newplugin = NULL;
1007 /* Disable external plugin loader on Windows until it is ported properly. */
1008 context->helper_state = REGISTRY_SCAN_HELPER_DISABLED;
1012 /* Have a plugin to load - see if the scan-helper needs starting */
1013 if (context->helper_state == REGISTRY_SCAN_HELPER_NOT_STARTED) {
1014 GST_DEBUG ("Starting plugin scanner for file %s", filename);
1015 context->helper = _priv_gst_plugin_loader_funcs.create (context->registry);
1016 if (context->helper != NULL)
1017 context->helper_state = REGISTRY_SCAN_HELPER_RUNNING;
1019 GST_WARNING ("Failed starting plugin scanner. Scanning in-process");
1020 context->helper_state = REGISTRY_SCAN_HELPER_DISABLED;
1024 if (context->helper_state == REGISTRY_SCAN_HELPER_RUNNING) {
1025 GST_DEBUG ("Using scan-helper to load plugin %s", filename);
1026 if (!_priv_gst_plugin_loader_funcs.load (context->helper,
1027 filename, file_size, file_mtime)) {
1028 g_warning ("External plugin loader failed. This most likely means that "
1029 "the plugin loader helper binary was not found or could not be run. "
1030 "%s", (g_getenv ("GST_PLUGIN_PATH") != NULL) ?
1031 "If you are running an uninstalled GStreamer setup, you might need "
1032 "to update your gst-uninstalled script so that the "
1033 "GST_PLUGIN_SCANNER environment variable gets set." : "");
1034 context->helper_state = REGISTRY_SCAN_HELPER_DISABLED;
1038 /* Check if the helper is disabled (or just got disabled above) */
1039 if (context->helper_state == REGISTRY_SCAN_HELPER_DISABLED) {
1040 /* Load plugin the old fashioned way... */
1042 /* We don't use a GError here because a failure to load some shared
1043 * objects as plugins is normal (particularly in the uninstalled case)
1045 newplugin = gst_plugin_load_file (filename, NULL);
1049 GST_DEBUG_OBJECT (context->registry, "marking new plugin %p as registered",
1051 newplugin->registered = TRUE;
1052 gst_object_unref (newplugin);
1060 gst_registry_scan_path_level (GstRegistryScanContext * context,
1061 const gchar * path, int level)
1064 const gchar *dirent;
1067 gboolean changed = FALSE;
1069 dir = g_dir_open (path, 0, NULL);
1073 while ((dirent = g_dir_read_name (dir))) {
1074 struct stat file_status;
1076 filename = g_build_filename (path, dirent, NULL);
1077 if (g_stat (filename, &file_status) < 0) {
1078 /* Plugin will be removed from cache after the scan completes if it
1079 * is still marked 'cached' */
1084 if (file_status.st_mode & S_IFDIR) {
1085 /* skip the .debug directory, these contain elf files that are not
1086 * useful or worse, can crash dlopen (). do a quick check for the . first
1087 * and then call the compare functions. */
1088 if (G_UNLIKELY (dirent[0] == '.' && (g_str_equal (dirent, ".debug")
1089 || g_str_equal (dirent, ".git")))) {
1090 GST_LOG_OBJECT (context->registry, "ignoring .debug or .git directory");
1094 /* FIXME 0.11: Don't recurse into directories, this behaviour
1095 * is inconsistent with other PATH environment variables
1098 GST_LOG_OBJECT (context->registry, "recursing into directory %s",
1100 changed |= gst_registry_scan_path_level (context, filename, level - 1);
1102 GST_LOG_OBJECT (context->registry, "not recursing into directory %s, "
1103 "recursion level too deep", filename);
1108 if (!(file_status.st_mode & S_IFREG)) {
1109 GST_LOG_OBJECT (context->registry, "%s is not a regular file, ignoring",
1114 if (!g_str_has_suffix (dirent, G_MODULE_SUFFIX)
1115 #ifdef GST_EXTRA_MODULE_SUFFIX
1116 && !g_str_has_suffix (dirent, GST_EXTRA_MODULE_SUFFIX)
1119 GST_LOG_OBJECT (context->registry,
1120 "extension is not recognized as module file, ignoring file %s",
1126 GST_LOG_OBJECT (context->registry, "file %s looks like a possible module",
1129 /* plug-ins are considered unique by basename; if the given name
1130 * was already seen by the registry, we ignore it */
1131 plugin = gst_registry_lookup_bn (context->registry, dirent);
1133 gboolean env_vars_changed, deps_changed = FALSE;
1135 if (plugin->registered) {
1136 GST_DEBUG_OBJECT (context->registry,
1137 "plugin already registered from path \"%s\"",
1138 GST_STR_NULL (plugin->filename));
1140 gst_object_unref (plugin);
1144 env_vars_changed = _priv_plugin_deps_env_vars_changed (plugin);
1146 /* If a file with a certain basename is seen on a different path,
1147 * update the plugin to ensure the registry cache will reflect up
1148 * to date information */
1150 if (plugin->file_mtime == file_status.st_mtime &&
1151 plugin->file_size == file_status.st_size && !env_vars_changed &&
1152 !(deps_changed = _priv_plugin_deps_files_changed (plugin)) &&
1153 !strcmp (plugin->filename, filename)) {
1154 GST_LOG_OBJECT (context->registry, "file %s cached", filename);
1155 plugin->flags &= ~GST_PLUGIN_FLAG_CACHED;
1156 GST_LOG_OBJECT (context->registry,
1157 "marking plugin %p as registered as %s", plugin, filename);
1158 plugin->registered = TRUE;
1160 GST_INFO_OBJECT (context->registry, "cached info for %s is stale",
1162 GST_DEBUG_OBJECT (context->registry, "mtime %ld != %ld or size %"
1163 G_GINT64_FORMAT " != %" G_GINT64_FORMAT " or external dependency "
1164 "env_vars changed: %d or external dependencies changed: %d"
1165 " or old path %s != new path %s",
1166 plugin->file_mtime, file_status.st_mtime,
1167 (gint64) plugin->file_size, (gint64) file_status.st_size,
1168 env_vars_changed, deps_changed, plugin->filename, filename);
1169 gst_registry_remove_plugin (context->registry, plugin);
1170 changed |= gst_registry_scan_plugin_file (context, filename,
1171 file_status.st_size, file_status.st_mtime);
1173 gst_object_unref (plugin);
1176 GST_DEBUG_OBJECT (context->registry, "file %s not yet in registry",
1178 changed |= gst_registry_scan_plugin_file (context, filename,
1179 file_status.st_size, file_status.st_mtime);
1191 gst_registry_scan_path_internal (GstRegistryScanContext * context,
1196 GST_DEBUG_OBJECT (context->registry, "scanning path %s", path);
1197 changed = gst_registry_scan_path_level (context, path, 10);
1199 GST_DEBUG_OBJECT (context->registry, "registry changed in path %s: %d", path,
1205 * gst_registry_scan_path:
1206 * @registry: the registry to add found plugins to
1207 * @path: the path to scan
1209 * Scan the given path for plugins to add to the registry. The syntax of the
1210 * path is specific to the registry.
1212 * Returns: %TRUE if registry changed
1215 gst_registry_scan_path (GstRegistry * registry, const gchar * path)
1217 GstRegistryScanContext context;
1220 g_return_val_if_fail (GST_IS_REGISTRY (registry), FALSE);
1221 g_return_val_if_fail (path != NULL, FALSE);
1223 init_scan_context (&context, registry);
1225 result = gst_registry_scan_path_internal (&context, path);
1227 clear_scan_context (&context);
1228 result |= context.changed;
1234 _gst_plugin_feature_filter_plugin_name (GstPluginFeature * feature,
1237 return (strcmp (feature->plugin_name, (gchar *) user_data) == 0);
1241 * gst_registry_get_feature_list_by_plugin:
1242 * @registry: a #GstRegistry.
1243 * @name: a plugin name.
1245 * Retrieves a #GList of features of the plugin with name @name.
1247 * Returns: a #GList of #GstPluginFeature. Use gst_plugin_feature_list_free()
1251 gst_registry_get_feature_list_by_plugin (GstRegistry * registry,
1254 g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
1255 g_return_val_if_fail (name != NULL, NULL);
1257 return gst_registry_feature_filter (registry,
1258 _gst_plugin_feature_filter_plugin_name, FALSE, (gpointer) name);
1261 /* Unref and delete the default registry */
1263 _priv_gst_registry_cleanup ()
1265 GstRegistry *registry;
1267 g_static_mutex_lock (&_gst_registry_mutex);
1268 if ((registry = _gst_registry_default) != NULL) {
1269 _gst_registry_default = NULL;
1271 g_static_mutex_unlock (&_gst_registry_mutex);
1273 /* unref outside of the lock because we can. */
1275 gst_object_unref (registry);
1279 * gst_default_registry_check_feature_version:
1280 * @feature_name: the name of the feature (e.g. "oggdemux")
1281 * @min_major: the minimum major version number
1282 * @min_minor: the minimum minor version number
1283 * @min_micro: the minimum micro version number
1285 * Checks whether a plugin feature by the given name exists in the
1286 * default registry and whether its version is at least the
1289 * Returns: #TRUE if the feature could be found and the version is
1290 * the same as the required version or newer, and #FALSE otherwise.
1293 gst_default_registry_check_feature_version (const gchar * feature_name,
1294 guint min_major, guint min_minor, guint min_micro)
1296 GstPluginFeature *feature;
1297 GstRegistry *registry;
1298 gboolean ret = FALSE;
1300 g_return_val_if_fail (feature_name != NULL, FALSE);
1302 GST_DEBUG ("Looking up plugin feature '%s'", feature_name);
1304 registry = gst_registry_get_default ();
1305 feature = gst_registry_lookup_feature (registry, feature_name);
1307 ret = gst_plugin_feature_check_version (feature, min_major, min_minor,
1309 gst_object_unref (feature);
1311 GST_DEBUG ("Could not find plugin feature '%s'", feature_name);
1318 load_plugin_func (gpointer data, gpointer user_data)
1321 const gchar *filename;
1324 filename = (const gchar *) data;
1325 GST_DEBUG ("Pre-loading plugin %s", filename);
1327 plugin = gst_plugin_load_file (filename, &err);
1330 GST_INFO ("Loaded plugin: \"%s\"", filename);
1332 gst_default_registry_add_plugin (plugin);
1335 /* Report error to user, and free error */
1336 GST_ERROR ("Failed to load plugin: %s", err->message);
1339 GST_WARNING ("Failed to load plugin: \"%s\"", filename);
1344 #ifndef GST_DISABLE_REGISTRY
1345 /* Unref all plugins marked 'cached', to clear old plugins that no
1346 * longer exist. Returns TRUE if any plugins were removed */
1348 gst_registry_remove_cache_plugins (GstRegistry * registry)
1353 gboolean changed = FALSE;
1355 g_return_val_if_fail (GST_IS_REGISTRY (registry), FALSE);
1357 GST_OBJECT_LOCK (registry);
1359 GST_DEBUG_OBJECT (registry, "removing cached plugins");
1360 g = registry->plugins;
1364 if (plugin->flags & GST_PLUGIN_FLAG_CACHED) {
1365 GST_DEBUG_OBJECT (registry, "removing cached plugin \"%s\"",
1366 GST_STR_NULL (plugin->filename));
1367 registry->plugins = g_list_delete_link (registry->plugins, g);
1368 if (G_LIKELY (plugin->basename))
1369 g_hash_table_remove (registry->basename_hash, plugin->basename);
1370 gst_registry_remove_features_for_plugin_unlocked (registry, plugin);
1371 gst_object_unref (plugin);
1377 GST_OBJECT_UNLOCK (registry);
1384 REGISTRY_SCAN_AND_UPDATE_FAILURE = 0,
1385 REGISTRY_SCAN_AND_UPDATE_SUCCESS_NOT_CHANGED,
1386 REGISTRY_SCAN_AND_UPDATE_SUCCESS_UPDATED
1387 } GstRegistryScanAndUpdateResult;
1390 * scan_and_update_registry:
1391 * @default_registry: the #GstRegistry
1392 * @registry_file: registry filename
1393 * @write_changes: write registry if it has changed?
1395 * Scans for registry changes and eventually updates the registry cache.
1397 * Return: %REGISTRY_SCAN_AND_UPDATE_FAILURE if the registry could not scanned
1398 * or updated, %REGISTRY_SCAN_AND_UPDATE_SUCCESS_NOT_CHANGED if the
1399 * registry is clean and %REGISTRY_SCAN_AND_UPDATE_SUCCESS_UPDATED if
1400 * it has been updated and the cache needs to be re-read.
1402 static GstRegistryScanAndUpdateResult
1403 scan_and_update_registry (GstRegistry * default_registry,
1404 const gchar * registry_file, gboolean write_changes, GError ** error)
1406 const gchar *plugin_path;
1407 gboolean changed = FALSE;
1409 GstRegistryScanContext context;
1411 GST_INFO ("Validating plugins from registry cache: %s", registry_file);
1413 init_scan_context (&context, default_registry);
1415 /* It sounds tempting to just compare the mtime of directories with the mtime
1416 * of the registry cache, but it does not work. It would not catch updated
1417 * plugins, which might bring more or less features.
1420 /* scan paths specified via --gst-plugin-path */
1421 GST_DEBUG ("scanning paths added via --gst-plugin-path");
1422 for (l = _priv_gst_plugin_paths; l != NULL; l = l->next) {
1423 GST_INFO ("Scanning plugin path: \"%s\"", (gchar *) l->data);
1424 changed |= gst_registry_scan_path_internal (&context, (gchar *) l->data);
1426 /* keep plugin_paths around in case a re-scan is forced later on */
1428 /* GST_PLUGIN_PATH specifies a list of directories to scan for
1429 * additional plugins. These take precedence over the system plugins */
1430 plugin_path = g_getenv ("GST_PLUGIN_PATH");
1435 GST_DEBUG ("GST_PLUGIN_PATH set to %s", plugin_path);
1436 list = g_strsplit (plugin_path, G_SEARCHPATH_SEPARATOR_S, 0);
1437 for (i = 0; list[i]; i++) {
1438 changed |= gst_registry_scan_path_internal (&context, list[i]);
1442 GST_DEBUG ("GST_PLUGIN_PATH not set");
1445 /* GST_PLUGIN_SYSTEM_PATH specifies a list of plugins that are always
1446 * loaded by default. If not set, this defaults to the system-installed
1447 * path, and the plugins installed in the user's home directory */
1448 plugin_path = g_getenv ("GST_PLUGIN_SYSTEM_PATH");
1449 if (plugin_path == NULL) {
1452 GST_DEBUG ("GST_PLUGIN_SYSTEM_PATH not set");
1454 /* plugins in the user's home directory take precedence over
1455 * system-installed ones */
1456 home_plugins = g_build_filename (g_get_home_dir (),
1457 ".gstreamer-" GST_MAJORMINOR, "plugins", NULL);
1458 GST_DEBUG ("scanning home plugins %s", home_plugins);
1459 changed |= gst_registry_scan_path_internal (&context, home_plugins);
1460 g_free (home_plugins);
1462 /* add the main (installed) library path */
1463 GST_DEBUG ("scanning main plugins %s", PLUGINDIR);
1464 changed |= gst_registry_scan_path_internal (&context, PLUGINDIR);
1472 g_win32_get_package_installation_directory_of_module
1473 (_priv_gst_dll_handle);
1475 dir = g_build_filename (base_dir, "lib", "gstreamer-0.10", NULL);
1476 GST_DEBUG ("scanning DLL dir %s", dir);
1478 changed |= gst_registry_scan_path_internal (&context, dir);
1488 GST_DEBUG ("GST_PLUGIN_SYSTEM_PATH set to %s", plugin_path);
1489 list = g_strsplit (plugin_path, G_SEARCHPATH_SEPARATOR_S, 0);
1490 for (i = 0; list[i]; i++) {
1491 changed |= gst_registry_scan_path_internal (&context, list[i]);
1496 clear_scan_context (&context);
1497 changed |= context.changed;
1499 /* Remove cached plugins so stale info is cleared. */
1500 changed |= gst_registry_remove_cache_plugins (default_registry);
1503 GST_INFO ("Registry cache has not changed");
1504 return REGISTRY_SCAN_AND_UPDATE_SUCCESS_NOT_CHANGED;
1507 if (!write_changes) {
1508 GST_INFO ("Registry cache changed, but writing is disabled. Not writing.");
1509 return REGISTRY_SCAN_AND_UPDATE_FAILURE;
1512 GST_INFO ("Registry cache changed. Writing new registry cache");
1513 if (!gst_registry_binary_write_cache (default_registry, registry_file)) {
1514 g_set_error (error, GST_CORE_ERROR, GST_CORE_ERROR_FAILED,
1515 _("Error writing registry cache to %s: %s"),
1516 registry_file, g_strerror (errno));
1517 return REGISTRY_SCAN_AND_UPDATE_FAILURE;
1520 GST_INFO ("Registry cache written successfully");
1521 return REGISTRY_SCAN_AND_UPDATE_SUCCESS_UPDATED;
1525 ensure_current_registry (GError ** error)
1527 gchar *registry_file;
1528 GstRegistry *default_registry;
1529 gboolean ret = TRUE;
1530 gboolean do_update = TRUE;
1531 gboolean have_cache = TRUE;
1533 default_registry = gst_registry_get_default ();
1534 registry_file = g_strdup (g_getenv ("GST_REGISTRY"));
1535 if (registry_file == NULL) {
1536 registry_file = g_build_filename (g_get_home_dir (),
1537 ".gstreamer-" GST_MAJORMINOR, "registry." HOST_CPU ".bin", NULL);
1540 if (!_gst_disable_registry_cache) {
1541 GST_INFO ("reading registry cache: %s", registry_file);
1542 have_cache = gst_registry_binary_read_cache (default_registry,
1544 /* Only ever read the registry cache once, then disable it for
1545 * subsequent updates during the program lifetime */
1546 _gst_disable_registry_cache = TRUE;
1550 do_update = !_priv_gst_disable_registry_update;
1552 const gchar *update_env;
1554 if ((update_env = g_getenv ("GST_REGISTRY_UPDATE"))) {
1555 /* do update for any value different from "no" */
1556 do_update = (strcmp (update_env, "no") != 0);
1562 /* now check registry */
1563 GST_DEBUG ("Updating registry cache");
1564 scan_and_update_registry (default_registry, registry_file, TRUE, error);
1566 GST_DEBUG ("Not updating registry cache (disabled)");
1569 g_free (registry_file);
1570 GST_INFO ("registry reading and updating done, result = %d", ret);
1574 #endif /* GST_DISABLE_REGISTRY */
1577 * gst_registry_fork_is_enabled:
1579 * By default GStreamer will perform scanning and rebuilding of the
1580 * registry file using a helper child process.
1582 * Applications might want to disable this behaviour with the
1583 * gst_registry_fork_set_enabled() function, in which case new plugins
1584 * are scanned (and loaded) into the application process.
1586 * Returns: %TRUE if GStreamer will use the child helper process when
1587 * rebuilding the registry.
1592 gst_registry_fork_is_enabled (void)
1594 return _gst_enable_registry_fork;
1598 * gst_registry_fork_set_enabled:
1599 * @enabled: whether rebuilding the registry can use a temporary child helper process.
1601 * Applications might want to disable/enable spawning of a child helper process
1602 * when rebuilding the registry. See gst_registry_fork_is_enabled() for more
1608 gst_registry_fork_set_enabled (gboolean enabled)
1610 _gst_enable_registry_fork = enabled;
1614 * gst_update_registry:
1616 * Forces GStreamer to re-scan its plugin paths and update the default
1619 * Applications will almost never need to call this function, it is only
1620 * useful if the application knows new plugins have been installed (or old
1621 * ones removed) since the start of the application (or, to be precise, the
1622 * first call to gst_init()) and the application wants to make use of any
1623 * newly-installed plugins without restarting the application.
1625 * Applications should assume that the registry update is neither atomic nor
1626 * thread-safe and should therefore not have any dynamic pipelines running
1627 * (including the playbin and decodebin elements) and should also not create
1628 * any elements or access the GStreamer registry while the update is in
1631 * Note that this function may block for a significant amount of time.
1633 * Returns: %TRUE if the registry has been updated successfully (does not
1634 * imply that there were changes), otherwise %FALSE.
1639 gst_update_registry (void)
1643 #ifndef GST_DISABLE_REGISTRY
1646 res = ensure_current_registry (&err);
1648 GST_WARNING ("registry update failed: %s", err->message);
1651 GST_LOG ("registry update succeeded");
1655 GST_WARNING ("registry update failed: %s", "registry disabled");
1657 #endif /* GST_DISABLE_REGISTRY */
1659 if (_priv_gst_preload_plugins) {
1660 GST_DEBUG ("Preloading indicated plugins...");
1661 g_slist_foreach (_priv_gst_preload_plugins, load_plugin_func, NULL);
1668 * gst_registry_get_feature_list_cookie:
1669 * @registry: the registry
1671 * Returns the registrys feature list cookie. This changes
1672 * every time a feature is added or removed from the registry.
1674 * Returns: the feature list cookie.
1679 gst_registry_get_feature_list_cookie (GstRegistry * registry)
1681 g_return_val_if_fail (GST_IS_REGISTRY (registry), 0);
1683 return registry->priv->cookie;