mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 04:22:27 +00:00
gstregistry: Use hash table when finding a feature. Fixes #598895
This commit is contained in:
parent
2f7b348fc0
commit
4b13520b61
1 changed files with 4 additions and 14 deletions
|
@ -659,25 +659,15 @@ gst_registry_find_feature (GstRegistry * registry, const gchar * name,
|
||||||
GType type)
|
GType type)
|
||||||
{
|
{
|
||||||
GstPluginFeature *feature = NULL;
|
GstPluginFeature *feature = NULL;
|
||||||
GList *walk;
|
|
||||||
GstTypeNameData data;
|
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
|
g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
|
||||||
g_return_val_if_fail (name != NULL, NULL);
|
g_return_val_if_fail (name != NULL, NULL);
|
||||||
g_return_val_if_fail (g_type_is_a (type, GST_TYPE_PLUGIN_FEATURE), NULL);
|
g_return_val_if_fail (g_type_is_a (type, GST_TYPE_PLUGIN_FEATURE), NULL);
|
||||||
|
|
||||||
data.name = name;
|
feature = gst_registry_lookup_feature (registry, name);
|
||||||
data.type = type;
|
if (feature && !g_type_is_a (G_TYPE_FROM_INSTANCE (feature), type)) {
|
||||||
|
gst_object_unref (feature);
|
||||||
walk = gst_registry_feature_filter (registry,
|
feature = NULL;
|
||||||
(GstPluginFeatureFilter) gst_plugin_feature_type_name_filter,
|
|
||||||
TRUE, &data);
|
|
||||||
|
|
||||||
if (walk) {
|
|
||||||
feature = GST_PLUGIN_FEATURE_CAST (walk->data);
|
|
||||||
|
|
||||||
gst_object_ref (feature);
|
|
||||||
gst_plugin_feature_list_free (walk);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return feature;
|
return feature;
|
||||||
|
|
Loading…
Reference in a new issue