GNOME Bugzilla – Bug 742938
v4l2videodec: Could fail early on unsupported video that has codec_data
Last modified: 2015-08-10 21:47:52 UTC
Unfortunately MFC fails when reading certain video headers. It is not clear why, but failing early would allow decodebin to skip the decoder and use a SW decoder as replacement. One of the failing media is found in gst-validate: gst-validate/gst-integration-testsuites/medias/defaults/mxf/op2b-mpeg2-wave_hd.mxf The solution would be to setup the output format and queue in set_format() method if a codec_data is provided instead of doing it in handle_frame(). Failing at that stage allow decodebin to skip the decoder instead of failing the pipeline.
In fact, a lot of the stuff done in handle_frame() should be moved to negotiate(). This way if we find codec_data in the caps, we simply call negotiate.
Turns out that people are getting keener to wait for the first SOURCE_CHANGE event before reading the CAPTURE format instead of making G_FMT synhronize on header parsing. That basically means (unless we wait for the event synchronously) that this idea of "detecting" unsupported stream through header parsing might not be possible.
I'm abandoning this one.