upload tizen1.0 source
[framework/multimedia/gst-plugins-good0.10.git] / sys / waveform / gstwaveformsink.h
1 /* GStreamer
2  * Copyright (C)  2005 Sebastien Moutte <sebastien@moutte.net>
3  *
4  * gstwaveformsink.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 #ifndef __GST_WAVEFORMSINK_H__
23 #define __GST_WAVEFORMSINK_H__
24
25 #include <gst/gst.h>
26 #include <gst/audio/gstaudiosink.h>
27
28 #include <windows.h>
29 #include <mmsystem.h>
30
31 #define WAVE_FORMAT_96M08       0x00001000       /* 96   kHz, Mono,   8-bit  */
32 #define WAVE_FORMAT_96S08       0x00002000       /* 96   kHz, Stereo, 8-bit  */
33 #define WAVE_FORMAT_96M16       0x00004000       /* 96   kHz, Mono,   16-bit */
34 #define WAVE_FORMAT_96S16       0x00008000       /* 96   kHz, Stereo, 16-bit */
35
36 #define ERROR_LENGTH MAXERRORLENGTH+50
37 #define BUFFER_COUNT 20
38 #define BUFFER_SIZE 8192
39
40 G_BEGIN_DECLS
41 #define GST_TYPE_WAVEFORM_SINK                (gst_waveform_sink_get_type())
42 #define GST_WAVEFORM_SINK(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_WAVEFORM_SINK,GstWaveFormSink))
43 #define GST_WAVEFORM_SINK_CLASS(klass)        (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_WAVEFORM_SINK,GstWaveFormSinkClass))
44 #define GST_IS_WAVEFORM_SINK(obj)             (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_WAVEFORM_SINK))
45 #define GST_IS_WAVEFORM_SINK_CLASS(klass)     (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_WAVEFORM_SINK))
46 typedef struct _GstWaveFormSink GstWaveFormSink;
47 typedef struct _GstWaveFormSinkClass GstWaveFormSinkClass;
48
49 struct _GstWaveFormSink
50 {
51   /* parent object */
52   GstAudioSink sink;
53
54   /* supported caps */
55   GstCaps *cached_caps;
56   
57   /* handle to the waveform-audio output device */
58   HWAVEOUT hwaveout;
59   
60   /* table of buffer headers */
61   WAVEHDR *wave_buffers;
62
63   /* critical section protecting access to the number of free buffers */
64   CRITICAL_SECTION critic_wave;
65
66   /* number of free buffers available */
67   guint free_buffers_count;
68   
69   /* current free buffer where you have to write incoming data */
70   guint write_buffer;
71   
72   /* size of buffers streamed to the device */
73   guint buffer_size;
74
75   /* number of buffers streamed to the device */
76   guint buffer_count;
77
78   /* total of bytes in queue before they are written to the device */
79   guint bytes_in_queue;
80
81   /* bytes per sample from setcaps used to evaluate the number samples returned by delay */
82   guint bytes_per_sample;
83
84   /* wave form error string */
85   gchar error_string[ERROR_LENGTH];
86 };
87
88 struct _GstWaveFormSinkClass
89 {
90   GstAudioSinkClass parent_class;
91 };
92
93 GType gst_waveform_sink_get_type (void);
94
95 G_END_DECLS
96 #endif /* __GST_WAVEFORMSINK_H__ */