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_SECOND ##### -->
51 Constant that defines one GStreamer second
56 <!-- ##### MACRO GST_MSECOND ##### -->
58 Constant that defines one GStreamer millisecond
63 <!-- ##### MACRO GST_USECOND ##### -->
65 Constant that defines one GStreamer microsecond
70 <!-- ##### MACRO GST_NSECOND ##### -->
72 Constant that defines one GStreamer nanosecond
77 <!-- ##### MACRO GST_CLOCK_DIFF ##### -->
79 Calculate a difference between to clock times.
86 <!-- ##### MACRO GST_TIMEVAL_TO_TIME ##### -->
88 Convert a GTimeVal to a GstClockTime
91 @tv: the timeval to convert
94 <!-- ##### MACRO GST_TIME_TO_TIMEVAL ##### -->
96 Convert a GstClockTime to a GTimeVal
99 @t: The GstClockTime to convert
100 @tv: The target timeval
103 <!-- ##### STRUCT GstClockEntry ##### -->
105 All pending timeouts or periodic notifies are converted into
117 <!-- ##### USER_FUNCTION GstClockCallback ##### -->
119 The function prototype of the callback.
122 @clock: The clock that triggered the callback
123 @time: The time it was triggered
124 @id: The id that expired
125 @user_data: user data passed in the async_wait call
129 <!-- ##### ENUM GstClockEntryStatus ##### -->
131 The status of a clock timeout.
134 @GST_CLOCK_ENTRY_OK: timeout happened
135 @GST_CLOCK_ENTRY_EARLY: request for timout that has been passed
136 @GST_CLOCK_ENTRY_RESTART: need to restart the timeout request
138 <!-- ##### ENUM GstClockEntryType ##### -->
140 The type of the clock entry
143 @GST_CLOCK_ENTRY_SINGLE: a single shot timeout
144 @GST_CLOCK_ENTRY_PERIODIC: a periodic timeout request
146 <!-- ##### MACRO GST_CLOCK_ENTRY_TRACE_NAME ##### -->
148 The name used for tracing clock entry allocations.
153 <!-- ##### MACRO GST_CLOCK_ENTRY ##### -->
155 Cast to a clock entry
158 @entry: the entry to cast
161 <!-- ##### MACRO GST_CLOCK_ENTRY_CLOCK ##### -->
163 Get the owner clock of the entry
166 @entry: the entry to query
169 <!-- ##### MACRO GST_CLOCK_ENTRY_TYPE ##### -->
171 Get the type of the clock entry
174 @entry: the entry to query
177 <!-- ##### MACRO GST_CLOCK_ENTRY_TIME ##### -->
179 Get the requested time of this entry
182 @entry: the entry to query
185 <!-- ##### MACRO GST_CLOCK_ENTRY_INTERVAL ##### -->
187 Get the interval of this periodic entry
190 @entry: the entry to query
193 <!-- ##### MACRO GST_CLOCK_ENTRY_STATUS ##### -->
195 The status of the entry
198 @entry: the entry to query
201 <!-- ##### ENUM GstClockReturn ##### -->
203 The return value of a clock operation.
206 @GST_CLOCK_STOPPED: The clock is stopped.
207 @GST_CLOCK_TIMEOUT: The operation timed out.
208 @GST_CLOCK_EARLY: The operation was scheduled too late.
209 @GST_CLOCK_ERROR: An error occured
210 @GST_CLOCK_UNSUPPORTED: Operation is not supported
212 <!-- ##### ENUM GstClockFlags ##### -->
214 The capabilities of this clock
217 @GST_CLOCK_FLAG_CAN_DO_SINGLE_SYNC: This clock can do a single sync timeut request
218 @GST_CLOCK_FLAG_CAN_DO_SINGLE_ASYNC: This clock can do a single async timeout request
219 @GST_CLOCK_FLAG_CAN_DO_PERIODIC_SYNC: This clock can do sync periodic timeout requests
220 @GST_CLOCK_FLAG_CAN_DO_PERIODIC_ASYNC: This clock can do async periodic timeout callbacks
221 @GST_CLOCK_FLAG_CAN_SET_RESOLUTION: The resolution of this clock can be changed
222 @GST_CLOCK_FLAG_CAN_SET_SPEED: The speed of this clock can be changed
224 <!-- ##### MACRO GST_CLOCK_FLAGS ##### -->
229 @clock: the clock to query
232 <!-- ##### STRUCT GstClock ##### -->
238 <!-- ##### ARG GstClock:event-diff ##### -->
243 <!-- ##### ARG GstClock:max-diff ##### -->
245 Maximum allowed diff for clock sync requests against the real time.
248 <!-- ##### ARG GstClock:stats ##### -->
250 Boolean property to activate stat generation on the clock.
253 <!-- ##### FUNCTION gst_clock_set_speed ##### -->
263 <!-- ##### FUNCTION gst_clock_get_speed ##### -->
272 <!-- ##### FUNCTION gst_clock_set_resolution ##### -->
282 <!-- ##### FUNCTION gst_clock_get_resolution ##### -->
291 <!-- ##### FUNCTION gst_clock_set_active ##### -->
300 <!-- ##### FUNCTION gst_clock_is_active ##### -->
309 <!-- ##### FUNCTION gst_clock_reset ##### -->
317 <!-- ##### FUNCTION gst_clock_handle_discont ##### -->
327 <!-- ##### FUNCTION gst_clock_get_time ##### -->
336 <!-- ##### FUNCTION gst_clock_get_next_id ##### -->
345 <!-- ##### FUNCTION gst_clock_new_single_shot_id ##### -->
355 <!-- ##### FUNCTION gst_clock_new_periodic_id ##### -->
366 <!-- ##### FUNCTION gst_clock_id_get_time ##### -->
375 <!-- ##### FUNCTION gst_clock_id_wait ##### -->
385 <!-- ##### FUNCTION gst_clock_id_wait_async ##### -->
396 <!-- ##### FUNCTION gst_clock_id_unschedule ##### -->
404 <!-- ##### FUNCTION gst_clock_id_unlock ##### -->
412 <!-- ##### FUNCTION gst_clock_id_free ##### -->