[0.11] gst-plugins-base: decodebin2: Try harder to get initial topology caps

Edward Hervey bilboed at kemper.freedesktop.org
Fri Jan 6 06:39:45 PST 2012


Module: gst-plugins-base
Branch: 0.11
Commit: 6b3e3544d41ce0bc42c3597b3eb2130719379917
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=6b3e3544d41ce0bc42c3597b3eb2130719379917

Author: Edward Hervey <edward.hervey at collabora.co.uk>
Date:   Thu Jan  5 08:29:43 2012 +0100

decodebin2: Try harder to get initial topology caps

Since caps are no longer 'shared' between two pads (but forwarded from
source pad to sink pad) we end up with the first chain pad not having
specified caps (i.e. typefind:src).

This solves the issues by getting the pad's peer caps.

It is not optimal since it will (for most demuxers) return the pad
template caps, which might contain non-fixed caps (ex : with
qtdemux "video/quicktime; video/mj2; audio/x-m4a; application/x-3gp")

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

---

 gst/playback/gstdecodebin2.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c
index d266d71..e3501ab 100644
--- a/gst/playback/gstdecodebin2.c
+++ b/gst/playback/gstdecodebin2.c
@@ -3512,6 +3512,14 @@ gst_decode_chain_get_topology (GstDecodeChain * chain)
 
   /* Caps that resulted in this chain */
   caps = gst_pad_get_current_caps (chain->pad);
+
+  if (!caps) {
+    /* Try querying the peer sink pad caps.
+     * This will most likely be the case with typefind:src
+     */
+    caps = gst_pad_peer_query_caps (chain->pad, NULL);
+  }
+
   if (!caps) {
     caps = get_pad_caps (chain->pad);
     if (G_UNLIKELY (!gst_caps_is_fixed (caps))) {



More information about the gstreamer-commits mailing list