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.
This commit is contained in:
Sebastian Dröge 2014-12-17 17:54:09 +01:00
parent e354149436
commit 26d1a22e90
2 changed files with 5 additions and 2 deletions

View file

@ -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;

View file

@ -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");