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