On Thu Jul 31 05:43:48 2025 +0000, Tim Clem wrote:
Does this need to force `stream-format=byte-stream`? That seems to break h.264 decoding on macOS with the [vtdec element](https://gstreamer.freedesktop.org/documentation/applemedia/vtdec.html?gi-lan...), which only accepts `stream-format=avc`.
I never did get to the bottom of why this was required for `avdec_h264`, after all, GStreamer plays the test file just fine without the need for a `capsfilter` between `h264parse` and `avdec_h264`. So I dug a bit deeper this morning.
It seems it fails under wine as a result of the `GST_EVENT_SEGMENT_DONE` event sent within `complete_drain`. When `h264parse` receives this event, it fixates its caps to `AVC` and then forwards its data buffers to `avdec_h264` without ever providing `codec_data` (which is required for AVC).
Simply removing all the events sent in `complete_drain` fixes this problem but unsurprisingly causes a couple of other test failures (along with one fix!). You can see an example of what I mean here:
https://gitlab.winehq.org/redmcg/wine/-/merge_requests/7
But I'm not sure yet if this is a bug in `h264parse` or in our draining logic.