Clocks in GStreamer
Each GstBin holds a GstClock instance.
Such an instance can be provided by e.g. GstSystemClock or by
an GstElement that is part of the GstBin.
Such a clock is like a stop-watch - it will be started when the bin starts to play
and will be stopped when the bin gets stopped. Once the clock runs, it can do nice
things like calling a callback you have registered at regular intervals.
The GstClock is still very much under construction.
The following code snipped demonstrates how to get the current clock of the bin
and how to show its capabillities:
GstClock *cur_clock;
GstElement *my_thread;
...
cur_clock=gst_bin_get_clock(GST_BIN (my_thread));
if(cur_clock) {
g_printf("current clock can do : 0x%x\n",GST_CLOCK_FLAGS(cur_clock));
}
If the clock does not suit your needs, you need to obtain a instance and set this
as the active clock of the bin.