gstclock.sgml 6.62 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>


Benjamin Otte's avatar
Benjamin Otte committed
238 239 240 241 242 243 244 245 246 247
<!-- ##### 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>

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

</para>

@clock: 
Wim Taymans's avatar
Wim Taymans committed
254
@speed: 
255
@Returns: 
Wim Taymans's avatar
Wim Taymans committed
256 257


Wim Taymans's avatar
Wim Taymans committed
258
<!-- ##### FUNCTION gst_clock_get_speed ##### -->
Wim Taymans's avatar
Wim Taymans committed
259
<para>
260 261 262

</para>

Wim Taymans's avatar
Wim Taymans committed
263 264
@clock: 
@Returns: 
Wim Taymans's avatar
Wim Taymans committed
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283


<!-- ##### 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
284

285

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

</para>

Wim Taymans's avatar
Wim Taymans committed
291
@clock: 
Wim Taymans's avatar
Wim Taymans committed
292
@active: 
293 294


Wim Taymans's avatar
Wim Taymans committed
295
<!-- ##### FUNCTION gst_clock_is_active ##### -->
296 297 298 299
<para>

</para>

Wim Taymans's avatar
Wim Taymans committed
300
@clock: 
301 302 303
@Returns: 


Wim Taymans's avatar
Wim Taymans committed
304
<!-- ##### FUNCTION gst_clock_reset ##### -->
305 306 307 308 309 310 311
<para>

</para>

@clock: 


Wim Taymans's avatar
Wim Taymans committed
312
<!-- ##### FUNCTION gst_clock_handle_discont ##### -->
313 314 315 316 317
<para>

</para>

@clock: 
Wim Taymans's avatar
Wim Taymans committed
318
@time: 
Wim Taymans's avatar
Wim Taymans committed
319
@Returns: 
320 321


Wim Taymans's avatar
Wim Taymans committed
322 323 324 325 326 327 328 329 330
<!-- ##### FUNCTION gst_clock_get_time ##### -->
<para>

</para>

@clock: 
@Returns: 


Wim Taymans's avatar
Wim Taymans committed
331
<!-- ##### FUNCTION gst_clock_get_next_id ##### -->
Wim Taymans's avatar
Wim Taymans committed
332
<para>
333

Wim Taymans's avatar
Wim Taymans committed
334 335 336
</para>

@clock: 
Wim Taymans's avatar
Wim Taymans committed
337
@Returns: 
Wim Taymans's avatar
Wim Taymans committed
338 339


Wim Taymans's avatar
Wim Taymans committed
340
<!-- ##### FUNCTION gst_clock_new_single_shot_id ##### -->
Wim Taymans's avatar
Wim Taymans committed
341 342 343 344 345
<para>

</para>

@clock: 
Wim Taymans's avatar
Wim Taymans committed
346 347 348 349 350 351 352 353 354 355 356 357
@time: 
@Returns: 


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

</para>

@clock: 
@start_time: 
@interval: 
Wim Taymans's avatar
Wim Taymans committed
358 359 360
@Returns: 


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

</para>
365

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


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

</para>

Wim Taymans's avatar
Wim Taymans committed
375 376
@id: 
@jitter: 
377 378 379
@Returns: 


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

</para>

Wim Taymans's avatar
Wim Taymans committed
385 386 387
@id: 
@func: 
@user_data: 
388
@Returns: 
Wim Taymans's avatar
Wim Taymans committed
389 390


Wim Taymans's avatar
Wim Taymans committed
391
<!-- ##### FUNCTION gst_clock_id_unschedule ##### -->
392 393 394 395
<para>

</para>

Wim Taymans's avatar
Wim Taymans committed
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414
@id: 


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

</para>

@id: 


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

</para>

@id: