mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-08 16:35:40 +00:00
Merge remote-tracking branch 'origin/master' into 0.11
Conflicts: gst/gstpluginfeature.c
This commit is contained in:
commit
cfff518cee
6 changed files with 86 additions and 17 deletions
|
@ -60,6 +60,12 @@
|
|||
* when no longer needed (the data contained in the list is a flat copy
|
||||
* and does need to be unreferenced or freed).
|
||||
*/
|
||||
#ifndef GST_REMOVE_DEPRECATED
|
||||
#ifdef GST_DISABLE_DEPRECATED
|
||||
typedef gboolean (*GstFilterFunc) (gpointer obj, gpointer user_data);
|
||||
GList *gst_filter_run (const GList * list, GstFilterFunc func, gboolean first,
|
||||
gpointer user_data);
|
||||
#endif
|
||||
GList *
|
||||
gst_filter_run (const GList * list, GstFilterFunc func, gboolean first,
|
||||
gpointer user_data)
|
||||
|
@ -86,3 +92,4 @@ gst_filter_run (const GList * list, GstFilterFunc func, gboolean first,
|
|||
|
||||
return result;
|
||||
}
|
||||
#endif /* GST_REMOVE_DEPRECATED */
|
||||
|
|
|
@ -35,9 +35,13 @@ G_BEGIN_DECLS
|
|||
*
|
||||
* Returns: %TRUE for success.
|
||||
*/
|
||||
#ifndef GST_DISABLE_DEPRECATED
|
||||
typedef gboolean (*GstFilterFunc) (gpointer obj, gpointer user_data);
|
||||
#endif
|
||||
|
||||
#ifndef GST_DISABLE_DEPRECATED
|
||||
GList* gst_filter_run (const GList *list, GstFilterFunc func, gboolean first, gpointer user_data);
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
|
@ -156,6 +156,16 @@ not_found:
|
|||
*
|
||||
* Returns: TRUE if equal.
|
||||
*/
|
||||
#ifndef GST_REMOVE_DEPRECATED
|
||||
#ifdef GST_DISABLE_DEPRECATED
|
||||
typedef struct
|
||||
{
|
||||
const gchar *name;
|
||||
GType type;
|
||||
} GstTypeNameData;
|
||||
gboolean gst_plugin_feature_type_name_filter (GstPluginFeature * feature,
|
||||
GstTypeNameData * data);
|
||||
#endif
|
||||
gboolean
|
||||
gst_plugin_feature_type_name_filter (GstPluginFeature * feature,
|
||||
GstTypeNameData * data)
|
||||
|
@ -165,6 +175,7 @@ gst_plugin_feature_type_name_filter (GstPluginFeature * feature,
|
|||
return ((data->type == 0 || data->type == G_OBJECT_TYPE (feature)) &&
|
||||
(data->name == NULL || !strcmp (data->name, GST_OBJECT_NAME (feature))));
|
||||
}
|
||||
#endif /* GST_REMOVE_DEPRECATED */
|
||||
|
||||
/**
|
||||
* gst_plugin_feature_set_rank:
|
||||
|
|
|
@ -117,10 +117,12 @@ struct _GstPluginFeatureClass {
|
|||
*
|
||||
* Structure used for filtering based on @name and @type.
|
||||
*/
|
||||
#ifndef GST_DISABLE_DEPRECATED
|
||||
typedef struct {
|
||||
const gchar *name;
|
||||
GType type;
|
||||
} GstTypeNameData;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* GstPluginFeatureFilter:
|
||||
|
@ -142,8 +144,10 @@ GType gst_plugin_feature_get_type (void);
|
|||
GstPluginFeature *
|
||||
gst_plugin_feature_load (GstPluginFeature *feature);
|
||||
|
||||
#ifndef GST_DISABLE_DEPRECATED
|
||||
gboolean gst_plugin_feature_type_name_filter (GstPluginFeature *feature,
|
||||
GstTypeNameData *data);
|
||||
#endif
|
||||
|
||||
void gst_plugin_feature_set_rank (GstPluginFeature *feature, guint rank);
|
||||
guint gst_plugin_feature_get_rank (GstPluginFeature *feature);
|
||||
|
|
|
@ -628,22 +628,47 @@ GList *
|
|||
gst_registry_plugin_filter (GstRegistry * registry,
|
||||
GstPluginFilter filter, gboolean first, gpointer user_data)
|
||||
{
|
||||
GList *list;
|
||||
GList *g;
|
||||
GList *list = NULL;
|
||||
|
||||
g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
|
||||
|
||||
GST_OBJECT_LOCK (registry);
|
||||
list = gst_filter_run (registry->plugins, (GstFilterFunc) filter, first,
|
||||
user_data);
|
||||
for (g = list; g; g = g->next) {
|
||||
gst_object_ref (GST_PLUGIN_CAST (g->data));
|
||||
{
|
||||
const GList *walk;
|
||||
|
||||
for (walk = registry->plugins; walk != NULL; walk = walk->next) {
|
||||
GstPlugin *plugin = walk->data;
|
||||
|
||||
if (filter == NULL || filter (plugin, user_data)) {
|
||||
list = g_list_prepend (list, gst_object_ref (plugin));
|
||||
|
||||
if (first)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
GST_OBJECT_UNLOCK (registry);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
#ifdef GST_DISABLE_DEPRECATED
|
||||
typedef struct
|
||||
{
|
||||
const gchar *name;
|
||||
GType type;
|
||||
} GstTypeNameData;
|
||||
static gboolean
|
||||
gst_plugin_feature_type_name_filter (GstPluginFeature * feature,
|
||||
GstTypeNameData * data)
|
||||
{
|
||||
g_assert (GST_IS_PLUGIN_FEATURE (feature));
|
||||
|
||||
return ((data->type == 0 || data->type == G_OBJECT_TYPE (feature)) &&
|
||||
(data->name == NULL || !strcmp (data->name, GST_OBJECT_NAME (feature))));
|
||||
}
|
||||
#endif
|
||||
|
||||
/* returns TRUE if the list was changed
|
||||
*
|
||||
* Must be called with the object lock taken */
|
||||
|
@ -656,16 +681,24 @@ gst_registry_get_feature_list_or_create (GstRegistry * registry,
|
|||
|
||||
if (G_UNLIKELY (!*previous || priv->cookie != *cookie)) {
|
||||
GstTypeNameData data;
|
||||
const GList *walk;
|
||||
|
||||
if (*previous)
|
||||
if (*previous) {
|
||||
gst_plugin_feature_list_free (*previous);
|
||||
*previous = NULL;
|
||||
}
|
||||
|
||||
data.type = type;
|
||||
data.name = NULL;
|
||||
*previous =
|
||||
gst_filter_run (registry->features,
|
||||
(GstFilterFunc) gst_plugin_feature_type_name_filter, FALSE, &data);
|
||||
g_list_foreach (*previous, (GFunc) gst_object_ref, NULL);
|
||||
|
||||
for (walk = registry->features; walk != NULL; walk = walk->next) {
|
||||
GstPluginFeature *feature = walk->data;
|
||||
|
||||
if (gst_plugin_feature_type_name_filter (feature, &data)) {
|
||||
*previous = g_list_prepend (*previous, gst_object_ref (feature));
|
||||
}
|
||||
}
|
||||
|
||||
*cookie = priv->cookie;
|
||||
res = TRUE;
|
||||
}
|
||||
|
@ -747,16 +780,24 @@ GList *
|
|||
gst_registry_feature_filter (GstRegistry * registry,
|
||||
GstPluginFeatureFilter filter, gboolean first, gpointer user_data)
|
||||
{
|
||||
GList *list;
|
||||
GList *g;
|
||||
GList *list = NULL;
|
||||
|
||||
g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
|
||||
|
||||
GST_OBJECT_LOCK (registry);
|
||||
list = gst_filter_run (registry->features, (GstFilterFunc) filter, first,
|
||||
user_data);
|
||||
for (g = list; g; g = g->next) {
|
||||
gst_object_ref (GST_PLUGIN_FEATURE_CAST (g->data));
|
||||
{
|
||||
const GList *walk;
|
||||
|
||||
for (walk = registry->features; walk != NULL; walk = walk->next) {
|
||||
GstPluginFeature *feature = walk->data;
|
||||
|
||||
if (filter == NULL || filter (feature, user_data)) {
|
||||
list = g_list_prepend (list, gst_object_ref (feature));
|
||||
|
||||
if (first)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
GST_OBJECT_UNLOCK (registry);
|
||||
|
||||
|
|
|
@ -76,7 +76,9 @@ static GstCheckABIStruct list[] = {
|
|||
{"GstTypeFindFactoryClass", sizeof (GstTypeFindFactoryClass), 304},
|
||||
{"GstTypeFindFactory", sizeof (GstTypeFindFactory), 216},
|
||||
{"GstTypeFind", sizeof (GstTypeFind), 64},
|
||||
#if !defined(GST_DISABLE_DEPRECATED) && !defined(GST_REMOVE_DEPRECATED)
|
||||
{"GstTypeNameData", sizeof (GstTypeNameData), 16},
|
||||
#endif
|
||||
{"GstURIHandlerInterface", sizeof (GstURIHandlerInterface), 88},
|
||||
{"GstValueTable", sizeof (GstValueTable), 64},
|
||||
{NULL, 0, 0}
|
||||
|
|
Loading…
Reference in a new issue