gst/wavparse/gstwavparse.*: reverted patch #337625 for the price of 1 hour sleep
[platform/upstream/gst-plugins-good.git] / gst / wavparse / gstwavparse.h
1 /* GStreamer
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  */
19
20
21 #ifndef __GST_WAVPARSE_H__
22 #define __GST_WAVPARSE_H__
23
24
25 #include <gst/gst.h>
26 #include "gst/riff/riff-ids.h"
27 #include "gst/riff/riff-read.h"
28
29 G_BEGIN_DECLS
30
31 #define GST_TYPE_WAVPARSE \
32   (gst_wavparse_get_type())
33 #define GST_WAVPARSE(obj) \
34   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_WAVPARSE,GstWavParse))
35 #define GST_WAVPARSE_CLASS(klass) \
36   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_WAVPARSE,GstWavParseClass))
37 #define GST_IS_WAVPARSE(obj) \
38   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_WAVPARSE))
39 #define GST_IS_WAVPARSE_CLASS(klass) \
40   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_WAVPARSE))
41
42 typedef enum {
43   GST_WAVPARSE_START,
44   GST_WAVPARSE_HEADER,
45   GST_WAVPARSE_DATA,
46 } GstWavParseState;
47
48 typedef struct _GstWavParse GstWavParse;
49 typedef struct _GstWavParseClass GstWavParseClass;
50
51 /**
52  * GstWavParse:
53  *
54  * Opaque data structure.
55  */
56 struct _GstWavParse {
57   GstElement parent;
58
59   /* pads */
60   GstPad *sinkpad,*srcpad;
61
62   /* for delayed source pad creation for when
63    * we have the first chunk of data and know
64    * the format for sure */
65   GstCaps     *caps;
66   GstTagList  *tags;
67   GstEvent    *newsegment;
68
69   /* WAVE decoding state */
70   GstWavParseState state;
71
72   /* format of audio, see defines below */
73   gint format;
74
75   /* useful audio data */
76   guint16 depth;
77   gint rate;
78   guint16 channels;
79   guint16 blockalign;
80   guint16 width;
81   guint32 bps;
82
83   guint bytes_per_sample;
84
85   /* position in data part */
86   guint64       offset;
87   guint64       end_offset;
88   guint64       dataleft;
89   /* offset/length of data part */
90   guint64       datastart;
91   guint64       datasize;
92   
93   /* pending seek */
94   GstEvent *seek_event;
95
96   /* configured segment, start/stop expressed in time */
97   GstSegment segment;
98   gboolean segment_running;
99 };
100
101 struct _GstWavParseClass {
102   GstElementClass parent_class;
103 };
104
105 GType gst_wavparse_get_type(void);
106
107 G_END_DECLS
108
109 #endif /* __GST_WAVPARSE_H__ */