GNOME Bugzilla – Bug 737396
decodebin doesn't limit src caps on parsers
Last modified: 2018-05-06 09:29:33 UTC
AAC parser never transforms stream: - aacparse srccaps are not fixed, so decodebin only knows the caps when aacparse sets them on pad; by then it is too late and decodebin won't find decoder factory - example - ADTS input and decoder that can only decode raw stream; Same happens with h.264 parser. i.e. h.264 decoder that accepts byte-stream only will not currently work with h.264 parser. Behavior is slightly different between these two. H.264 parser defaults to AVC, so unless srccaps are filtered, regardless of input it outputs AVC; aacparse outputs stream in same format as input, unless srccaps are filtered.
Do you have a testcase for this? This is supposed to be handled by the capsfilter magic in decodebin that happens when a Parser/Converter is added to the pipeline.
So, the magic is there but it doesn't really seem to work :) 1.aacparse doesn't have Converter in metadata, so decodebin doesn't execute the is_parser_converter branch 2. even when is_parser_converter branch is executed, the following code in decodebin /* Append the parser caps to prevent any not-negotiated errors */ filter_caps = gst_caps_merge (filter_caps, gst_caps_ref (caps)); just merges the filtered caps with parser original srcpad caps, so it ends up where it was at the beginning. perhaps it should be in "else" block?
(sorry, disregard the else block. the is_parse_converter branch is longer than I realized)
It would be really good to have a unit test for this :)
(In reply to comment #2) > 2. even when is_parser_converter branch is executed, the following code in > decodebin > > /* Append the parser caps to prevent any not-negotiated errors */ > filter_caps = gst_caps_merge (filter_caps, gst_caps_ref (caps)); > > just merges the filtered caps with parser original srcpad caps, so it ends up > where it was at the beginning. perhaps it should be in "else" block? But the decoder preferred caps are at the beginning. And e.g. h264parse prefers them over others then.
It doesn't seem that this is enough to force stream transformation. I don't understand how this is supposed to work. Are you saying that the parser/converter should always transform to caps at the beginning, even though second structure srccaps is same as sink caps? If so then how is the converter supposed to know that passthrough is not ok in this case (even though as far as it is concerned the peer accepts parser sink caps)?
The issue doesn't happen with parsebin/decodebin3 (because everything is linked at negotiation time).