androidmedia/enc: handle codec-data before popping GstVideoCodecFrames
authorMatthew Waters <matthew@centricular.com>
Fri, 15 Sep 2023 01:06:52 +0000 (11:06 +1000)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Sat, 16 Sep 2023 01:40:17 +0000 (01:40 +0000)
commiteef2348743cd892d2fafab7fd228b3013520f849
treef7f0c3bfd01f1089c0d5ba0fc684834d28e0090b
parent790e480c7fd9fb1ad82109768b35db67a906e21b
androidmedia/enc: handle codec-data before popping GstVideoCodecFrames

Issue is that when amc was producing a codec-data buffer, a
GstVideoCodecFrame was being popped off the internal queue.  This meant
that the codec-data was being associated with the first input frame and
the second (first encoded buffer) output buffer with the second input
frame.  At the end (assuming one input produces one output which seems
to hold in my testing and how the encoder is currently implemented)
there would be an input frame missing and would be pushed without any
timing information.  This would lead to e.g. muxers rejecting the buffer
without PTS and failing to mux.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5335>
subprojects/gst-plugins-bad/sys/androidmedia/gstamcvideoenc.c