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
This commit is contained in:
Edward Hervey 2012-01-05 08:29:43 +01:00
parent c4fb6c94e2
commit 6b3e3544d4

View file

@ -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))) {