Port gtk-doc comments to their equivalent markdown syntax
[platform/upstream/gstreamer.git] / gst / gstclock.h
1 /* GStreamer
2  * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3  *                    2000 Wim Taymans <wtay@chello.be>
4  *                    2005 Wim Taymans <wim@fluendo.com>
5  *
6  * gstclock.h: Header for clock subsystem
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  */
23
24 #ifndef __GST_CLOCK_H__
25 #define __GST_CLOCK_H__
26
27 #include <gst/gstconfig.h>
28 #include <glib.h>
29
30 G_BEGIN_DECLS
31
32 /* --- standard type macros --- */
33 #define GST_TYPE_CLOCK                  (gst_clock_get_type ())
34 #define GST_CLOCK(clock)                (G_TYPE_CHECK_INSTANCE_CAST ((clock), GST_TYPE_CLOCK, GstClock))
35 #define GST_IS_CLOCK(clock)             (G_TYPE_CHECK_INSTANCE_TYPE ((clock), GST_TYPE_CLOCK))
36 #define GST_CLOCK_CLASS(cclass)         (G_TYPE_CHECK_CLASS_CAST ((cclass), GST_TYPE_CLOCK, GstClockClass))
37 #define GST_IS_CLOCK_CLASS(cclass)      (G_TYPE_CHECK_CLASS_TYPE ((cclass), GST_TYPE_CLOCK))
38 #define GST_CLOCK_GET_CLASS(clock)      (G_TYPE_INSTANCE_GET_CLASS ((clock), GST_TYPE_CLOCK, GstClockClass))
39 #define GST_CLOCK_CAST(clock)           ((GstClock*)(clock))
40
41 /**
42  * GstClockTime:
43  *
44  * A datatype to hold a time, measured in nanoseconds.
45  */
46 typedef guint64 GstClockTime;
47
48 /**
49  * GST_TYPE_CLOCK_TIME:
50  *
51  * The #GType of a #GstClockTime.
52  */
53 #define GST_TYPE_CLOCK_TIME G_TYPE_UINT64
54
55 /**
56  * GstClockTimeDiff:
57  *
58  * A datatype to hold a time difference, measured in nanoseconds.
59  */
60 typedef gint64 GstClockTimeDiff;
61 /**
62  * GstClockID:
63  *
64  * A datatype to hold the handle to an outstanding sync or async clock callback.
65  */
66 typedef gpointer GstClockID;
67
68 /**
69  * GST_CLOCK_TIME_NONE: (value 18446744073709551615) (type GstClockTime)
70  *
71  * Constant to define an undefined clock time.
72  */
73 #define GST_CLOCK_TIME_NONE             ((GstClockTime) -1)
74 /**
75  * GST_CLOCK_TIME_IS_VALID:
76  * @time: clock time to validate
77  *
78  * Tests if a given #GstClockTime represents a valid defined time.
79  */
80 #define GST_CLOCK_TIME_IS_VALID(time)   (((GstClockTime)(time)) != GST_CLOCK_TIME_NONE)
81
82 /**
83  * GST_CLOCK_STIME_NONE: (value -9223372036854775808) (type GstClockTimeDiff)
84  *
85  * Constant to define an undefined clock time.
86  */
87 #define GST_CLOCK_STIME_NONE             G_MININT64
88 /**
89  * GST_CLOCK_STIME_IS_VALID:
90  * @time: signed clock time to validate
91  *
92  * Tests if a given #GstClockTimeDiff of #gint64 represents a valid defined time.
93  *
94  * Since: 1.6
95  */
96 #define GST_CLOCK_STIME_IS_VALID(time)   (((GstClockTimeDiff)(time)) != GST_CLOCK_STIME_NONE)
97
98 /* FIXME: still need to explicitly force types on the defines below */
99 /**
100  * GST_SECOND: (value 1000000000) (type GstClockTime)
101  *
102  * Constant that defines one GStreamer second.
103  */
104 #define GST_SECOND  (G_USEC_PER_SEC * G_GINT64_CONSTANT (1000))
105 /**
106  * GST_MSECOND: (value 1000000) (type GstClockTime)
107  *
108  * Constant that defines one GStreamer millisecond.
109  */
110 #define GST_MSECOND (GST_SECOND / G_GINT64_CONSTANT (1000))
111 /**
112  * GST_USECOND: (value 1000) (type GstClockTime)
113  *
114  * Constant that defines one GStreamer microsecond.
115  */
116 #define GST_USECOND (GST_SECOND / G_GINT64_CONSTANT (1000000))
117 /**
118  * GST_NSECOND: (value 1) (type GstClockTime)
119  *
120  * Constant that defines one GStreamer nanosecond
121  */
122 #define GST_NSECOND (GST_SECOND / G_GINT64_CONSTANT (1000000000))
123
124
125 /**
126  * GST_TIME_AS_SECONDS:
127  * @time: the time
128  *
129  * Convert a #GstClockTime to seconds.
130  */
131 #define GST_TIME_AS_SECONDS(time)  ((time) / GST_SECOND)
132 /**
133  * GST_TIME_AS_MSECONDS:
134  * @time: the time
135  *
136  * Convert a #GstClockTime to milliseconds (1/1000 of a second).
137  */
138 #define GST_TIME_AS_MSECONDS(time) ((time) / G_GINT64_CONSTANT (1000000))
139 /**
140  * GST_TIME_AS_USECONDS:
141  * @time: the time
142  *
143  * Convert a #GstClockTime to microseconds (1/1000000 of a second).
144  */
145 #define GST_TIME_AS_USECONDS(time) ((time) / G_GINT64_CONSTANT (1000))
146 /**
147  * GST_TIME_AS_NSECONDS:
148  * @time: the time
149  *
150  * Convert a #GstClockTime to nanoseconds (1/1000000000 of a second).
151  */
152 #define GST_TIME_AS_NSECONDS(time) (time)
153
154 /**
155  * GST_CLOCK_DIFF:
156  * @s: the first time
157  * @e: the second time
158  *
159  * Calculate a difference between two clock times as a #GstClockTimeDiff.
160  * The difference is calculated as @e - @s.
161  */
162 #define GST_CLOCK_DIFF(s, e)            (GstClockTimeDiff)((e) - (s))
163
164 /**
165  * GST_TIMEVAL_TO_TIME:
166  * @tv: the timeval to convert
167  *
168  * Convert a #GTimeVal to a #GstClockTime.
169  */
170 #define GST_TIMEVAL_TO_TIME(tv)         (GstClockTime)((tv).tv_sec * GST_SECOND + (tv).tv_usec * GST_USECOND)
171
172 /**
173  * GST_TIME_TO_TIMEVAL:
174  * @t: The #GstClockTime to convert
175  * @tv: The target timeval
176  *
177  * Convert a #GstClockTime to a #GTimeVal
178  *
179  * > on 32-bit systems, a timeval has a range of only 2^32 - 1 seconds,
180  * > which is about 68 years.  Expect trouble if you want to schedule stuff
181  * > in your pipeline for 2038.
182  */
183 #define GST_TIME_TO_TIMEVAL(t,tv)                               \
184 G_STMT_START {                                                  \
185   g_assert ("Value of time " #t " is out of timeval's range" && \
186       ((t) / GST_SECOND) < G_MAXLONG);                          \
187   (tv).tv_sec  = (glong) (((GstClockTime) (t)) / GST_SECOND);   \
188   (tv).tv_usec = (glong) ((((GstClockTime) (t)) -               \
189                   ((GstClockTime) (tv).tv_sec) * GST_SECOND)    \
190                  / GST_USECOND);                                \
191 } G_STMT_END
192
193 /**
194  * GST_TIMESPEC_TO_TIME:
195  * @ts: the timespec to convert
196  *
197  * Convert a struct timespec (see man pselect) to a #GstClockTime.
198  */
199 #define GST_TIMESPEC_TO_TIME(ts)        (GstClockTime)((ts).tv_sec * GST_SECOND + (ts).tv_nsec * GST_NSECOND)
200 /**
201  * GST_TIME_TO_TIMESPEC:
202  * @t: The #GstClockTime to convert
203  * @ts: The target timespec
204  *
205  * Convert a #GstClockTime to a struct timespec (see man pselect)
206  */
207 #define GST_TIME_TO_TIMESPEC(t,ts)                                \
208 G_STMT_START {                                                    \
209   g_assert ("Value of time " #t " is out of timespec's range" &&  \
210       ((t) / GST_SECOND) < G_MAXLONG);                            \
211   (ts).tv_sec  =  (glong) ((t) / GST_SECOND);                     \
212   (ts).tv_nsec = (glong) (((t) - (ts).tv_sec * GST_SECOND) / GST_NSECOND);        \
213 } G_STMT_END
214
215 /* timestamp debugging macros */
216 /**
217  * GST_TIME_FORMAT:
218  *
219  * A string that can be used in printf-like format strings to display a
220  * #GstClockTime value in h:m:s format.  Use GST_TIME_ARGS() to construct
221  * the matching arguments.
222  *
223  * Example:
224  * |[<!-- language="C" -->
225  * printf("%" GST_TIME_FORMAT "\n", GST_TIME_ARGS(ts));
226  * ]|
227  */
228 #define GST_TIME_FORMAT "u:%02u:%02u.%09u"
229 /**
230  * GST_TIME_ARGS:
231  * @t: a #GstClockTime
232  *
233  * Format @t for the #GST_TIME_FORMAT format string. Note: @t will be
234  * evaluated more than once.
235  */
236 #define GST_TIME_ARGS(t) \
237         GST_CLOCK_TIME_IS_VALID (t) ? \
238         (guint) (((GstClockTime)(t)) / (GST_SECOND * 60 * 60)) : 99, \
239         GST_CLOCK_TIME_IS_VALID (t) ? \
240         (guint) ((((GstClockTime)(t)) / (GST_SECOND * 60)) % 60) : 99, \
241         GST_CLOCK_TIME_IS_VALID (t) ? \
242         (guint) ((((GstClockTime)(t)) / GST_SECOND) % 60) : 99, \
243         GST_CLOCK_TIME_IS_VALID (t) ? \
244         (guint) (((GstClockTime)(t)) % GST_SECOND) : 999999999
245 /**
246  * GST_STIME_FORMAT:
247  *
248  * A string that can be used in printf-like format strings to display a signed
249  * #GstClockTimeDiff or #gint64 value in h:m:s format.  Use GST_TIME_ARGS() to
250  * construct the matching arguments.
251  *
252  * Example:
253  * |[
254  * printf("%" GST_STIME_FORMAT "\n", GST_STIME_ARGS(ts));
255  * ]|
256  *
257  * Since: 1.6
258  */
259 #define GST_STIME_FORMAT "c%" GST_TIME_FORMAT
260 /**
261  * GST_STIME_ARGS:
262  * @t: a #GstClockTimeDiff or #gint64
263  *
264  * Format @t for the #GST_STIME_FORMAT format string. Note: @t will be
265  * evaluated more than once.
266  *
267  * Since: 1.6
268  */
269 #define GST_STIME_ARGS(t)                                               \
270   ((t) == GST_CLOCK_STIME_NONE || (t) >= 0) ? '+' : '-',                \
271     GST_CLOCK_STIME_IS_VALID (t) ?                                      \
272     (guint) (((GstClockTime)(ABS(t))) / (GST_SECOND * 60 * 60)) : 99,   \
273     GST_CLOCK_STIME_IS_VALID (t) ?                                      \
274     (guint) ((((GstClockTime)(ABS(t))) / (GST_SECOND * 60)) % 60) : 99, \
275     GST_CLOCK_STIME_IS_VALID (t) ?                                      \
276     (guint) ((((GstClockTime)(ABS(t))) / GST_SECOND) % 60) : 99,        \
277     GST_CLOCK_STIME_IS_VALID (t) ?                                      \
278     (guint) (((GstClockTime)(ABS(t))) % GST_SECOND) : 999999999
279
280 typedef struct _GstClockEntry   GstClockEntry;
281 typedef struct _GstClock        GstClock;
282 typedef struct _GstClockClass   GstClockClass;
283 typedef struct _GstClockPrivate GstClockPrivate;
284
285 /* --- prototype for async callbacks --- */
286 /**
287  * GstClockCallback:
288  * @clock: The clock that triggered the callback
289  * @time: The time it was triggered
290  * @id: The #GstClockID that expired
291  * @user_data: user data passed in the gst_clock_id_wait_async() function
292  *
293  * The function prototype of the callback.
294  *
295  * Returns: %TRUE or %FALSE (currently unused)
296  */
297 typedef gboolean        (*GstClockCallback)     (GstClock *clock, GstClockTime time,
298                                                  GstClockID id, gpointer user_data);
299 /**
300  * GstClockReturn:
301  * @GST_CLOCK_OK: The operation succeeded.
302  * @GST_CLOCK_EARLY: The operation was scheduled too late.
303  * @GST_CLOCK_UNSCHEDULED: The clockID was unscheduled
304  * @GST_CLOCK_BUSY: The ClockID is busy
305  * @GST_CLOCK_BADTIME: A bad time was provided to a function.
306  * @GST_CLOCK_ERROR: An error occurred
307  * @GST_CLOCK_UNSUPPORTED: Operation is not supported
308  * @GST_CLOCK_DONE: The ClockID is done waiting
309  *
310  * The return value of a clock operation.
311  */
312 typedef enum
313 {
314   GST_CLOCK_OK          =  0,
315   GST_CLOCK_EARLY       =  1,
316   GST_CLOCK_UNSCHEDULED =  2,
317   GST_CLOCK_BUSY        =  3,
318   GST_CLOCK_BADTIME     =  4,
319   GST_CLOCK_ERROR       =  5,
320   GST_CLOCK_UNSUPPORTED =  6,
321   GST_CLOCK_DONE        =  7
322 } GstClockReturn;
323
324 /**
325  * GstClockEntryType:
326  * @GST_CLOCK_ENTRY_SINGLE: a single shot timeout
327  * @GST_CLOCK_ENTRY_PERIODIC: a periodic timeout request
328  *
329  * The type of the clock entry
330  */
331 typedef enum {
332   GST_CLOCK_ENTRY_SINGLE,
333   GST_CLOCK_ENTRY_PERIODIC
334 } GstClockEntryType;
335
336 /**
337  * GST_CLOCK_ENTRY:
338  * @entry: the entry to cast
339  *
340  * Cast to a clock entry
341  */
342 #define GST_CLOCK_ENTRY(entry)          ((GstClockEntry *)(entry))
343 /**
344  * GST_CLOCK_ENTRY_CLOCK:
345  * @entry: the entry to query
346  *
347  * Get the owner clock of the entry
348  */
349 #define GST_CLOCK_ENTRY_CLOCK(entry)    ((entry)->clock)
350 /**
351  * GST_CLOCK_ENTRY_TYPE:
352  * @entry: the entry to query
353  *
354  * Get the type of the clock entry
355  */
356 #define GST_CLOCK_ENTRY_TYPE(entry)     ((entry)->type)
357 /**
358  * GST_CLOCK_ENTRY_TIME:
359  * @entry: the entry to query
360  *
361  * Get the requested time of this entry
362  */
363 #define GST_CLOCK_ENTRY_TIME(entry)     ((entry)->time)
364 /**
365  * GST_CLOCK_ENTRY_INTERVAL:
366  * @entry: the entry to query
367  *
368  * Get the interval of this periodic entry
369  */
370 #define GST_CLOCK_ENTRY_INTERVAL(entry) ((entry)->interval)
371 /**
372  * GST_CLOCK_ENTRY_STATUS:
373  * @entry: the entry to query
374  *
375  * The status of the entry
376  */
377 #define GST_CLOCK_ENTRY_STATUS(entry)   ((entry)->status)
378
379 /**
380  * GstClockEntry:
381  * @refcount: reference counter (read-only)
382  *
383  * All pending timeouts or periodic notifies are converted into
384  * an entry.
385  * Note that GstClockEntry should be treated as an opaque structure. It must
386  * not be extended or allocated using a custom allocator.
387  */
388 struct _GstClockEntry {
389   gint                  refcount;
390   /*< protected >*/
391   GstClock              *clock;
392   GstClockEntryType      type;
393   GstClockTime           time;
394   GstClockTime           interval;
395   GstClockReturn         status;
396   GstClockCallback       func;
397   gpointer               user_data;
398   GDestroyNotify         destroy_data;
399   gboolean               unscheduled;
400   gboolean               woken_up;
401
402   /*< private >*/
403   gpointer _gst_reserved[GST_PADDING];
404 };
405
406 #include <gst/gstobject.h>
407
408 /**
409  * GstClockFlags:
410  * @GST_CLOCK_FLAG_CAN_DO_SINGLE_SYNC: clock can do a single sync timeout request
411  * @GST_CLOCK_FLAG_CAN_DO_SINGLE_ASYNC: clock can do a single async timeout request
412  * @GST_CLOCK_FLAG_CAN_DO_PERIODIC_SYNC: clock can do sync periodic timeout requests
413  * @GST_CLOCK_FLAG_CAN_DO_PERIODIC_ASYNC: clock can do async periodic timeout callbacks
414  * @GST_CLOCK_FLAG_CAN_SET_RESOLUTION: clock's resolution can be changed
415  * @GST_CLOCK_FLAG_CAN_SET_MASTER: clock can be slaved to a master clock
416  * @GST_CLOCK_FLAG_NEEDS_STARTUP_SYNC: clock needs to be synced before it can be used
417  *     (Since 1.6)
418  * @GST_CLOCK_FLAG_LAST: subclasses can add additional flags starting from this flag
419  *
420  * The capabilities of this clock
421  */
422 typedef enum {
423   GST_CLOCK_FLAG_CAN_DO_SINGLE_SYNC     = (GST_OBJECT_FLAG_LAST << 0),
424   GST_CLOCK_FLAG_CAN_DO_SINGLE_ASYNC    = (GST_OBJECT_FLAG_LAST << 1),
425   GST_CLOCK_FLAG_CAN_DO_PERIODIC_SYNC   = (GST_OBJECT_FLAG_LAST << 2),
426   GST_CLOCK_FLAG_CAN_DO_PERIODIC_ASYNC  = (GST_OBJECT_FLAG_LAST << 3),
427   GST_CLOCK_FLAG_CAN_SET_RESOLUTION     = (GST_OBJECT_FLAG_LAST << 4),
428   GST_CLOCK_FLAG_CAN_SET_MASTER         = (GST_OBJECT_FLAG_LAST << 5),
429   GST_CLOCK_FLAG_NEEDS_STARTUP_SYNC     = (GST_OBJECT_FLAG_LAST << 6),
430   /* padding */
431   GST_CLOCK_FLAG_LAST                   = (GST_OBJECT_FLAG_LAST << 8)
432 } GstClockFlags;
433
434 /**
435  * GST_CLOCK_FLAGS:
436  * @clock: the clock to query
437  *
438  * Gets the #GstClockFlags clock flags.
439  */
440 #define GST_CLOCK_FLAGS(clock)  GST_OBJECT_FLAGS(clock)
441
442 /**
443  * GstClock:
444  *
445  * #GstClock base structure. The values of this structure are
446  * protected for subclasses, use the methods to use the #GstClock.
447  */
448 struct _GstClock {
449   GstObject      object;
450
451   /*< private >*/
452   GstClockPrivate *priv;
453
454   gpointer _gst_reserved[GST_PADDING];
455 };
456
457 /**
458  * GstClockClass:
459  * @parent_class: the parent class structure
460  * @change_resolution: change the resolution of the clock. Not all values might
461  *                     be acceptable. The new resolution should be returned.
462  * @get_resolution: get the resolution of the clock.
463  * @get_internal_time: get the internal unadjusted time of the clock.
464  *        implement @wait_jitter instead.
465  * @wait: perform a blocking wait on the given #GstClockEntry and return
466  *               the jitter.
467  * @wait_async: perform an asynchronous wait for the given #GstClockEntry.
468  * @unschedule: unblock a blocking or async wait operation.
469  *
470  * GStreamer clock class. Override the vmethods to implement the clock
471  * functionality.
472  */
473 struct _GstClockClass {
474   GstObjectClass        parent_class;
475
476   /*< public >*/
477   /* vtable */
478   GstClockTime          (*change_resolution)    (GstClock *clock,
479                                                  GstClockTime old_resolution,
480                                                  GstClockTime new_resolution);
481   GstClockTime          (*get_resolution)       (GstClock *clock);
482
483   GstClockTime          (*get_internal_time)    (GstClock *clock);
484
485   /* waiting on an ID */
486   GstClockReturn        (*wait)                 (GstClock *clock, GstClockEntry *entry,
487                                                  GstClockTimeDiff *jitter);
488   GstClockReturn        (*wait_async)           (GstClock *clock, GstClockEntry *entry);
489   void                  (*unschedule)           (GstClock *clock, GstClockEntry *entry);
490
491   /*< private >*/
492   gpointer _gst_reserved[GST_PADDING];
493 };
494
495 GType                   gst_clock_get_type              (void);
496
497 GstClockTime            gst_clock_set_resolution        (GstClock *clock,
498                                                          GstClockTime resolution);
499 GstClockTime            gst_clock_get_resolution        (GstClock *clock);
500
501 GstClockTime            gst_clock_get_time              (GstClock *clock);
502 void                    gst_clock_set_calibration       (GstClock *clock, GstClockTime internal,
503                                                          GstClockTime external,
504                                                          GstClockTime rate_num,
505                                                          GstClockTime rate_denom);
506 void                    gst_clock_get_calibration       (GstClock *clock, GstClockTime *internal,
507                                                          GstClockTime *external,
508                                                          GstClockTime *rate_num,
509                                                          GstClockTime *rate_denom);
510
511 /* master/slave clocks */
512 gboolean                gst_clock_set_master            (GstClock *clock, GstClock *master);
513 GstClock*               gst_clock_get_master            (GstClock *clock);
514
515 void                    gst_clock_set_timeout           (GstClock *clock,
516                                                          GstClockTime timeout);
517 GstClockTime            gst_clock_get_timeout           (GstClock *clock);
518
519 gboolean                gst_clock_add_observation       (GstClock *clock, GstClockTime slave,
520                                                          GstClockTime master, gdouble *r_squared);
521
522 gboolean                gst_clock_add_observation_unapplied (GstClock *clock, GstClockTime slave,
523                                                          GstClockTime master, gdouble *r_squared,
524                                                          GstClockTime *internal,
525                                                          GstClockTime *external,
526                                                          GstClockTime *rate_num,
527                                                          GstClockTime *rate_denom);
528
529 /* getting and adjusting internal/external time */
530 GstClockTime            gst_clock_get_internal_time     (GstClock *clock);
531 GstClockTime            gst_clock_adjust_unlocked       (GstClock *clock, GstClockTime internal);
532 GstClockTime            gst_clock_adjust_with_calibration (GstClock *clock,
533                                                          GstClockTime internal_target,
534                                                          GstClockTime cinternal,
535                                                          GstClockTime cexternal,
536                                                          GstClockTime cnum,
537                                                          GstClockTime cdenom);
538 GstClockTime            gst_clock_unadjust_with_calibration (GstClock *clock,
539                                                          GstClockTime external_target,
540                                                          GstClockTime cinternal,
541                                                          GstClockTime cexternal,
542                                                          GstClockTime cnum,
543                                                          GstClockTime cdenom);
544 GstClockTime            gst_clock_unadjust_unlocked     (GstClock * clock, GstClockTime external);
545
546 /* waiting for, signalling and checking for synchronization */
547 gboolean                gst_clock_wait_for_sync         (GstClock * clock, GstClockTime timeout);
548 gboolean                gst_clock_is_synced             (GstClock * clock);
549
550 /* to be used by subclasses only */
551 void                    gst_clock_set_synced            (GstClock * clock, gboolean synced);
552
553 /* creating IDs that can be used to get notifications */
554 GstClockID              gst_clock_new_single_shot_id    (GstClock *clock,
555                                                          GstClockTime time);
556 GstClockID              gst_clock_new_periodic_id       (GstClock *clock,
557                                                          GstClockTime start_time,
558                                                          GstClockTime interval);
559
560 /* reference counting */
561 GstClockID              gst_clock_id_ref                (GstClockID id);
562 void                    gst_clock_id_unref              (GstClockID id);
563
564 /* operations on IDs */
565 gint                    gst_clock_id_compare_func       (gconstpointer id1, gconstpointer id2);
566
567 GstClockTime            gst_clock_id_get_time           (GstClockID id);
568 GstClockReturn          gst_clock_id_wait               (GstClockID id,
569                                                          GstClockTimeDiff *jitter);
570 GstClockReturn          gst_clock_id_wait_async         (GstClockID id,
571                                                          GstClockCallback func,
572                                                          gpointer user_data,
573                                                          GDestroyNotify destroy_data);
574 void                    gst_clock_id_unschedule         (GstClockID id);
575
576 gboolean                gst_clock_single_shot_id_reinit (GstClock * clock,
577                                                          GstClockID id,
578                                                          GstClockTime time);
579 gboolean                gst_clock_periodic_id_reinit    (GstClock * clock,
580                                                          GstClockID id,
581                                                          GstClockTime start_time,
582                                                          GstClockTime interval);
583
584 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
585 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstClock, gst_object_unref)
586 #endif
587
588 G_END_DECLS
589
590 #endif /* __GST_CLOCK_H__ */