latency-tracer: Exclude synchronization time
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Wed, 11 Oct 2017 15:08:12 +0000 (11:08 -0400)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Mon, 30 Oct 2017 19:33:15 +0000 (15:33 -0400)
commit41e35c334b8d53328d73fba4dc7fd433021fff4c
tree39a63f4cb08e41f5e8819602762e2aa155937ad4
parentc0c9a531efd3e40068037b7d8109ec8fbe6553a6
latency-tracer: Exclude synchronization time

The goal of this tracer is to measure the processing latency between a
src and a sink. In push mode, the time was read after the chain function
have returned. As the amount of time we wait to get synched is reverse
to the amount of latency the source introduced, the result was quite
surprising.

This patch moves the latency calculation in the pre-push hook. When
there is no processing in a a pipeline (e.g. fakesrc ! fakesink), the
latency will now be 0 as it's supposed to. For pull mode, the code was
already correct. When GstBaseSink operate in pull mode, the processing
time is done durring the pull, so pull-post is the right hook. The
synchronization will happen after the pull has ended. Note that
GstBaseSink rarely operate in pull mode.

https://bugzilla.gnome.org/show_bug.cgi?id=788431
plugins/tracers/gstlatency.c