From 075cfd8d7b2d0334f9c3da1b4f4fce1e6db6ed53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 19 Feb 2015 10:57:09 +0200 Subject: [PATCH] aggregator: Move gst_aggregator_get_latency_unlocked() a bit It was between another function and its helper function before, which was confusing when reading the code as it had nothing to do with the other functions. --- libs/gst/base/gstaggregator.c | 86 +++++++++++++++++------------------ 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/libs/gst/base/gstaggregator.c b/libs/gst/base/gstaggregator.c index 3ae43dc779..444ddf4cfb 100644 --- a/libs/gst/base/gstaggregator.c +++ b/libs/gst/base/gstaggregator.c @@ -1159,49 +1159,6 @@ gst_aggregator_query_sink_latency_foreach (GstAggregator * self, return TRUE; } -/** - * gst_aggregator_get_latency_unlocked: - * @self: a #GstAggregator - * @live: (out) (allow-none): whether @self is live - * @min_latency: (out) (allow-none): the configured minimum latency of @self - * @max_latency: (out) (allow-none): the configured maximum latency of @self - * - * Retreives the latency values reported by @self in response to the latency - * query. - * - * Typically only called by subclasses. - * - * MUST be called with the object lock held. - */ -void -gst_aggregator_get_latency_unlocked (GstAggregator * self, gboolean * live, - GstClockTime * min_latency, GstClockTime * max_latency) -{ - GstClockTime min, max; - - g_return_if_fail (GST_IS_AGGREGATOR (self)); - - /* latency_min is never GST_CLOCK_TIME_NONE by construction */ - min = self->priv->latency_min; - max = self->priv->latency_max; - - /* add our own */ - min += self->priv->latency; - min += self->priv->sub_latency_min; - if (GST_CLOCK_TIME_IS_VALID (max) - && GST_CLOCK_TIME_IS_VALID (self->priv->sub_latency_max)) - max += self->priv->sub_latency_max; - else - max = GST_CLOCK_TIME_NONE; - - if (live) - *live = self->priv->latency_live; - if (min_latency) - *min_latency = min; - if (max_latency) - *max_latency = max; -} - static gboolean gst_aggregator_query_latency (GstAggregator * self, GstQuery * query) { @@ -1270,6 +1227,49 @@ gst_aggregator_query_latency (GstAggregator * self, GstQuery * query) return data.res; } +/** + * gst_aggregator_get_latency_unlocked: + * @self: a #GstAggregator + * @live: (out) (allow-none): whether @self is live + * @min_latency: (out) (allow-none): the configured minimum latency of @self + * @max_latency: (out) (allow-none): the configured maximum latency of @self + * + * Retreives the latency values reported by @self in response to the latency + * query. + * + * Typically only called by subclasses. + * + * MUST be called with the object lock held. + */ +void +gst_aggregator_get_latency_unlocked (GstAggregator * self, gboolean * live, + GstClockTime * min_latency, GstClockTime * max_latency) +{ + GstClockTime min, max; + + g_return_if_fail (GST_IS_AGGREGATOR (self)); + + /* latency_min is never GST_CLOCK_TIME_NONE by construction */ + min = self->priv->latency_min; + max = self->priv->latency_max; + + /* add our own */ + min += self->priv->latency; + min += self->priv->sub_latency_min; + if (GST_CLOCK_TIME_IS_VALID (max) + && GST_CLOCK_TIME_IS_VALID (self->priv->sub_latency_max)) + max += self->priv->sub_latency_max; + else + max = GST_CLOCK_TIME_NONE; + + if (live) + *live = self->priv->latency_live; + if (min_latency) + *min_latency = min; + if (max_latency) + *max_latency = max; +} + static gboolean gst_aggregator_send_event (GstElement * element, GstEvent * event) {