cccombiner: stop attaching caption buffers when caption pad has gone EOS
authorMathieu Duponchelle <mathieu@centricular.com>
Mon, 25 Oct 2021 23:09:58 +0000 (01:09 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 26 Oct 2021 14:48:13 +0000 (14:48 +0000)
commitfa1805d531fb0045b2ae981a8ddc5590eb5af476
tree614b1bd7b3e1ef8536b5be2bea1e5e5993caba56
parentfdb16cddb18bce98f96ef8b03d74ddeba9334a30
cccombiner: stop attaching caption buffers when caption pad has gone EOS

When schedule is true (as is the case by default), we insert padding
when no caption data is present in the schedule queue, and previously
weren't checking whether the caption pad had gone EOS, leading to
infinite scheduling of padding after EOS on the caption pad.

Rectify that by adding a "drain" parameter to dequeue_caption()

In addition, update the captions_and_eos test to push valid cc_data
in: without this cccombiner was attaching padding buffers it had
generated itself, and with that patch would now stop attaching
said padding to the second buffer. By pushing valid, non-padding
cc_data we ensure a caption buffer is indeed attached to the first
and second video buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1252>
subprojects/gst-plugins-bad/ext/closedcaption/gstcccombiner.c
subprojects/gst-plugins-bad/tests/check/elements/cccombiner.c