Tizen 2.0 Release
[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/audio/gstaudioencoder.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   GstAudioEncoder   element;
57
58   SpeexBits             bits;
59   SpeexHeader           header;
60 #ifdef SPEEX_1_0
61   SpeexMode             *speex_mode;
62 #else
63   const SpeexMode       *speex_mode;
64 #endif
65   void                  *state;
66
67   /* properties */
68   GstSpeexMode          mode;
69   gfloat                quality;
70   gint                  bitrate;
71   gboolean              vbr;
72   gint                  abr;
73   gboolean              vad;
74   gboolean              dtx;
75   gint                  complexity;
76   gint                  nframes;
77   gchar                 *last_message;
78
79   gint                  channels;
80   gint                  rate;
81
82   gboolean              header_sent;
83   GSList               *headers;
84
85   GstTagList            *tags;
86
87   gint                  frame_size;
88   gint                  lookahead;
89
90   guint8                *comments;
91   gint                  comment_len;
92 };
93
94 struct _GstSpeexEncClass {
95   GstAudioEncoderClass parent_class;
96 };
97
98 GType gst_speex_enc_get_type (void);
99
100 G_END_DECLS
101
102 #endif /* __GST_SPEEXENC_H__ */