Commit 5d902bea authored by Steve Baker Baker's avatar Steve Baker Baker

add a rank to elementfactory for autoplugging

Original commit message from CVS:
add a rank to elementfactory for autoplugging
parent 3ac5605a
......@@ -304,6 +304,11 @@ struct _GstElementDetails {
#define GST_IS_ELEMENT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ELEMENT_FACTORY))
#define GST_IS_ELEMENT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ELEMENT_FACTORY))
#define GST_ELEMENT_RANK_PRIMARY 256
#define GST_ELEMENT_RANK_SECONDARY 128
#define GST_ELEMENT_RANK_MARGINAL 64
#define GST_ELEMENT_RANK_NONE 0
struct _GstElementFactory {
GstPluginFeature feature;
......@@ -315,6 +320,8 @@ struct _GstElementFactory {
GList *padtemplates;
guint16 numpadtemplates;
guint16 rank; /* used by autoplug to prioritise elements to try */
};
struct _GstElementFactoryClass {
......@@ -340,6 +347,8 @@ GstElement* gst_element_factory_create (GstElementFactory *factory,
/* FIXME this name is wrong, probably so is the one above it */
GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name);
void gst_element_factory_set_rank (GstElementFactory *factory, guint16 rank);
G_END_DECLS
......
......@@ -360,6 +360,22 @@ gst_element_factory_can_sink_caps (GstElementFactory *factory,
return FALSE;
}
/**
* gst_element_factory_set_rank :
* @factory: factory to rank
* @rank: rank value - higher number means more priority rank
*
* Specifies a rank for the element so that
* autoplugging uses the most appropriate elements.
*
*/
void
gst_element_factory_set_rank (GstElementFactory *factory, guint16 rank)
{
g_return_if_fail(factory != NULL);
factory->rank = rank;
}
static void
gst_element_factory_unload_thyself (GstPluginFeature *feature)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment