2 * Copyright (C) 2005 Wim Taymans <wim@fluendo.com>
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.
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.
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.
23 #ifndef __GST_ALSASRC_H__
24 #define __GST_ALSASRC_H__
26 #include <gst/audio/gstaudiosrc.h>
28 #include "gstalsamixer.h"
32 #define GST_TYPE_ALSA_SRC (gst_alsasrc_get_type())
33 #define GST_ALSA_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ALSA_SRC,GstAlsaSrc))
34 #define GST_ALSA_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ALSA_SRC,GstAlsaSrcClass))
35 #define GST_IS_ALSA_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ALSA_SRC))
36 #define GST_IS_ALSA_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ALSA_SRC))
37 #define GST_ALSA_SRC_CAST(obj) ((GstAlsaSrc *)(obj))
39 #define GST_ALSA_SRC_GET_LOCK(obj) (GST_ALSA_SRC_CAST (obj)->alsa_lock)
40 #define GST_ALSA_SRC_LOCK(obj) (g_mutex_lock (GST_ALSA_SRC_GET_LOCK (obj)))
41 #define GST_ALSA_SRC_UNLOCK(obj) (g_mutex_unlock (GST_ALSA_SRC_GET_LOCK (obj)))
43 typedef struct _GstAlsaSrc GstAlsaSrc;
44 typedef struct _GstAlsaSrcClass GstAlsaSrcClass;
49 * Opaque data structure
57 snd_pcm_hw_params_t *hwparams;
58 snd_pcm_sw_params_t *swparams;
62 snd_pcm_access_t access;
63 snd_pcm_format_t format;
66 gint bytes_per_sample;
70 snd_pcm_uframes_t buffer_size;
71 snd_pcm_uframes_t period_size;
78 gboolean handle_pause;
83 struct _GstAlsaSrcClass {
84 GstAudioSrcClass parent_class;
87 GType gst_alsasrc_get_type(void);
91 #endif /* __GST_ALSASRC_H__ */