looking for clarity on pipeline latency
Nicolas Dufresne
nicolas at ndufresne.ca
Wed Sep 16 11:37:39 UTC 2020
Hi Jim,
See answers below.
Le mar. 15 sept. 2020 17 h 30, jim nualart <jim at austinmodern.com> a écrit :
> Hi All,
>
> I'm hoping someone can chime in here with a little bit of explanation, as
> I think I have gotten myself somewhat confused on this topic.
>
> I've read the following:
> (from here,
> https://gstreamer.freedesktop.org/documentation/application-development/advanced/clocks.html#latency-compensation
> )
> Before the pipeline goes to the PLAYING state, it will, in addition to
> selecting a clock and calculating a base-time, calculate the latency in the
> pipeline. It does this by doing a LATENCY query on all the sinks in the
> pipeline. The pipeline then selects the maximum latency in the pipeline and
> configures this with a LATENCY event.
>
> So this is "automatic" and the application itself does not need to be
> involved at this point ... correct so far?
>
> Now, what if I want to know what the latency value is (of what was
> configured automatically by the pipeline)?
> Can I use gst_pipeline_get_latency()?
> Am I correct that this function would return the currently *configured*
> pipeline latency?
> Or should I use a query with gst_query_new_latency()?
> Though, I think this function would get me the current *actual* latency
> (vs what is configured), right?
>
The latency query will give you the reported latency. Running that query on
different sink element (that query is executed sink to source) usually
gives different values. By default, GstPipeline will select the maximum.
The applied latency is reported through an event. By default the same event
is sent to all sinks, but special application may use different values.
This is why reading the applied latency is not so straight forward.
> Finally, if I want to change the latency value, is that done
> via gst_pipeline_set_latency() or gst_query_set_latency() ?
>
The first once will force a global latency to the specified latency. It is
controlled by applications indeed.
The second is used by elements, when contributing to the latency query.
This a "plugin" API.
You can also use the latency tracer to get a log of per element reported
latency.
GST_TRACERS="latency(flags=reported)" GST_DEBUG=GST_TRACER:7 ...
> Much thanks in advance,
> -jim
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20200916/8ba848b4/attachment.htm>
More information about the gstreamer-devel
mailing list