[Bug 698712] playbin: autoplug video decoder and sink based on caps features

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue May 7 01:48:40 PDT 2013


https://bugzilla.gnome.org/show_bug.cgi?id=698712
  GStreamer | gst-plugins-base | git

Sebastian Dröge <slomo> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #243011|none                        |needs-work
             status|                            |

--- Comment #77 from Sebastian Dröge <slomo at circular-chaos.org> 2013-05-07 08:48:33 UTC ---
Review of attachment 243011:
 --> (https://bugzilla.gnome.org/review?bug=698712&attachment=243011)

No, you're not doing that in your patch :)

::: gst/playback/gstplaybin2.c
@@ +3449,3 @@
       ave->sink = gst_object_ref (s_factory);
       ave->n_comm_cf = n_common_cf;
+      g_sequence_append (ave_seq, ave);

This should use g_sequence_insert_sorted() and the compare function should only
compare the factories (by pointer). Due to the way how GSequence is implemented
this has no overhead over "append and sort in the end".

@@ +3453,3 @@
     sl = sink_list;
   }
+  g_sequence_sort (ave_seq, (GCompareDataFunc) avelement_compare, NULL);

This is not necessary anymore then

@@ +3486,3 @@
   }

+  seq_iter = g_sequence_get_begin_iter (avelements);

This should iterate over the (filtered!) decoder factories we get passed and
use g_sequence_lookup() with the decoder factories and the
compare-decoder-factory-pointer comparison function. Then go to the first
iterator that has this decoder factory and iterate until the last iterator with
that same decoder factory, looking for the "best" one among them, and append
that avelement to a new GList.
After this iteration you sort this new GList according to the important metric
(number of common caps features) and then do the same as the old code.

@@ +3817,3 @@
+    while (!g_sequence_iter_is_end (seq_iter)) {
+      ave = (GstAVElement *) g_sequence_get (seq_iter);
+      if (ave->dec != factory) {

Here you also use g_sequence_lookup() and g_sequence_iter_prev() to find the
first iterator for this decoder factory. Then create a new GList with these few
avelements and sort it according to the metric (number of common caps
features). Then iterate over this new, very small list as before.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list