2 * Copyright (C) 2005 Sebastien Moutte <sebastien@moutte.net>
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.
22 #ifndef __GST_WAVEFORMSINK_H__
23 #define __GST_WAVEFORMSINK_H__
26 #include <gst/audio/gstaudiosink.h>
31 #ifndef WAVE_FORMAT_96M08
32 #define WAVE_FORMAT_96M08 0x00001000 /* 96 kHz, Mono, 8-bit */
35 #ifndef WAVE_FORMAT_96S08
36 #define WAVE_FORMAT_96S08 0x00002000 /* 96 kHz, Stereo, 8-bit */
39 #ifndef WAVE_FORMAT_96M16
40 #define WAVE_FORMAT_96M16 0x00004000 /* 96 kHz, Mono, 16-bit */
43 #ifndef WAVE_FORMAT_96S16
44 #define WAVE_FORMAT_96S16 0x00008000 /* 96 kHz, Stereo, 16-bit */
47 #define ERROR_LENGTH MAXERRORLENGTH+50
48 #define BUFFER_COUNT 20
49 #define BUFFER_SIZE 8192
52 #define GST_TYPE_WAVEFORM_SINK (gst_waveform_sink_get_type())
53 #define GST_WAVEFORM_SINK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_WAVEFORM_SINK,GstWaveFormSink))
54 #define GST_WAVEFORM_SINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_WAVEFORM_SINK,GstWaveFormSinkClass))
55 #define GST_IS_WAVEFORM_SINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_WAVEFORM_SINK))
56 #define GST_IS_WAVEFORM_SINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_WAVEFORM_SINK))
57 typedef struct _GstWaveFormSink GstWaveFormSink;
58 typedef struct _GstWaveFormSinkClass GstWaveFormSinkClass;
60 struct _GstWaveFormSink
68 /* handle to the waveform-audio output device */
71 /* table of buffer headers */
72 WAVEHDR *wave_buffers;
74 /* critical section protecting access to the number of free buffers */
75 CRITICAL_SECTION critic_wave;
77 /* number of free buffers available */
78 guint free_buffers_count;
80 /* current free buffer where you have to write incoming data */
83 /* size of buffers streamed to the device */
86 /* number of buffers streamed to the device */
89 /* total of bytes in queue before they are written to the device */
92 /* bytes per sample from setcaps used to evaluate the number samples returned by delay */
93 guint bytes_per_sample;
95 /* wave form error string */
96 gchar error_string[ERROR_LENGTH];
99 struct _GstWaveFormSinkClass
101 GstAudioSinkClass parent_class;
104 GType gst_waveform_sink_get_type (void);
107 #endif /* __GST_WAVEFORMSINK_H__ */