gstclock.sgml 6.68 KB
Newer Older
1
2
3
4
<!-- ##### SECTION Title ##### -->
GstClock

<!-- ##### SECTION Short_Description ##### -->
Wim Taymans's avatar
Wim Taymans committed
5
Abstract class for global clocks
6
7
8

<!-- ##### SECTION Long_Description ##### -->
<para>
Wim Taymans's avatar
Wim Taymans committed
9
10
11
12
13
14
15
16
GStreamer uses a global clock to synchronise the plugins in a pipeline.
Different clock implementations are possible by implementing this abstract
base class.
</para>
<para>
The clock time is always measured in nanoseconds, with the clock being set
to 0 when the pipeline goes to READY. Usually all renderers sync to the global
clock so that the clock is always a good measure of the time in the pipeline.
17
18
19
20
</para>

<!-- ##### SECTION See_Also ##### -->
<para>
Wim Taymans's avatar
Wim Taymans committed
21
#GstSystemClock
22
23
24
25
</para>

<!-- ##### TYPEDEF GstClockTime ##### -->
<para>
Wim Taymans's avatar
Wim Taymans committed
26
A datatype to hold a time, measured in nanoseconds.
27
28
29
30
31
</para>


<!-- ##### TYPEDEF GstClockTimeDiff ##### -->
<para>
Wim Taymans's avatar
Wim Taymans committed
32
A datatype to hold a timedifference, measured in nanoseconds.
Wim Taymans's avatar
Wim Taymans committed
33
34
35
36
37
38
39
40
</para>


<!-- ##### TYPEDEF GstClockID ##### -->
<para>
A detatype to hold the handle to an outstanding async clock callback
</para>

41

Wim Taymans's avatar
Wim Taymans committed
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!-- ##### MACRO GST_CLOCK_TIME_NONE ##### -->
<para>
Constant to define an undefined clock time
</para>



<!-- ##### MACRO GST_SECOND ##### -->
<para>
Constant that defines one GStreamer second
</para>



<!-- ##### MACRO GST_MSECOND ##### -->
<para>
Constant that defines one GStreamer millisecond
</para>



<!-- ##### MACRO GST_USECOND ##### -->
<para>
Constant that defines one GStreamer microsecond
</para>



<!-- ##### MACRO GST_NSECOND ##### -->
<para>
Constant that defines one GStreamer nanosecond
</para>



77
78
<!-- ##### MACRO GST_CLOCK_DIFF ##### -->
<para>
Wim Taymans's avatar
Wim Taymans committed
79
Calculate a difference between to clock times.
80
81
</para>

Wim Taymans's avatar
Wim Taymans committed
82
83
84
85
86
87
88
89
90
91
@s: the first time
@e: the second time


<!-- ##### MACRO GST_TIMEVAL_TO_TIME ##### -->
<para>
Convert a GTimeVal to a GstClockTime
</para>

@tv: the timeval to convert
92
93


Wim Taymans's avatar
Wim Taymans committed
94
95
96
97
98
99
100
101
102
<!-- ##### MACRO GST_TIME_TO_TIMEVAL ##### -->
<para>
Convert a GstClockTime to a GTimeVal
</para>

@t: The GstClockTime to convert
@tv: The target timeval


Wim Taymans's avatar
Wim Taymans committed
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<!-- ##### STRUCT GstClockEntry ##### -->
<para>
All pending timeouts or periodic notifies are converted into
an entry.
</para>

@clock: 
@type: 
@time: 
@interval: 
@status: 
@func: 
@user_data: 

<!-- ##### USER_FUNCTION GstClockCallback ##### -->
<para>
The function prototype of the callback.
</para>

@clock: The clock that triggered the callback
@time: The time it was triggered
@id: The id that expired
@user_data: user data passed in the async_wait call
@Returns: 


<!-- ##### ENUM GstClockEntryStatus ##### -->
<para>
The status of a clock timeout.
</para>

@GST_CLOCK_ENTRY_OK: timeout happened
@GST_CLOCK_ENTRY_EARLY: request for timout that has been passed
@GST_CLOCK_ENTRY_RESTART: need to restart the timeout request

<!-- ##### ENUM GstClockEntryType ##### -->
<para>
The type of the clock entry
</para>

@GST_CLOCK_ENTRY_SINGLE: a single shot timeout
@GST_CLOCK_ENTRY_PERIODIC: a periodic timeout request

Wim Taymans's avatar
Wim Taymans committed
146
147
148
149
150
151
152
<!-- ##### MACRO GST_CLOCK_ENTRY_TRACE_NAME ##### -->
<para>
The name used for tracing clock entry allocations.
</para>



Wim Taymans's avatar
Wim Taymans committed
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<!-- ##### MACRO GST_CLOCK_ENTRY ##### -->
<para>
Cast to a clock entry
</para>

@entry: the entry to cast


<!-- ##### MACRO GST_CLOCK_ENTRY_CLOCK ##### -->
<para>
Get the owner clock of the entry
</para>

@entry: the entry to query


<!-- ##### MACRO GST_CLOCK_ENTRY_TYPE ##### -->
<para>
Get the type of the clock entry
</para>

@entry: the entry to query


<!-- ##### MACRO GST_CLOCK_ENTRY_TIME ##### -->
<para>
Get the requested time of this entry
</para>

@entry: the entry to query


<!-- ##### MACRO GST_CLOCK_ENTRY_INTERVAL ##### -->
<para>
Get the interval of this periodic entry
</para>

@entry: the entry to query


<!-- ##### MACRO GST_CLOCK_ENTRY_STATUS ##### -->
<para>
The status of the entry
</para>

@entry: the entry to query


<!-- ##### ENUM GstClockReturn ##### -->
<para>
The return value of a clock operation.
</para>

@GST_CLOCK_STOPPED: The clock is stopped.
@GST_CLOCK_TIMEOUT: The operation timed out.
@GST_CLOCK_EARLY: The operation was scheduled too late.
@GST_CLOCK_ERROR: An error occured
@GST_CLOCK_UNSUPPORTED: Operation is not supported

<!-- ##### ENUM GstClockFlags ##### -->
<para>
The capabilities of this clock
</para>

@GST_CLOCK_FLAG_CAN_DO_SINGLE_SYNC: This clock can do a single sync timeut request
@GST_CLOCK_FLAG_CAN_DO_SINGLE_ASYNC: This clock can do a single async timeout request
@GST_CLOCK_FLAG_CAN_DO_PERIODIC_SYNC: This clock can do sync periodic timeout requests
@GST_CLOCK_FLAG_CAN_DO_PERIODIC_ASYNC: This clock can do async periodic timeout callbacks
@GST_CLOCK_FLAG_CAN_SET_RESOLUTION: The resolution of this clock can be changed
@GST_CLOCK_FLAG_CAN_SET_SPEED: The speed of this clock can be changed

<!-- ##### MACRO GST_CLOCK_FLAGS ##### -->
<para>
Get the clock flags
</para>

@clock: the clock to query


232
233
<!-- ##### STRUCT GstClock ##### -->
<para>
Wim Taymans's avatar
Wim Taymans committed
234
The GstClock object
Wim Taymans's avatar
Wim Taymans committed
235
236
237
</para>


Wim Taymans's avatar
Wim Taymans committed
238
<!-- ##### FUNCTION gst_clock_set_speed ##### -->
Wim Taymans's avatar
Wim Taymans committed
239
240
241
242
243
<para>

</para>

@clock: 
Wim Taymans's avatar
Wim Taymans committed
244
@speed: 
245
@Returns: 
Wim Taymans's avatar
Wim Taymans committed
246
247


Wim Taymans's avatar
Wim Taymans committed
248
<!-- ##### FUNCTION gst_clock_get_speed ##### -->
Wim Taymans's avatar
Wim Taymans committed
249
<para>
250
251
252

</para>

Wim Taymans's avatar
Wim Taymans committed
253
254
@clock: 
@Returns: 
Wim Taymans's avatar
Wim Taymans committed
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273


<!-- ##### FUNCTION gst_clock_set_resolution ##### -->
<para>

</para>

@clock: 
@resolution: 
@Returns: 


<!-- ##### FUNCTION gst_clock_get_resolution ##### -->
<para>

</para>

@clock: 
@Returns: 
Wim Taymans's avatar
Wim Taymans committed
274

275

Wim Taymans's avatar
Wim Taymans committed
276
<!-- ##### FUNCTION gst_clock_set_active ##### -->
277
278
279
280
<para>

</para>

Wim Taymans's avatar
Wim Taymans committed
281
@clock: 
Wim Taymans's avatar
Wim Taymans committed
282
@active: 
283
284


Wim Taymans's avatar
Wim Taymans committed
285
<!-- ##### FUNCTION gst_clock_is_active ##### -->
286
287
288
289
<para>

</para>

Wim Taymans's avatar
Wim Taymans committed
290
@clock: 
291
292
293
@Returns: 


Wim Taymans's avatar
Wim Taymans committed
294
<!-- ##### FUNCTION gst_clock_reset ##### -->
295
296
297
298
299
300
301
<para>

</para>

@clock: 


Wim Taymans's avatar
Wim Taymans committed
302
<!-- ##### FUNCTION gst_clock_handle_discont ##### -->
303
304
305
306
307
<para>

</para>

@clock: 
Wim Taymans's avatar
Wim Taymans committed
308
@time: 
Wim Taymans's avatar
Wim Taymans committed
309
@Returns: 
310
311


Wim Taymans's avatar
Wim Taymans committed
312
313
314
315
316
317
318
319
320
<!-- ##### FUNCTION gst_clock_get_time ##### -->
<para>

</para>

@clock: 
@Returns: 


Wim Taymans's avatar
Wim Taymans committed
321
<!-- ##### FUNCTION gst_clock_get_next_id ##### -->
Wim Taymans's avatar
Wim Taymans committed
322
<para>
323

Wim Taymans's avatar
Wim Taymans committed
324
325
326
</para>

@clock: 
Wim Taymans's avatar
Wim Taymans committed
327
@Returns: 
Wim Taymans's avatar
Wim Taymans committed
328
329


Wim Taymans's avatar
Wim Taymans committed
330
<!-- ##### FUNCTION gst_clock_new_single_shot_id ##### -->
Wim Taymans's avatar
Wim Taymans committed
331
332
333
334
335
<para>

</para>

@clock: 
Wim Taymans's avatar
Wim Taymans committed
336
337
338
339
340
341
342
343
344
345
346
347
@time: 
@Returns: 


<!-- ##### FUNCTION gst_clock_new_periodic_id ##### -->
<para>

</para>

@clock: 
@start_time: 
@interval: 
Wim Taymans's avatar
Wim Taymans committed
348
349
350
@Returns: 


Wim Taymans's avatar
Wim Taymans committed
351
<!-- ##### FUNCTION gst_clock_id_get_time ##### -->
Wim Taymans's avatar
Wim Taymans committed
352
353
354
<para>

</para>
355

Wim Taymans's avatar
Wim Taymans committed
356
357
@id: 
@Returns: 
Wim Taymans's avatar
Wim Taymans committed
358
359


Wim Taymans's avatar
Wim Taymans committed
360
<!-- ##### FUNCTION gst_clock_id_wait ##### -->
361
362
363
364
<para>

</para>

Wim Taymans's avatar
Wim Taymans committed
365
366
@id: 
@jitter: 
367
368
369
@Returns: 


Wim Taymans's avatar
Wim Taymans committed
370
<!-- ##### FUNCTION gst_clock_id_wait_async ##### -->
Wim Taymans's avatar
Wim Taymans committed
371
372
373
374
<para>

</para>

Wim Taymans's avatar
Wim Taymans committed
375
376
377
@id: 
@func: 
@user_data: 
378
@Returns: 
Wim Taymans's avatar
Wim Taymans committed
379
380


Wim Taymans's avatar
Wim Taymans committed
381
<!-- ##### FUNCTION gst_clock_id_unschedule ##### -->
382
383
384
385
<para>

</para>

Wim Taymans's avatar
Wim Taymans committed
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
@id: 


<!-- ##### FUNCTION gst_clock_id_unlock ##### -->
<para>

</para>

@id: 


<!-- ##### FUNCTION gst_clock_id_free ##### -->
<para>

</para>

@id: 


405
406
407
408
409
<!-- ##### ARG GstClock:event-diff ##### -->
<para>

</para>

410
411
412
413
414
415
416
417
418
419
<!-- ##### ARG GstClock:max-diff ##### -->
<para>
Maximum allowed diff for clock sync requests against the real time.
</para>

<!-- ##### ARG GstClock:stats ##### -->
<para>
Boolean property to activate stat generation on the clock.
</para>