amfencoder: always empty the queue when pushing output samples
authorJakub Adam <jakub.adam@collabora.com>
Tue, 31 May 2022 18:39:29 +0000 (20:39 +0200)
committerJakub Adam <jakub.adam@collabora.com>
Wed, 1 Jun 2022 16:19:09 +0000 (18:19 +0200)
commit9fd396834a80f1dfe9d39ef859557bed9f61adf4
tree4105c5f4428aaad0c81540f214f0be25a806a24b
parent238ce301b699201ed33665a3b2ae44e8b6efa249
amfencoder: always empty the queue when pushing output samples

gst_amf_encoder_try_output() pushes at most one output buffer downstream
although more may be ready. As a consequence, output samples will keep
queueing up in AMFComponent whenever QueryOutput() returns AMF_REPEAT
(and do_wait is FALSE). This has negative impact on latency when the
video being encoded is a live stream.

In order to avoid it, always retrieve and push all samples available in
AMFComponent's output queue at once.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2536>
subprojects/gst-plugins-bad/sys/amfcodec/gstamfencoder.cpp