From 4f3adad607aa270fb63a93dff5672505b5d2403e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 15 Jun 2015 14:18:39 +0200 Subject: [PATCH] videoaggregator: Remember if the last LATENCY query returned live or not and use the in the QoS messages --- gst-libs/gst/video/gstvideoaggregator.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/video/gstvideoaggregator.c b/gst-libs/gst/video/gstvideoaggregator.c index 471b854196..baacdb5dfe 100644 --- a/gst-libs/gst/video/gstvideoaggregator.c +++ b/gst-libs/gst/video/gstvideoaggregator.c @@ -425,6 +425,8 @@ struct _GstVideoAggregatorPrivate /* current caps */ GstCaps *current_caps; + + gboolean live; }; G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstVideoAggregator, gst_videoaggregator, @@ -945,6 +947,7 @@ gst_videoaggregator_reset (GstVideoAggregator * vagg) gst_video_info_init (&vagg->info); vagg->priv->ts_offset = 0; vagg->priv->nframes = 0; + vagg->priv->live = FALSE; agg->segment.position = -1; @@ -1417,9 +1420,8 @@ gst_videoaggregator_aggregate (GstAggregator * agg, gboolean timeout) vagg->priv->qos_dropped++; - /* TODO: live */ msg = - gst_message_new_qos (GST_OBJECT_CAST (vagg), FALSE, + gst_message_new_qos (GST_OBJECT_CAST (vagg), vagg->priv->live, gst_segment_to_running_time (&agg->segment, GST_FORMAT_TIME, output_start_time), gst_segment_to_stream_time (&agg->segment, GST_FORMAT_TIME, output_start_time), output_start_time, @@ -1569,6 +1571,15 @@ gst_videoaggregator_src_query (GstAggregator * agg, GstQuery * query) case GST_QUERY_DURATION: res = gst_videoaggregator_query_duration (vagg, query); break; + case GST_QUERY_LATENCY: + res = + GST_AGGREGATOR_CLASS (gst_videoaggregator_parent_class)->src_query + (agg, query); + + if (res) { + gst_query_parse_latency (query, &vagg->priv->live, NULL, NULL); + } + break; default: res = GST_AGGREGATOR_CLASS (gst_videoaggregator_parent_class)->src_query