upload tizen1.0 source
[framework/multimedia/gst-plugins-good0.10.git] / ext / speex / gstspeexenc.h
1 /* GStreamer Speex Encoder
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_SPEEX_ENC_H__
22 #define __GST_SPEEX_ENC_H__
23
24
25 #include <gst/gst.h>
26 #include <gst/base/gstadapter.h>
27
28 #include <speex/speex.h>
29 #include <speex/speex_header.h>
30
31 G_BEGIN_DECLS
32
33 #define GST_TYPE_SPEEX_ENC \
34   (gst_speex_enc_get_type())
35 #define GST_SPEEX_ENC(obj) \
36   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SPEEX_ENC,GstSpeexEnc))
37 #define GST_SPEEX_ENC_CLASS(klass) \
38   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SPEEX_ENC,GstSpeexEncClass))
39 #define GST_IS_SPEEX_ENC(obj) \
40   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SPEEX_ENC))
41 #define GST_IS_SPEEX_ENC_CLASS(klass) \
42   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SPEEX_ENC))
43
44 typedef enum
45 {
46   GST_SPEEX_ENC_MODE_AUTO,
47   GST_SPEEX_ENC_MODE_UWB,
48   GST_SPEEX_ENC_MODE_WB,
49   GST_SPEEX_ENC_MODE_NB
50 } GstSpeexMode;
51
52 typedef struct _GstSpeexEnc GstSpeexEnc;
53 typedef struct _GstSpeexEncClass GstSpeexEncClass;
54
55 struct _GstSpeexEnc {
56   GstElement            element;
57
58   /* pads */
59   GstPad                *sinkpad,
60                         *srcpad;
61
62   gint                  packet_count;
63   gint                  n_packets;
64
65   SpeexBits             bits;
66   SpeexHeader           header;
67 #ifdef SPEEX_1_0
68   SpeexMode             *speex_mode;
69 #else
70   const SpeexMode       *speex_mode;
71 #endif
72   void                  *state;
73   GstSpeexMode          mode;
74   GstAdapter            *adapter;
75
76   gfloat                quality;
77   gint                  bitrate;
78   gboolean              vbr;
79   gint                  abr;
80   gboolean              vad;
81   gboolean              dtx;
82   gint                  complexity;
83   gint                  nframes;
84
85   gint                  lookahead;
86
87   gint                  channels;
88   gint                  rate;
89
90   gboolean              setup;
91   gboolean              header_sent;
92
93   guint64               samples_in;
94   guint64               bytes_out;
95
96   GstTagList            *tags;
97
98   gchar                 *last_message;
99
100   gint                  frame_size;
101   guint64               frameno;
102   guint64               frameno_out;
103
104   guint8                *comments;
105   gint                  comment_len;
106
107   /* Timestamp and granulepos tracking */
108   GstClockTime     start_ts;
109   GstClockTime     next_ts;
110   guint64          granulepos_offset;
111 };
112
113 struct _GstSpeexEncClass {
114   GstElementClass parent_class;
115
116   /* signals */
117   void (*frame_encoded) (GstElement *element);
118 };
119
120 GType gst_speex_enc_get_type (void);
121
122 G_END_DECLS
123
124 #endif /* __GST_SPEEXENC_H__ */