1 /* Gnome-Streamer
2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
18 */
21 #ifndef __GST_AUDIOSRC_H__
22 #define __GST_AUDIOSRC_H__
25 #include <config.h>
26 #include <gst/gst.h>
27 #include <gst/meta/audioraw.h>
30 #ifdef __cplusplus
31 extern "C" {
32 #endif /* __cplusplus */
35 GstElementDetails gst_audiosrc_details;
38 #define GST_TYPE_AUDIOSRC \
39 (gst_audiosrc_get_type())
40 #define GST_AUDIOSRC(obj) \
41 (GTK_CHECK_CAST((obj),GST_TYPE_AUDIOSRC,GstAudioSrc))
42 #define GST_AUDIOSRC_CLASS(klass) \
43 (GTK_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIOSRC,GstAudioSrcClass))
44 #define GST_IS_AUDIOSRC(obj) \
45 (GTK_CHECK_TYPE((obj),GST_TYPE_AUDIOSRC))
46 #define GST_IS_AUDIOSRC_CLASS(obj) \
47 (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIOSRC)))
49 typedef struct _GstAudioSrc GstAudioSrc;
50 typedef struct _GstAudioSrcClass GstAudioSrcClass;
52 struct _GstAudioSrc {
53 GstSrc src;
55 /* pads */
56 GstPad *srcpad;
58 /* sound card */
59 gchar *filename;
60 gint fd;
62 /* audio parameters */
63 gint format;
64 gint channels;
65 gint frequency;
67 /* blocking */
68 gulong curoffset;
69 gulong bytes_per_read;
71 gulong seq;
73 MetaAudioRaw *meta;
74 };
76 struct _GstAudioSrcClass {
77 GstSrcClass parent_class;
78 };
80 GtkType gst_audiosrc_get_type(void);
81 GstElement *gst_audiosrc_new(gchar *name);
83 void gst_audiosrc_push(GstSrc *src);
85 #ifdef __cplusplus
86 }
87 #endif /* __cplusplus */
90 #endif /* __GST_AUDIOSRC_H__ */