mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 06:16:36 +00:00
videoaggregator: Catch errors, and allow sub-class to return NULL from get_output_buffer()
A return value of GST_FLOW_OK with a NULL buffer from get_output_buffer() means the sub-class doesn't want to produce an output buffer, so skip it. If gst_videoaggregator_do_aggregate() generates an error, make sure to propagate it - don't just ignore and discard the error by over-writing it with the gst_pad_push() result.
This commit is contained in:
parent
a3b806de4e
commit
70bae08cdd
1 changed files with 8 additions and 0 deletions
|
@ -1198,6 +1198,10 @@ gst_videoaggregator_do_aggregate (GstVideoAggregator * vagg,
|
||||||
gst_flow_get_name (ret));
|
gst_flow_get_name (ret));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
if (*outbuf == NULL) {
|
||||||
|
/* sub-class doesn't want to generate output right now */
|
||||||
|
return GST_FLOW_OK;
|
||||||
|
}
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (*outbuf) = output_start_time;
|
GST_BUFFER_TIMESTAMP (*outbuf) = output_start_time;
|
||||||
GST_BUFFER_DURATION (*outbuf) = output_end_time - output_start_time;
|
GST_BUFFER_DURATION (*outbuf) = output_end_time - output_start_time;
|
||||||
|
@ -1369,6 +1373,8 @@ gst_videoaggregator_aggregate (GstAggregator * agg, gboolean timeout)
|
||||||
if (jitter <= 0) {
|
if (jitter <= 0) {
|
||||||
ret = gst_videoaggregator_do_aggregate (vagg, output_start_time,
|
ret = gst_videoaggregator_do_aggregate (vagg, output_start_time,
|
||||||
output_end_time, &outbuf);
|
output_end_time, &outbuf);
|
||||||
|
if (ret != GST_FLOW_OK)
|
||||||
|
goto done;
|
||||||
vagg->priv->qos_processed++;
|
vagg->priv->qos_processed++;
|
||||||
} else {
|
} else {
|
||||||
GstMessage *msg;
|
GstMessage *msg;
|
||||||
|
@ -1405,6 +1411,8 @@ gst_videoaggregator_aggregate (GstAggregator * agg, gboolean timeout)
|
||||||
goto done_unlocked;
|
goto done_unlocked;
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
if (outbuf)
|
||||||
|
gst_buffer_unref (outbuf);
|
||||||
GST_VIDEO_AGGREGATOR_UNLOCK (vagg);
|
GST_VIDEO_AGGREGATOR_UNLOCK (vagg);
|
||||||
|
|
||||||
done_unlocked:
|
done_unlocked:
|
||||||
|
|
Loading…
Reference in a new issue