gstreamer: basetransform: Retain caps order when getting caps

Thiago Sousa Santos thiagoss at kemper.freedesktop.org
Thu Mar 24 08:56:23 PDT 2011


Module: gstreamer
Branch: master
Commit: 0f0a62f316aff3a135ca4bcfe98964f1d053be73
URL:    http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=0f0a62f316aff3a135ca4bcfe98964f1d053be73

Author: Edward Hervey <bilboed at bilboed.com>
Date:   Mon Apr 19 20:40:56 2010 +0200

basetransform: Retain caps order when getting caps

If the element gave us caps in a specific order, let's retain that
by intersecting against the template but retaining the order given
by the element.

https://bugzilla.gnome.org/show_bug.cgi?id=617045

---

 libs/gst/base/gstbasetransform.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c
index db4f963..76fec60 100644
--- a/libs/gst/base/gstbasetransform.c
+++ b/libs/gst/base/gstbasetransform.c
@@ -686,7 +686,8 @@ gst_base_transform_getcaps (GstPad * pad)
     /* and filter against the template of this pad */
     templ = gst_pad_get_pad_template_caps (pad);
     GST_DEBUG_OBJECT (pad, "our template  %" GST_PTR_FORMAT, templ);
-    temp = gst_caps_intersect (caps, templ);
+    /* We keep the caps sorted like the returned caps */
+    temp = gst_caps_intersect_full (caps, templ, GST_CAPS_INTERSECT_FIRST);
     GST_DEBUG_OBJECT (pad, "intersected %" GST_PTR_FORMAT, temp);
     gst_caps_unref (caps);
     /* this is what we can do */



More information about the gstreamer-commits mailing list