18 * License along with this library; if not, write to the |
18 * License along with this library; if not, write to the |
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
20 * Boston, MA 02111-1307, USA. |
20 * Boston, MA 02111-1307, USA. |
21 */ |
21 */ |
22 |
22 |
23 /* a base class for simple audio srcs. |
|
24 * |
|
25 * This base class only requires subclasses to implement a set |
|
26 * of simple functions. |
|
27 * |
|
28 * - open: open the device with the specified caps |
|
29 * - read: read samples to the audio device |
|
30 * - close: close the device |
|
31 * - delay: the number of samples queued in the device |
|
32 * - reset: unblock a read to the device and reset. |
|
33 * |
|
34 * All scheduling of samples and timestamps is done in this |
|
35 * base class. |
|
36 */ |
|
37 |
|
38 #ifndef __GST_AUDIO_SRC_H__ |
23 #ifndef __GST_AUDIO_SRC_H__ |
39 #define __GST_AUDIO_SRC_H__ |
24 #define __GST_AUDIO_SRC_H__ |
40 |
25 |
41 #include <gst/gst.h> |
26 #include <gst/gst.h> |
42 #include <gst/audio/gstbaseaudiosrc.h> |
27 #include <gst/audio/gstbaseaudiosrc.h> |
51 #define GST_IS_AUDIO_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_SRC)) |
36 #define GST_IS_AUDIO_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_SRC)) |
52 |
37 |
53 typedef struct _GstAudioSrc GstAudioSrc; |
38 typedef struct _GstAudioSrc GstAudioSrc; |
54 typedef struct _GstAudioSrcClass GstAudioSrcClass; |
39 typedef struct _GstAudioSrcClass GstAudioSrcClass; |
55 |
40 |
|
41 /** |
|
42 * GstAudioSrc: |
|
43 * @element: parent class |
|
44 * |
|
45 * Base class for simple audio sources. |
|
46 */ |
56 struct _GstAudioSrc { |
47 struct _GstAudioSrc { |
57 GstBaseAudioSrc element; |
48 GstBaseAudioSrc element; |
58 |
49 |
59 /*< private >*/ /* with LOCK */ |
50 /*< private >*/ /* with LOCK */ |
60 GThread *thread; |
51 GThread *thread; |
61 |
52 |
62 /*< private >*/ |
53 /*< private >*/ |
63 gpointer _gst_reserved[GST_PADDING]; |
54 gpointer _gst_reserved[GST_PADDING]; |
64 }; |
55 }; |
65 |
56 |
|
57 /** |
|
58 * GstAudioSrcClass: |
|
59 * @parent_class: the parent class. |
|
60 * @open: open the device with the specified caps |
|
61 * @prepare: configure device with format |
|
62 * @unprepare: undo the configuration |
|
63 * @close: close the device |
|
64 * @read: read samples to the audio device |
|
65 * @delay: the number of samples queued in the device |
|
66 * @reset: unblock a read to the device and reset. |
|
67 * |
|
68 * #GstAudioSrc class. Override the vmethod to implement |
|
69 * functionality. |
|
70 */ |
66 struct _GstAudioSrcClass { |
71 struct _GstAudioSrcClass { |
67 GstBaseAudioSrcClass parent_class; |
72 GstBaseAudioSrcClass parent_class; |
68 |
73 |
69 /* vtable */ |
74 /* vtable */ |
70 |
75 |