summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c8bdc19)
raw | patch | inline | side by side (parent: c8bdc19)
author | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | |
Mon, 18 Aug 2003 21:14:16 +0000 (21:14 +0000) | ||
committer | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | |
Mon, 18 Aug 2003 21:14:16 +0000 (21:14 +0000) |
Original commit message from CVS:
Remove duplicate rank field (fixes #119510)
Remove duplicate rank field (fixes #119510)
gst/autoplug/gstsearchfuncs.c | patch | blob | history | |
gst/gstelement.h | patch | blob | history | |
gst/gstelementfactory.c | patch | blob | history | |
gst/registries/gstxmlregistry.c | patch | blob | history |
index 4378d2826c75497015798dbbe681393ba4c0e339..2602c212f4ef4a2b23c42d7aa956bb94c4fa0dc1 100644 (file)
static gint
gst_autoplug_rank_compare (const GstElementFactory *a, const GstElementFactory *b)
{
- if (a->rank > b->rank) return -1;
- return (a->rank < b->rank) ? 1 : 0;
+ if (GST_PLUGIN_FEATURE (a)->rank > GST_PLUGIN_FEATURE (b)->rank) return -1;
+ return (GST_PLUGIN_FEATURE (a)->rank < GST_PLUGIN_FEATURE (b)->rank) ? 1 : 0;
}
/* returns all factories which have sinks with non-NULL caps and srcs with
{
factory = (GstElementFactory *) factories->data;
templs = factory->padtemplates;
- if (factory->rank > 0){
+ if (GST_PLUGIN_FEATURE (factory)->rank > 0){
gboolean have_src = FALSE;
gboolean have_sink = FALSE;
diff --git a/gst/gstelement.h b/gst/gstelement.h
index f86dada986b91e5adbf613dda38bf658713fcafb..4eb1b623f5eb240e60344514557c2d682d6569ea 100644 (file)
--- a/gst/gstelement.h
+++ b/gst/gstelement.h
GList *padtemplates;
guint16 numpadtemplates;
-
- guint16 rank; /* used by autoplug to prioritise elements to try */
};
struct _GstElementFactoryClass {
GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name);
GstElement* gst_element_factory_make_or_warn (const gchar *factoryname, const gchar *name);
-void gst_element_factory_set_rank (GstElementFactory *factory, guint16 rank);
-
G_END_DECLS
index f91c91c42eaf3d126c366c43471b975ed1dd3d9f..c222888d24ed7e547ffca9bf9c02c364c10d9612 100644 (file)
--- a/gst/gstelementfactory.c
+++ b/gst/gstelementfactory.c
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)
{
index 516e66291763ededcec841efa7dd5d161484960d..c23a57a129fd6554a31dab1e854e7430eae6fcf5 100644 (file)
@@ -691,11 +691,6 @@ gst_xml_registry_parse_element_factory (GMarkupParseContext *context, const gcha
else if (!strcmp(tag, "copyright")) {
factory->details->copyright = g_strndup (text, text_len);
}
- else if (!strcmp(tag, "rank")) {
- gint value;
- sscanf (text, "%d", &value);
- factory->rank = value;
- }
return TRUE;
}
factory->details_dynamic = TRUE;
factory->details = g_new0(GstElementDetails, 1);
factory->padtemplates = NULL;
- factory->rank = 0;
xmlregistry->parser = gst_xml_registry_parse_element_factory;
break;
}
@@ -1444,6 +1438,11 @@ gst_xml_registry_save_feature (GstXMLRegistry *xmlregistry, GstPluginFeature *fe
{
PUT_ESCAPED ("name", feature->name);
+ if (feature->rank > 0) {
+ gint rank = feature->rank;
+ CLASS (xmlregistry)->save_func (xmlregistry, "<rank>%d</rank>\n", rank);
+ }
+
if (GST_IS_ELEMENT_FACTORY (feature)) {
GstElementFactory *factory = GST_ELEMENT_FACTORY (feature);
GList *templates;
@@ -1456,12 +1455,6 @@ gst_xml_registry_save_feature (GstXMLRegistry *xmlregistry, GstPluginFeature *fe
PUT_ESCAPED ("author", factory->details->author);
PUT_ESCAPED ("copyright", factory->details->copyright);
- /* only write the rank if it is greater than zero */
- if (factory->rank > 0) {
- gint rank = factory->rank;
- CLASS (xmlregistry)->save_func (xmlregistry, "<rank>%d</rank>\n", rank);
- }
-
templates = factory->padtemplates;
while (templates) {