mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-09 10:59:39 +00:00
videoaggregator: fixing types in aggregate function
Correctly use boolean and GstFlowReturn types in the function.
This commit is contained in:
parent
a5e1f26385
commit
9f9c723f5d
1 changed files with 14 additions and 15 deletions
|
@ -1283,17 +1283,18 @@ gst_videoaggregator_get_next_time (GstAggregator * agg)
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_videoaggregator_aggregate (GstAggregator * agg, gboolean timeout)
|
gst_videoaggregator_aggregate (GstAggregator * agg, gboolean timeout)
|
||||||
{
|
{
|
||||||
GstFlowReturn ret;
|
|
||||||
GstVideoAggregator *vagg = GST_VIDEO_AGGREGATOR (agg);
|
GstVideoAggregator *vagg = GST_VIDEO_AGGREGATOR (agg);
|
||||||
GstClockTime output_start_time, output_end_time;
|
GstClockTime output_start_time, output_end_time;
|
||||||
GstBuffer *outbuf = NULL;
|
GstBuffer *outbuf = NULL;
|
||||||
gint res;
|
GstFlowReturn flow_ret;
|
||||||
gint64 jitter;
|
gint64 jitter;
|
||||||
|
|
||||||
GST_VIDEO_AGGREGATOR_LOCK (vagg);
|
GST_VIDEO_AGGREGATOR_LOCK (vagg);
|
||||||
|
|
||||||
if (GST_VIDEO_INFO_FORMAT (&vagg->info) == GST_VIDEO_FORMAT_UNKNOWN
|
if (GST_VIDEO_INFO_FORMAT (&vagg->info) == GST_VIDEO_FORMAT_UNKNOWN
|
||||||
|| gst_pad_check_reconfigure (agg->srcpad)) {
|
|| gst_pad_check_reconfigure (agg->srcpad)) {
|
||||||
|
gboolean ret;
|
||||||
|
|
||||||
ret = gst_videoaggregator_update_converters (vagg);
|
ret = gst_videoaggregator_update_converters (vagg);
|
||||||
if (ret)
|
if (ret)
|
||||||
ret = gst_videoaggregator_update_src_caps (vagg);
|
ret = gst_videoaggregator_update_src_caps (vagg);
|
||||||
|
@ -1351,33 +1352,31 @@ gst_videoaggregator_aggregate (GstAggregator * agg, gboolean timeout)
|
||||||
output_end_time = MIN (output_end_time, agg->segment.stop);
|
output_end_time = MIN (output_end_time, agg->segment.stop);
|
||||||
|
|
||||||
if (output_end_time == output_start_time) {
|
if (output_end_time == output_start_time) {
|
||||||
res = GST_FLOW_EOS;
|
flow_ret = GST_FLOW_EOS;
|
||||||
} else {
|
} else {
|
||||||
res =
|
flow_ret =
|
||||||
gst_videoaggregator_fill_queues (vagg, output_start_time,
|
gst_videoaggregator_fill_queues (vagg, output_start_time,
|
||||||
output_end_time);
|
output_end_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res == GST_FLOW_NEEDS_DATA && !timeout) {
|
if (flow_ret == GST_FLOW_NEEDS_DATA && !timeout) {
|
||||||
GST_DEBUG_OBJECT (vagg, "Need more data for decisions");
|
GST_DEBUG_OBJECT (vagg, "Need more data for decisions");
|
||||||
ret = GST_FLOW_OK;
|
flow_ret = GST_FLOW_OK;
|
||||||
goto done;
|
goto done;
|
||||||
} else if (res == GST_FLOW_EOS) {
|
} else if (flow_ret == GST_FLOW_EOS) {
|
||||||
GST_VIDEO_AGGREGATOR_UNLOCK (vagg);
|
GST_VIDEO_AGGREGATOR_UNLOCK (vagg);
|
||||||
GST_DEBUG_OBJECT (vagg, "All sinkpads are EOS -- forwarding");
|
GST_DEBUG_OBJECT (vagg, "All sinkpads are EOS -- forwarding");
|
||||||
ret = GST_FLOW_EOS;
|
|
||||||
goto done_unlocked;
|
goto done_unlocked;
|
||||||
} else if (res == GST_FLOW_ERROR) {
|
} else if (flow_ret == GST_FLOW_ERROR) {
|
||||||
GST_WARNING_OBJECT (vagg, "Error collecting buffers");
|
GST_WARNING_OBJECT (vagg, "Error collecting buffers");
|
||||||
ret = GST_FLOW_ERROR;
|
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
jitter = gst_videoaggregator_do_qos (vagg, output_start_time);
|
jitter = gst_videoaggregator_do_qos (vagg, output_start_time);
|
||||||
if (jitter <= 0) {
|
if (jitter <= 0) {
|
||||||
ret = gst_videoaggregator_do_aggregate (vagg, output_start_time,
|
flow_ret = gst_videoaggregator_do_aggregate (vagg, output_start_time,
|
||||||
output_end_time, &outbuf);
|
output_end_time, &outbuf);
|
||||||
if (ret != GST_FLOW_OK)
|
if (flow_ret != GST_FLOW_OK)
|
||||||
goto done;
|
goto done;
|
||||||
vagg->priv->qos_processed++;
|
vagg->priv->qos_processed++;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1397,7 +1396,7 @@ gst_videoaggregator_aggregate (GstAggregator * agg, gboolean timeout)
|
||||||
vagg->priv->qos_processed, vagg->priv->qos_dropped);
|
vagg->priv->qos_processed, vagg->priv->qos_dropped);
|
||||||
gst_element_post_message (GST_ELEMENT_CAST (vagg), msg);
|
gst_element_post_message (GST_ELEMENT_CAST (vagg), msg);
|
||||||
|
|
||||||
ret = GST_FLOW_OK;
|
flow_ret = GST_FLOW_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
agg->segment.position = output_end_time;
|
agg->segment.position = output_end_time;
|
||||||
|
@ -1410,7 +1409,7 @@ gst_videoaggregator_aggregate (GstAggregator * agg, gboolean timeout)
|
||||||
GST_TIME_FORMAT, GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (outbuf)),
|
GST_TIME_FORMAT, GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (outbuf)),
|
||||||
GST_TIME_ARGS (GST_BUFFER_DURATION (outbuf)));
|
GST_TIME_ARGS (GST_BUFFER_DURATION (outbuf)));
|
||||||
|
|
||||||
ret = gst_aggregator_finish_buffer (agg, outbuf);
|
flow_ret = gst_aggregator_finish_buffer (agg, outbuf);
|
||||||
}
|
}
|
||||||
goto done_unlocked;
|
goto done_unlocked;
|
||||||
|
|
||||||
|
@ -1420,7 +1419,7 @@ done:
|
||||||
GST_VIDEO_AGGREGATOR_UNLOCK (vagg);
|
GST_VIDEO_AGGREGATOR_UNLOCK (vagg);
|
||||||
|
|
||||||
done_unlocked:
|
done_unlocked:
|
||||||
return ret;
|
return flow_ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME, the duration query should reflect how long you will produce
|
/* FIXME, the duration query should reflect how long you will produce
|
||||||
|
|
Loading…
Reference in a new issue