From 26d1a22e903a62592b850db0c64badff7ca510cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 17 Dec 2014 17:54:09 +0100 Subject: [PATCH] aggregator: Add a timeout parameter to ::aggregate() When this is TRUE, we really have to produce output. This happens in live mixing mode when we have to output something for the current time, no matter if we have enough input or not. --- gst-libs/gst/video/gstvideoaggregator.c | 4 ++-- gst/compositor/compositor.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/video/gstvideoaggregator.c b/gst-libs/gst/video/gstvideoaggregator.c index a711beea8c..898de598f2 100644 --- a/gst-libs/gst/video/gstvideoaggregator.c +++ b/gst-libs/gst/video/gstvideoaggregator.c @@ -1230,7 +1230,7 @@ gst_videoaggregator_get_next_time (GstAggregator * agg) } static GstFlowReturn -gst_videoaggregator_aggregate (GstAggregator * agg) +gst_videoaggregator_aggregate (GstAggregator * agg, gboolean timeout) { GstFlowReturn ret; GstVideoAggregator *vagg = GST_VIDEO_AGGREGATOR (agg); @@ -1275,7 +1275,7 @@ gst_videoaggregator_aggregate (GstAggregator * agg) output_end_time); } - if (res == GST_FLOW_NEEDS_DATA) { + if (res == GST_FLOW_NEEDS_DATA && !timeout) { GST_DEBUG_OBJECT (vagg, "Need more data for decisions"); ret = GST_FLOW_OK; goto done; diff --git a/gst/compositor/compositor.c b/gst/compositor/compositor.c index 04d01a14cc..c5d09011c5 100644 --- a/gst/compositor/compositor.c +++ b/gst/compositor/compositor.c @@ -280,6 +280,9 @@ gst_compositor_pad_prepare_frame (GstVideoAggregatorPad * pad, static GstAllocationParams params = { 0, 15, 0, 0, }; gint width, height; + if (!pad->buffer) + return TRUE; + if (!gst_video_frame_map (frame, &pad->buffer_vinfo, pad->buffer, GST_MAP_READ)) { GST_WARNING_OBJECT (vagg, "Could not map input buffer");