]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gstreamer0-10.git/commitdiff
Remove duplicate rank field (fixes #119510)
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>
Mon, 18 Aug 2003 21:14:16 +0000 (21:14 +0000)
committerRonald 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)

gst/autoplug/gstsearchfuncs.c
gst/gstelement.h
gst/gstelementfactory.c
gst/registries/gstxmlregistry.c

index 4378d2826c75497015798dbbe681393ba4c0e339..2602c212f4ef4a2b23c42d7aa956bb94c4fa0dc1 100644 (file)
@@ -236,8 +236,8 @@ gst_autoplug_factories_filters (GList *factories)
 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
@@ -255,7 +255,7 @@ gst_autoplug_factories_filters_with_sink_caps (GList *factories)
   {
     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;
 
index f86dada986b91e5adbf613dda38bf658713fcafb..4eb1b623f5eb240e60344514557c2d682d6569ea 100644 (file)
@@ -386,8 +386,6 @@ struct _GstElementFactory {
 
   GList *padtemplates;
   guint16 numpadtemplates;
-
-  guint16 rank;                        /* used by autoplug to prioritise elements to try */
 };
 
 struct _GstElementFactoryClass {
@@ -413,8 +411,6 @@ 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);
 
-void                   gst_element_factory_set_rank            (GstElementFactory *factory, guint16 rank);
-
 G_END_DECLS
 
 
index f91c91c42eaf3d126c366c43471b975ed1dd3d9f..c222888d24ed7e547ffca9bf9c02c364c10d9612 100644 (file)
@@ -406,22 +406,6 @@ 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)
 {
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;
 }
@@ -914,7 +909,6 @@ gst_xml_registry_start_element (GMarkupParseContext *context,
            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) {