mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 04:00:37 +00:00
videomixer: Only pop buffers from collectpads after they're fully consumed
This decreases latency and memory usage because new buffers are only accepted by collectpads if there's no queued buffer.
This commit is contained in:
parent
cd888c0531
commit
7418dee253
1 changed files with 3 additions and 2 deletions
|
@ -1135,8 +1135,7 @@ gst_videomixer_fill_queues (GstVideoMixer * mix)
|
||||||
|
|
||||||
GST_LOG_OBJECT (mix, "we need a new buffer");
|
GST_LOG_OBJECT (mix, "we need a new buffer");
|
||||||
|
|
||||||
buf = gst_collect_pads_pop (mix->collect, data);
|
buf = gst_collect_pads_peek (mix->collect, data);
|
||||||
|
|
||||||
if (buf) {
|
if (buf) {
|
||||||
guint64 duration;
|
guint64 duration;
|
||||||
|
|
||||||
|
@ -1289,6 +1288,8 @@ gst_videomixer_update_queues (GstVideoMixer * mix)
|
||||||
GST_LOG_OBJECT (pad, "queued now %" G_GINT64_FORMAT, pad->queued);
|
GST_LOG_OBJECT (pad, "queued now %" G_GINT64_FORMAT, pad->queued);
|
||||||
if (pad->queued <= 0) {
|
if (pad->queued <= 0) {
|
||||||
GST_LOG_OBJECT (pad, "unreffing buffer");
|
GST_LOG_OBJECT (pad, "unreffing buffer");
|
||||||
|
gst_buffer_unref (gst_collect_pads_pop (mix->collect,
|
||||||
|
&mixcol->collect));
|
||||||
gst_buffer_unref (mixcol->buffer);
|
gst_buffer_unref (mixcol->buffer);
|
||||||
mixcol->buffer = NULL;
|
mixcol->buffer = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue