expand tabs
[platform/upstream/gstreamer.git] / ext / alsa / gstalsasrc.h
1 /* GStreamer
2  * Copyright (C)  2005 Wim Taymans <wim@fluendo.com>
3  *
4  * gstalsasrc.h: 
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21
22
23 #ifndef __GST_ALSASRC_H__
24 #define __GST_ALSASRC_H__
25
26
27 #include <gst/audio/gstaudiosrc.h>
28 #include "gstalsa.h"
29 #include "gstalsamixer.h"
30
31
32 G_BEGIN_DECLS
33
34 #define GST_TYPE_ALSA_SRC          (gst_alsasrc_get_type())
35 #define GST_ALSA_SRC(obj)          (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ALSA_SRC,GstAlsaSrc))
36 #define GST_ALSA_SRC_CLASS(klass)  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ALSA_SRC,GstAlsaSrcClass))
37 #define GST_IS_ALSA_SRC(obj)       (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ALSA_SRC))
38 #define GST_IS_ALSA_SRC_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ALSA_SRC))
39
40 typedef struct _GstAlsaSrc GstAlsaSrc;
41 typedef struct _GstAlsaSrcClass GstAlsaSrcClass;
42
43 struct _GstAlsaSrc {
44   GstAudioSrc           src;
45
46   gchar                 *device;
47
48   snd_pcm_t             *handle;
49   snd_pcm_hw_params_t   *hwparams;
50   snd_pcm_sw_params_t   *swparams;
51
52   snd_pcm_access_t      access;
53   snd_pcm_format_t      format;
54   guint                 rate;
55   guint                 channels;
56   gint                  bytes_per_sample;
57
58   guint                 buffer_time;
59   guint                 period_time;
60   snd_pcm_uframes_t     buffer_size;
61   snd_pcm_uframes_t     period_size;
62
63   GstAlsaMixer          *mixer;
64 };
65
66 struct _GstAlsaSrcClass {
67   GstAudioSrcClass parent_class;
68 };
69
70 GType gst_alsasrc_get_type(void);
71
72 G_END_DECLS
73
74 #endif /* __GST_ALSASRC_H__ */