From 7418dee253f8c34748fd4b651444a21186b9a127 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 9 Dec 2009 21:03:57 +0100 Subject: [PATCH] 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. --- gst/videomixer/videomixer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gst/videomixer/videomixer.c b/gst/videomixer/videomixer.c index 9107fee..ef49037 100644 --- a/gst/videomixer/videomixer.c +++ b/gst/videomixer/videomixer.c @@ -1135,8 +1135,7 @@ gst_videomixer_fill_queues (GstVideoMixer * mix) 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) { guint64 duration; @@ -1289,6 +1288,8 @@ gst_videomixer_update_queues (GstVideoMixer * mix) GST_LOG_OBJECT (pad, "queued now %" G_GINT64_FORMAT, pad->queued); if (pad->queued <= 0) { GST_LOG_OBJECT (pad, "unreffing buffer"); + gst_buffer_unref (gst_collect_pads_pop (mix->collect, + &mixcol->collect)); gst_buffer_unref (mixcol->buffer); mixcol->buffer = NULL; } -- 2.7.4