a8ba95c7f08b6c559cc8fa4b4fc75388c483bcef
[platform/upstream/gstreamer.git] / docs / gst / tmpl / gstclock.sgml
1 <!-- ##### SECTION Title ##### -->
2 GstClock
3
4 <!-- ##### SECTION Short_Description ##### -->
5 Abstract class for global clocks
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
9 GStreamer uses a global clock to synchronise the plugins in a pipeline.
10 Different clock implementations are possible by implementing this abstract
11 base class.
12 </para>
13 <para>
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.
17 </para>
18
19 <!-- ##### SECTION See_Also ##### -->
20 <para>
21 #GstSystemClock
22 </para>
23
24 <!-- ##### TYPEDEF GstClockTime ##### -->
25 <para>
26 A datatype to hold a time, measured in nanoseconds.
27 </para>
28
29
30 <!-- ##### TYPEDEF GstClockTimeDiff ##### -->
31 <para>
32 A datatype to hold a timedifference, measured in nanoseconds.
33 </para>
34
35
36 <!-- ##### TYPEDEF GstClockID ##### -->
37 <para>
38 A detatype to hold the handle to an outstanding async clock callback
39 </para>
40
41
42 <!-- ##### MACRO GST_CLOCK_TIME_NONE ##### -->
43 <para>
44 Constant to define an undefined clock time
45 </para>
46
47
48
49 <!-- ##### MACRO GST_CLOCK_TIME_IS_VALID ##### -->
50 <para>
51
52 </para>
53
54 @time: 
55
56
57 <!-- ##### MACRO GST_SECOND ##### -->
58 <para>
59 Constant that defines one GStreamer second
60 </para>
61
62
63
64 <!-- ##### MACRO GST_MSECOND ##### -->
65 <para>
66 Constant that defines one GStreamer millisecond
67 </para>
68
69
70
71 <!-- ##### MACRO GST_USECOND ##### -->
72 <para>
73 Constant that defines one GStreamer microsecond
74 </para>
75
76
77
78 <!-- ##### MACRO GST_NSECOND ##### -->
79 <para>
80 Constant that defines one GStreamer nanosecond
81 </para>
82
83
84
85 <!-- ##### MACRO GST_CLOCK_DIFF ##### -->
86 <para>
87 Calculate a difference between to clock times.
88 </para>
89
90 @s: the first time
91 @e: the second time
92
93
94 <!-- ##### MACRO GST_TIMEVAL_TO_TIME ##### -->
95 <para>
96 Convert a GTimeVal to a GstClockTime
97 </para>
98
99 @tv: the timeval to convert
100
101
102 <!-- ##### MACRO GST_TIME_TO_TIMEVAL ##### -->
103 <para>
104 Convert a GstClockTime to a GTimeVal
105 </para>
106
107 @t: The GstClockTime to convert
108 @tv: The target timeval
109
110
111 <!-- ##### MACRO GST_CLOCK_ENTRY_TRACE_NAME ##### -->
112 <para>
113 The name used for tracing clock entry allocations.
114 </para>
115
116
117
118 <!-- ##### STRUCT GstClockEntry ##### -->
119 <para>
120 All pending timeouts or periodic notifies are converted into
121 an entry.
122 </para>
123
124 @clock: 
125 @type: 
126 @time: 
127 @interval: 
128 @status: 
129 @func: 
130 @user_data: 
131
132 <!-- ##### USER_FUNCTION GstClockCallback ##### -->
133 <para>
134 The function prototype of the callback.
135 </para>
136
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
141 @Returns: 
142
143
144 <!-- ##### ENUM GstClockEntryStatus ##### -->
145 <para>
146 The status of a clock timeout.
147 </para>
148
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
152
153 <!-- ##### ENUM GstClockEntryType ##### -->
154 <para>
155 The type of the clock entry
156 </para>
157
158 @GST_CLOCK_ENTRY_SINGLE: a single shot timeout
159 @GST_CLOCK_ENTRY_PERIODIC: a periodic timeout request
160
161 <!-- ##### MACRO GST_CLOCK_ENTRY ##### -->
162 <para>
163 Cast to a clock entry
164 </para>
165
166 @entry: the entry to cast
167
168
169 <!-- ##### MACRO GST_CLOCK_ENTRY_CLOCK ##### -->
170 <para>
171 Get the owner clock of the entry
172 </para>
173
174 @entry: the entry to query
175
176
177 <!-- ##### MACRO GST_CLOCK_ENTRY_TYPE ##### -->
178 <para>
179 Get the type of the clock entry
180 </para>
181
182 @entry: the entry to query
183
184
185 <!-- ##### MACRO GST_CLOCK_ENTRY_TIME ##### -->
186 <para>
187 Get the requested time of this entry
188 </para>
189
190 @entry: the entry to query
191
192
193 <!-- ##### MACRO GST_CLOCK_ENTRY_INTERVAL ##### -->
194 <para>
195 Get the interval of this periodic entry
196 </para>
197
198 @entry: the entry to query
199
200
201 <!-- ##### MACRO GST_CLOCK_ENTRY_STATUS ##### -->
202 <para>
203 The status of the entry
204 </para>
205
206 @entry: the entry to query
207
208
209 <!-- ##### ENUM GstClockReturn ##### -->
210 <para>
211 The return value of a clock operation.
212 </para>
213
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
219
220 <!-- ##### ENUM GstClockFlags ##### -->
221 <para>
222 The capabilities of this clock
223 </para>
224
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
231
232 <!-- ##### MACRO GST_CLOCK_FLAGS ##### -->
233 <para>
234 Get the clock flags
235 </para>
236
237 @clock: the clock to query
238
239
240 <!-- ##### FUNCTION gst_clock_set_speed ##### -->
241 <para>
242
243 </para>
244
245 @clock: 
246 @speed: 
247 @Returns: 
248
249
250 <!-- ##### FUNCTION gst_clock_get_speed ##### -->
251 <para>
252
253 </para>
254
255 @clock: 
256 @Returns: 
257
258
259 <!-- ##### FUNCTION gst_clock_set_resolution ##### -->
260 <para>
261
262 </para>
263
264 @clock: 
265 @resolution: 
266 @Returns: 
267
268
269 <!-- ##### FUNCTION gst_clock_get_resolution ##### -->
270 <para>
271
272 </para>
273
274 @clock: 
275 @Returns: 
276
277
278 <!-- ##### FUNCTION gst_clock_set_active ##### -->
279 <para>
280
281 </para>
282
283 @clock: 
284 @active: 
285
286
287 <!-- ##### FUNCTION gst_clock_is_active ##### -->
288 <para>
289
290 </para>
291
292 @clock: 
293 @Returns: 
294
295
296 <!-- ##### FUNCTION gst_clock_reset ##### -->
297 <para>
298
299 </para>
300
301 @clock: 
302
303
304 <!-- ##### FUNCTION gst_clock_handle_discont ##### -->
305 <para>
306
307 </para>
308
309 @clock: 
310 @time: 
311 @Returns: 
312
313
314 <!-- ##### FUNCTION gst_clock_get_time ##### -->
315 <para>
316
317 </para>
318
319 @clock: 
320 @Returns: 
321
322
323 <!-- ##### FUNCTION gst_clock_get_event_time ##### -->
324 <para>
325
326 </para>
327
328 @clock: 
329 @Returns: 
330
331
332 <!-- ##### FUNCTION gst_clock_get_next_id ##### -->
333 <para>
334
335 </para>
336
337 @clock: 
338 @Returns: 
339
340
341 <!-- ##### FUNCTION gst_clock_new_single_shot_id ##### -->
342 <para>
343
344 </para>
345
346 @clock: 
347 @time: 
348 @Returns: 
349
350
351 <!-- ##### FUNCTION gst_clock_new_periodic_id ##### -->
352 <para>
353
354 </para>
355
356 @clock: 
357 @start_time: 
358 @interval: 
359 @Returns: 
360
361
362 <!-- ##### FUNCTION gst_clock_id_get_time ##### -->
363 <para>
364
365 </para>
366
367 @id: 
368 @Returns: 
369
370
371 <!-- ##### FUNCTION gst_clock_id_wait ##### -->
372 <para>
373
374 </para>
375
376 @id: 
377 @jitter: 
378 @Returns: 
379
380
381 <!-- ##### FUNCTION gst_clock_id_wait_async ##### -->
382 <para>
383
384 </para>
385
386 @id: 
387 @func: 
388 @user_data: 
389 @Returns: 
390
391
392 <!-- ##### FUNCTION gst_clock_id_unschedule ##### -->
393 <para>
394
395 </para>
396
397 @id: 
398
399
400 <!-- ##### FUNCTION gst_clock_id_unlock ##### -->
401 <para>
402
403 </para>
404
405 @id: 
406
407
408 <!-- ##### FUNCTION gst_clock_id_free ##### -->
409 <para>
410
411 </para>
412
413 @id: 
414
415
416 <!-- ##### ARG GstClock:event-diff ##### -->
417 <para>
418
419 </para>
420
421 <!-- ##### ARG GstClock:max-diff ##### -->
422 <para>
423 Maximum allowed diff for clock sync requests against the real time.
424 </para>
425
426 <!-- ##### ARG GstClock:stats ##### -->
427 <para>
428 Boolean property to activate stat generation on the clock.
429 </para>
430