1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 Abstract class for global clocks
7 <!-- ##### SECTION Long_Description ##### -->
9 GStreamer uses a global clock to synchronise the plugins in a pipeline.
10 Different clock implementations are possible by implementing this abstract
14 The clock time is always measured in nanoseconds, with the clock being set
15 to 0 when the pipeline goes to READY. Usually all renderers sync to the global
16 clock so that the clock is always a good measure of the time in the pipeline.
19 <!-- ##### SECTION See_Also ##### -->
24 <!-- ##### TYPEDEF GstClockTime ##### -->
26 A datatype to hold a time, measured in nanoseconds.
30 <!-- ##### TYPEDEF GstClockTimeDiff ##### -->
32 A datatype to hold a timedifference, measured in nanoseconds.
36 <!-- ##### TYPEDEF GstClockID ##### -->
38 A detatype to hold the handle to an outstanding async clock callback
42 <!-- ##### MACRO GST_CLOCK_TIME_NONE ##### -->
44 Constant to define an undefined clock time
49 <!-- ##### MACRO GST_CLOCK_TIME_IS_VALID ##### -->
57 <!-- ##### MACRO GST_SECOND ##### -->
59 Constant that defines one GStreamer second
64 <!-- ##### MACRO GST_MSECOND ##### -->
66 Constant that defines one GStreamer millisecond
71 <!-- ##### MACRO GST_USECOND ##### -->
73 Constant that defines one GStreamer microsecond
78 <!-- ##### MACRO GST_NSECOND ##### -->
80 Constant that defines one GStreamer nanosecond
85 <!-- ##### MACRO GST_CLOCK_DIFF ##### -->
87 Calculate a difference between to clock times.
94 <!-- ##### MACRO GST_TIMEVAL_TO_TIME ##### -->
96 Convert a GTimeVal to a GstClockTime
99 @tv: the timeval to convert
102 <!-- ##### MACRO GST_TIME_TO_TIMEVAL ##### -->
104 Convert a GstClockTime to a GTimeVal
107 @t: The GstClockTime to convert
108 @tv: The target timeval
111 <!-- ##### MACRO GST_CLOCK_ENTRY_TRACE_NAME ##### -->
113 The name used for tracing clock entry allocations.
118 <!-- ##### STRUCT GstClockEntry ##### -->
120 All pending timeouts or periodic notifies are converted into
132 <!-- ##### USER_FUNCTION GstClockCallback ##### -->
134 The function prototype of the callback.
137 @clock: The clock that triggered the callback
138 @time: The time it was triggered
139 @id: The id that expired
140 @user_data: user data passed in the async_wait call
144 <!-- ##### ENUM GstClockEntryStatus ##### -->
146 The status of a clock timeout.
149 @GST_CLOCK_ENTRY_OK: timeout happened
150 @GST_CLOCK_ENTRY_EARLY: request for timout that has been passed
151 @GST_CLOCK_ENTRY_RESTART: need to restart the timeout request
153 <!-- ##### ENUM GstClockEntryType ##### -->
155 The type of the clock entry
158 @GST_CLOCK_ENTRY_SINGLE: a single shot timeout
159 @GST_CLOCK_ENTRY_PERIODIC: a periodic timeout request
161 <!-- ##### MACRO GST_CLOCK_ENTRY ##### -->
163 Cast to a clock entry
166 @entry: the entry to cast
169 <!-- ##### MACRO GST_CLOCK_ENTRY_CLOCK ##### -->
171 Get the owner clock of the entry
174 @entry: the entry to query
177 <!-- ##### MACRO GST_CLOCK_ENTRY_TYPE ##### -->
179 Get the type of the clock entry
182 @entry: the entry to query
185 <!-- ##### MACRO GST_CLOCK_ENTRY_TIME ##### -->
187 Get the requested time of this entry
190 @entry: the entry to query
193 <!-- ##### MACRO GST_CLOCK_ENTRY_INTERVAL ##### -->
195 Get the interval of this periodic entry
198 @entry: the entry to query
201 <!-- ##### MACRO GST_CLOCK_ENTRY_STATUS ##### -->
203 The status of the entry
206 @entry: the entry to query
209 <!-- ##### ENUM GstClockReturn ##### -->
211 The return value of a clock operation.
214 @GST_CLOCK_STOPPED: The clock is stopped.
215 @GST_CLOCK_TIMEOUT: The operation timed out.
216 @GST_CLOCK_EARLY: The operation was scheduled too late.
217 @GST_CLOCK_ERROR: An error occured
218 @GST_CLOCK_UNSUPPORTED: Operation is not supported
220 <!-- ##### ENUM GstClockFlags ##### -->
222 The capabilities of this clock
225 @GST_CLOCK_FLAG_CAN_DO_SINGLE_SYNC: This clock can do a single sync timeut request
226 @GST_CLOCK_FLAG_CAN_DO_SINGLE_ASYNC: This clock can do a single async timeout request
227 @GST_CLOCK_FLAG_CAN_DO_PERIODIC_SYNC: This clock can do sync periodic timeout requests
228 @GST_CLOCK_FLAG_CAN_DO_PERIODIC_ASYNC: This clock can do async periodic timeout callbacks
229 @GST_CLOCK_FLAG_CAN_SET_RESOLUTION: The resolution of this clock can be changed
230 @GST_CLOCK_FLAG_CAN_SET_SPEED: The speed of this clock can be changed
232 <!-- ##### MACRO GST_CLOCK_FLAGS ##### -->
237 @clock: the clock to query
240 <!-- ##### FUNCTION gst_clock_set_speed ##### -->
250 <!-- ##### FUNCTION gst_clock_get_speed ##### -->
259 <!-- ##### FUNCTION gst_clock_set_resolution ##### -->
269 <!-- ##### FUNCTION gst_clock_get_resolution ##### -->
278 <!-- ##### FUNCTION gst_clock_set_active ##### -->
287 <!-- ##### FUNCTION gst_clock_is_active ##### -->
296 <!-- ##### FUNCTION gst_clock_reset ##### -->
304 <!-- ##### FUNCTION gst_clock_handle_discont ##### -->
314 <!-- ##### FUNCTION gst_clock_get_time ##### -->
323 <!-- ##### FUNCTION gst_clock_get_event_time ##### -->
332 <!-- ##### FUNCTION gst_clock_get_next_id ##### -->
341 <!-- ##### FUNCTION gst_clock_new_single_shot_id ##### -->
351 <!-- ##### FUNCTION gst_clock_new_periodic_id ##### -->
362 <!-- ##### FUNCTION gst_clock_id_get_time ##### -->
371 <!-- ##### FUNCTION gst_clock_id_wait ##### -->
381 <!-- ##### FUNCTION gst_clock_id_wait_async ##### -->
392 <!-- ##### FUNCTION gst_clock_id_unschedule ##### -->
400 <!-- ##### FUNCTION gst_clock_id_unlock ##### -->
408 <!-- ##### FUNCTION gst_clock_id_free ##### -->
416 <!-- ##### ARG GstClock:event-diff ##### -->
421 <!-- ##### ARG GstClock:max-diff ##### -->
423 Maximum allowed diff for clock sync requests against the real time.
426 <!-- ##### ARG GstClock:stats ##### -->
428 Boolean property to activate stat generation on the clock.