Chapter 18. Clocking

Table of Contents

Clock running-time
Buffer running-time
Obligations of each element.
Non-live source elements
Live source elements
Parser/Decoder/Encoder elements
Demuxer elements
Muxer elements
Sink elements

When playing complex media, each sound and video sample must be played in a specific order at a specific time. For this purpose, GStreamer provides a synchronization mechanism.


Time in GStreamer is defined as the value returned from a particular GstClock object from the method gst_clock_get_time ().

In a typical computer, there are many sources that can be used as a time source, e.g., the system time, soundcards, CPU performance counters, ... For this reason, there are many GstClock implementations available in GStreamer. The clock time doesn't always start from 0 or from some known value. Some clocks start counting from some known start date, other clocks start counting since last reboot, etc...

As clocks return an absolute measure of time, they are not usually used directly. Instead, differences between two clock times are used to measure elapsed time according to a clock.