From: Arun Raghavan Date: Thu, 26 Feb 2015 19:06:43 +0000 (+0530) Subject: adder: Drop custom latency querying logic X-Git-Tag: 1.19.3~511^2~3843 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dfdbc1c37914bb1bea8878e5d77b39292fe578b4;p=platform%2Fupstream%2Fgstreamer.git adder: Drop custom latency querying logic The default latency query handler now implements the same logic already. --- diff --git a/gst/adder/gstadder.c b/gst/adder/gstadder.c index 92f2b985d1..094b25ee29 100644 --- a/gst/adder/gstadder.c +++ b/gst/adder/gstadder.c @@ -484,93 +484,6 @@ gst_adder_query_duration (GstAdder * adder, GstQuery * query) return res; } -static gboolean -gst_adder_query_latency (GstAdder * adder, GstQuery * query) -{ - GstClockTime min, max; - gboolean live; - gboolean res; - GstIterator *it; - gboolean done; - GValue item = { 0, }; - - res = TRUE; - done = FALSE; - - live = FALSE; - min = 0; - max = GST_CLOCK_TIME_NONE; - - /* Take maximum of all latency values */ - it = gst_element_iterate_sink_pads (GST_ELEMENT_CAST (adder)); - while (!done) { - GstIteratorResult ires; - - ires = gst_iterator_next (it, &item); - switch (ires) { - case GST_ITERATOR_DONE: - done = TRUE; - break; - case GST_ITERATOR_OK: - { - GstPad *pad = g_value_get_object (&item); - GstQuery *peerquery; - GstClockTime min_cur, max_cur; - gboolean live_cur; - - peerquery = gst_query_new_latency (); - - /* Ask peer for latency */ - res &= gst_pad_peer_query (pad, peerquery); - - /* take max from all valid return values */ - if (res) { - gst_query_parse_latency (peerquery, &live_cur, &min_cur, &max_cur); - - if (live_cur) { - if (min_cur > min) - min = min_cur; - - if (max == GST_CLOCK_TIME_NONE) - max = max_cur; - else if (max_cur < max) - max = max_cur; - - live = TRUE; - } - } - - gst_query_unref (peerquery); - g_value_reset (&item); - break; - } - case GST_ITERATOR_RESYNC: - live = FALSE; - min = 0; - max = GST_CLOCK_TIME_NONE; - res = TRUE; - gst_iterator_resync (it); - break; - default: - res = FALSE; - done = TRUE; - break; - } - } - g_value_unset (&item); - gst_iterator_free (it); - - if (res) { - /* store the results */ - GST_DEBUG_OBJECT (adder, "Calculated total latency: live %s, min %" - GST_TIME_FORMAT ", max %" GST_TIME_FORMAT, - (live ? "yes" : "no"), GST_TIME_ARGS (min), GST_TIME_ARGS (max)); - gst_query_set_latency (query, live, min, max); - } - - return res; -} - static gboolean gst_adder_src_query (GstPad * pad, GstObject * parent, GstQuery * query) { @@ -602,9 +515,6 @@ gst_adder_src_query (GstPad * pad, GstObject * parent, GstQuery * query) case GST_QUERY_DURATION: res = gst_adder_query_duration (adder, query); break; - case GST_QUERY_LATENCY: - res = gst_adder_query_latency (adder, query); - break; default: /* FIXME, needs a custom query handler because we have multiple * sinkpads */