GNOME Bugzilla – Bug 650228
Fix h264parse negotiation
Last modified: 2011-05-25 19:54:29 UTC
Negotiation in h264parse is currently broken. It negotiates caps with downstream only if the incoming stream is packetized and the split-packetized properties is set to TRUE (the default is FALSE). These are two pipelines that fail to negotiate because of this: gst-launch videotestsrc ! x264enc byte-stream=false ! h264parse ! avimux ! fakesink gst-launch videotestsrc ! x264enc byte-stream=false ! h264parse ! mpegtsmux ! fakesink
Created attachment 187843 [details] [review] fix
Then again, the following pipeline negotiates fine: gst-launch videotestsrc ! x264enc byte-stream=false ! h264parse split-packetized=true ! avimux ! fakesink So, not splitting packetized input unless explicitly allowed is a bit a matter of choice, rather than necessarily "broken". If felt this should happen sufficiently automagically to warrant api/abi breakage, then ok. In any case, a bit more description/documentation on this / such choices than "fix negotiation" seems in order. Also, if I read the original description properly, it would seem to suggest that negotiation does not work at all if incoming data is bytestream, which is not the case (should work ok regardless of any property)
(In reply to comment #2) > Then again, the following pipeline negotiates fine: > > gst-launch videotestsrc ! x264enc byte-stream=false ! > h264parse split-packetized=true ! avimux ! fakesink > > So, not splitting packetized input unless explicitly allowed is a bit a matter > of choice, rather than necessarily "broken". If felt this should happen > sufficiently automagically to warrant api/abi breakage, then ok. The end goal is to make h264parse autopluggable, so yeah. Also considering we just renamed the old parser to legacyh264parse and changed API in the process, this is a good time to fix the API some more IMO. > In any case, a bit more description/documentation on this / such choices than > "fix negotiation" seems in order. The reason for the generic description is that i'm not sure of exactly what combinations of input/output are broken without the patch. In some cases it doesn't negotiate correctly unless split-packetized is TRUE. Looking at the code it's obvious what needs to be changed so I did that :) > Also, if I read the original description properly, it would seem to suggest > that negotiation does not work at all if incoming data is bytestream, which is > not the case (should work ok regardless of any property) True, sorry about that. It should have been: "When input is packetized it negotiates with downstream only if split-packetized is set"
Some unit tests would be really nice..
FWIW, I'm looking into some unit tests for videoparsers, so a.o. h264parse, to be determined in how much it can cover this particular situation.
commit 6a8d66728f0c88c4e087d489084ecc31071dc251 Author: Alessandro Decina <alessandro.d@gmail.com> Date: Sun May 15 13:23:39 2011 +0200 h264parse: allow full negotiation for packetized input ... by defaulting to allow splitting packetized input and having negotiation with downstream deciding whether or not this applies. Also enable pass-through parsing mode if input and output format (stream-format and alignment) match. API: GstH264Parse:split-packetized (removed) Fixes #650228.