mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
aggregator: add _get_latency() for subclass usage
API: gst_aggregator_get_latency https://bugzilla.gnome.org/show_bug.cgi?id=739996
This commit is contained in:
parent
aafc0d509c
commit
051955e5fa
3 changed files with 43 additions and 0 deletions
|
@ -1303,6 +1303,7 @@ GstAggregatorClass
|
|||
gst_aggregator_finish_buffer
|
||||
gst_aggregator_set_src_caps
|
||||
gst_aggregator_iterate_sinkpads
|
||||
gst_aggregator_get_latency
|
||||
<SUBSECTION Standard>
|
||||
GST_IS_AGGREGATOR
|
||||
GST_IS_AGGREGATOR_CLASS
|
||||
|
|
|
@ -947,6 +947,44 @@ _latency_query (GstAggregator * self, GstPad * pad, gpointer user_data)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_aggregator_get_latency:
|
||||
* @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.
|
||||
*/
|
||||
void
|
||||
gst_aggregator_get_latency (GstAggregator * self, gboolean * live,
|
||||
GstClockTime * min_latency, GstClockTime * max_latency)
|
||||
{
|
||||
GstClockTime min, max;
|
||||
|
||||
g_return_if_fail (GST_IS_AGGREGATOR (self));
|
||||
|
||||
min = self->priv->latency_min;
|
||||
max = self->priv->latency_max;
|
||||
|
||||
if (GST_CLOCK_TIME_IS_VALID (self->timeout)) {
|
||||
if (GST_CLOCK_TIME_IS_VALID (min))
|
||||
min += self->timeout;
|
||||
if (GST_CLOCK_TIME_IS_VALID (max))
|
||||
max += self->timeout;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -261,6 +261,10 @@ gboolean gst_aggregator_iterate_sinkpads (GstAggregator
|
|||
GstAggregatorPadForeachFunc func,
|
||||
gpointer user_data);
|
||||
|
||||
void gst_aggregator_get_latency (GstAggregator * self,
|
||||
gboolean * live,
|
||||
GstClockTime * min,
|
||||
GstClockTime * max);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
Loading…
Reference in a new issue