mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-25 16:48:11 +00:00
add a rank to elementfactory for autoplugging
Original commit message from CVS: add a rank to elementfactory for autoplugging
This commit is contained in:
parent
3ac5605ac4
commit
5d902beab8
2 changed files with 25 additions and 0 deletions
|
@ -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(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_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 {
|
struct _GstElementFactory {
|
||||||
GstPluginFeature feature;
|
GstPluginFeature feature;
|
||||||
|
|
||||||
|
@ -315,6 +320,8 @@ struct _GstElementFactory {
|
||||||
|
|
||||||
GList *padtemplates;
|
GList *padtemplates;
|
||||||
guint16 numpadtemplates;
|
guint16 numpadtemplates;
|
||||||
|
|
||||||
|
guint16 rank; /* used by autoplug to prioritise elements to try */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstElementFactoryClass {
|
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 */
|
/* FIXME this name is wrong, probably so is the one above it */
|
||||||
GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name);
|
GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name);
|
||||||
|
|
||||||
|
void gst_element_factory_set_rank (GstElementFactory *factory, guint16 rank);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -360,6 +360,22 @@ gst_element_factory_can_sink_caps (GstElementFactory *factory,
|
||||||
return FALSE;
|
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
|
static void
|
||||||
gst_element_factory_unload_thyself (GstPluginFeature *feature)
|
gst_element_factory_unload_thyself (GstPluginFeature *feature)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue