From 19b4c9c793ef3b56f49e1911be16818d24c0f2f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 30 Oct 2011 21:21:59 +0000 Subject: [PATCH] pluginfeature: deprecate gst_plugin_feature_type_name_filter() It's only used internally anyway and the helper struct has namespace issues. API: deprecated gst_plugin_feature_type_name_filter() API: deprecated GstTypeNameData --- gst/gstpluginfeature.c | 11 +++++++++++ gst/gstpluginfeature.h | 4 ++++ gst/gstregistry.c | 18 ++++++++++++++++++ tests/check/gst/struct_x86_64.h | 2 ++ 4 files changed, 35 insertions(+) diff --git a/gst/gstpluginfeature.c b/gst/gstpluginfeature.c index 88adc40959..acdc621581 100644 --- a/gst/gstpluginfeature.c +++ b/gst/gstpluginfeature.c @@ -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) @@ -166,6 +176,7 @@ gst_plugin_feature_type_name_filter (GstPluginFeature * feature, (data->name == NULL || !strcmp (data->name, GST_PLUGIN_FEATURE_NAME (feature)))); } +#endif /* GST_REMOVE_DEPRECATED */ /** * gst_plugin_feature_set_name: diff --git a/gst/gstpluginfeature.h b/gst/gstpluginfeature.h index 11641a4c24..835d49b292 100644 --- a/gst/gstpluginfeature.h +++ b/gst/gstpluginfeature.h @@ -105,10 +105,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: @@ -130,8 +132,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); void gst_plugin_feature_set_name (GstPluginFeature *feature, const gchar *name); diff --git a/gst/gstregistry.c b/gst/gstregistry.c index ddbb78901d..67c09b4660 100644 --- a/gst/gstregistry.c +++ b/gst/gstregistry.c @@ -642,6 +642,24 @@ gst_registry_plugin_filter (GstRegistry * 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_PLUGIN_FEATURE_NAME (feature)))); +} +#endif + /* returns TRUE if the list was changed * * Must be called with the object lock taken */ diff --git a/tests/check/gst/struct_x86_64.h b/tests/check/gst/struct_x86_64.h index e035090435..e412f5466e 100644 --- a/tests/check/gst/struct_x86_64.h +++ b/tests/check/gst/struct_x86_64.h @@ -77,7 +77,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}, #if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_DISABLE_DEPRECATED) && !defined(GST_REMOVE_DEPRECATED)