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