diff --git a/gst/gst_private.h b/gst/gst_private.h index 3cd2d3d4bf..8eb28cf0bb 100644 --- a/gst/gst_private.h +++ b/gst/gst_private.h @@ -92,6 +92,10 @@ struct _GstPluginPrivate { GstStructure *cache_data; }; +/* Private function for getting plugin features directly */ +GList * +_priv_plugin_get_features(GstRegistry *registry, GstPlugin *plugin); + /* Needed by GstMeta (to access meta seq) and GstBuffer (create/free/iterate) */ typedef struct _GstMetaItem GstMetaItem; struct _GstMetaItem { diff --git a/gst/gstregistry.c b/gst/gstregistry.c index 4bc5e8fe8b..7ed85d77e2 100644 --- a/gst/gstregistry.c +++ b/gst/gstregistry.c @@ -1429,6 +1429,24 @@ gst_registry_get_feature_list_by_plugin (GstRegistry * registry, _gst_plugin_feature_filter_plugin_name, FALSE, (gpointer) name); } +/* Private function for getting plugin features directly */ +GList * +_priv_plugin_get_features (GstRegistry * registry, GstPlugin * plugin) +{ + GList *res = NULL; + GList *walk; + + GST_OBJECT_LOCK (registry); + for (walk = registry->priv->features; walk; walk = walk->next) { + GstPluginFeature *feat = (GstPluginFeature *) walk->data; + if (feat->plugin == plugin) + res = g_list_prepend (res, gst_object_ref (feat)); + } + GST_OBJECT_UNLOCK (registry); + + return res; +} + /* Unref and delete the default registry */ void _priv_gst_registry_cleanup (void) diff --git a/gst/gstregistrychunks.c b/gst/gstregistrychunks.c index e8fb3ac2e7..15015d8b4c 100644 --- a/gst/gstregistrychunks.c +++ b/gst/gstregistrychunks.c @@ -460,8 +460,7 @@ _priv_gst_registry_chunks_save_plugin (GList ** list, GstRegistry * registry, } /* pack plugin features */ - plugin_features = - gst_registry_get_feature_list_by_plugin (registry, plugin->desc.name); + plugin_features = _priv_plugin_get_features (registry, plugin); for (walk = plugin_features; walk; walk = g_list_next (walk), pe->nfeatures++) { GstPluginFeature *feature = GST_PLUGIN_FEATURE (walk->data);