|
1 /* GStreamer |
|
2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu> |
|
3 * 2005 Wim Taymans <wim@fluendo.com> |
|
4 * |
|
5 * gstaudioclock.h: Clock for use by audio plugins |
|
6 * |
|
7 * This library is free software; you can redistribute it and/or |
|
8 * modify it under the terms of the GNU Library General Public |
|
9 * License as published by the Free Software Foundation; either |
|
10 * version 2 of the License, or (at your option) any later version. |
|
11 * |
|
12 * This library is distributed in the hope that it will be useful, |
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
15 * Library General Public License for more details. |
|
16 * |
|
17 * You should have received a copy of the GNU Library General Public |
|
18 * License along with this library; if not, write to the |
|
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
|
20 * Boston, MA 02111-1307, USA. |
|
21 */ |
|
22 |
|
23 #ifndef __GST_AUDIO_CLOCK_H__ |
|
24 #define __GST_AUDIO_CLOCK_H__ |
|
25 |
|
26 #include <gst/gstsystemclock.h> |
|
27 |
|
28 G_BEGIN_DECLS |
|
29 |
|
30 #define GST_TYPE_AUDIO_CLOCK \ |
|
31 (gst_audio_clock_get_type()) |
|
32 #define GST_AUDIO_CLOCK(obj) \ |
|
33 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_CLOCK,GstAudioClock)) |
|
34 #define GST_AUDIO_CLOCK_CLASS(klass) \ |
|
35 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIO_CLOCK,GstAudioClockClass)) |
|
36 #define GST_IS_AUDIO_CLOCK(obj) \ |
|
37 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_CLOCK)) |
|
38 #define GST_IS_AUDIO_CLOCK_CLASS(klass) \ |
|
39 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_CLOCK)) |
|
40 |
|
41 typedef struct _GstAudioClock GstAudioClock; |
|
42 typedef struct _GstAudioClockClass GstAudioClockClass; |
|
43 |
|
44 /** |
|
45 * GstAudioClockGetTimeFunc: |
|
46 * @clock: the #GstAudioClock |
|
47 * @user_data: user data |
|
48 * |
|
49 * This function will be called whenever the current clock time needs to be |
|
50 * calculated. If this function returns #GST_CLOCK_TIME_NONE, the last reported |
|
51 * time will be returned by the clock. |
|
52 * |
|
53 * Returns: the current time or #GST_CLOCK_TIME_NONE if the previous time should |
|
54 * be used. |
|
55 */ |
|
56 typedef GstClockTime (*GstAudioClockGetTimeFunc) (GstClock *clock, gpointer user_data); |
|
57 |
|
58 /** |
|
59 * GstAudioClock: |
|
60 * @clock: parent #GstSystemClock |
|
61 * |
|
62 * Opaque #GstAudioClock. |
|
63 */ |
|
64 struct _GstAudioClock { |
|
65 GstSystemClock clock; |
|
66 |
|
67 /* --- protected --- */ |
|
68 GstAudioClockGetTimeFunc func; |
|
69 gpointer user_data; |
|
70 |
|
71 GstClockTime last_time; |
|
72 |
|
73 /*< private >*/ |
|
74 gpointer _gst_reserved[GST_PADDING]; |
|
75 }; |
|
76 |
|
77 struct _GstAudioClockClass { |
|
78 GstSystemClockClass parent_class; |
|
79 |
|
80 /*< private >*/ |
|
81 gpointer _gst_reserved[GST_PADDING]; |
|
82 }; |
|
83 #ifdef __SYMBIAN32__ |
|
84 IMPORT_C |
|
85 #endif |
|
86 |
|
87 |
|
88 GType gst_audio_clock_get_type (void); |
|
89 #ifdef __SYMBIAN32__ |
|
90 IMPORT_C |
|
91 #endif |
|
92 |
|
93 GstClock* gst_audio_clock_new (gchar *name, GstAudioClockGetTimeFunc func, |
|
94 gpointer user_data); |
|
95 |
|
96 G_END_DECLS |
|
97 |
|
98 #endif /* __GST_AUDIO_CLOCK_H__ */ |