From c4d186ec85b141bc1bcbbe2d8e03fbde8310a9fc Mon Sep 17 00:00:00 2001 From: David Schleef Date: Tue, 19 Aug 2003 07:31:24 +0000 Subject: [PATCH] Er, plugins actually use gst_element_factory_set_rank(). Add a define to call gst_plugin_feature_set_rank(). Original commit message from CVS: Er, plugins actually use gst_element_factory_set_rank(). Add a define to call gst_plugin_feature_set_rank(). --- gst/gstelement.h | 3 +++ gst/gstpluginfeature.c | 18 ++++++++++++++++++ gst/gstpluginfeature.h | 2 ++ 3 files changed, 23 insertions(+) diff --git a/gst/gstelement.h b/gst/gstelement.h index 4eb1b623f5..1a4f997c79 100644 --- a/gst/gstelement.h +++ b/gst/gstelement.h @@ -411,6 +411,9 @@ GstElement* gst_element_factory_create (GstElementFactory *factory, GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name); GstElement* gst_element_factory_make_or_warn (const gchar *factoryname, const gchar *name); +#define gst_element_factory_set_rank(factory, rank) \ + gst_plugin_feature_set_rank (GST_PLUGIN_FEATURE (factory), rank) + G_END_DECLS diff --git a/gst/gstpluginfeature.c b/gst/gstpluginfeature.c index dbd680d0e0..abc0473020 100644 --- a/gst/gstpluginfeature.c +++ b/gst/gstpluginfeature.c @@ -136,3 +136,21 @@ 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_PLUGIN_FEATURE_NAME (feature)))); } + +/** + * gst_plugin_feature_set_rank: + * @feature: feature to rank + * @rank: rank value - higher number means more priority rank + * + * Specifies a rank for a plugin feature, so that autoplugging uses + * the most appropriate feature. + */ +void +gst_plugin_feature_set_rank (GstPluginFeature *feature, guint16 rank) +{ + g_return_if_fail (feature != NULL); + g_return_if_fail (GST_IS_PLUGIN_FEATURE (feature)); + + feature->rank = rank; +} + diff --git a/gst/gstpluginfeature.h b/gst/gstpluginfeature.h index 946434fa3b..c8082e5c7d 100644 --- a/gst/gstpluginfeature.h +++ b/gst/gstpluginfeature.h @@ -74,6 +74,8 @@ void gst_plugin_feature_unload_thyself (GstPluginFeature *feature); gboolean gst_plugin_feature_type_name_filter (GstPluginFeature *feature, GstTypeNameData *data); +void gst_plugin_feature_set_rank (GstPluginFeature *feature, guint16 rank); + G_END_DECLS