• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, 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 (gst_speex_enc_get_type())
34 G_DECLARE_FINAL_TYPE (GstSpeexEnc, gst_speex_enc, GST, SPEEX_ENC,
35     GstAudioEncoder)
36 
37 typedef enum
38 {
39   GST_SPEEX_ENC_MODE_AUTO,
40   GST_SPEEX_ENC_MODE_UWB,
41   GST_SPEEX_ENC_MODE_WB,
42   GST_SPEEX_ENC_MODE_NB
43 } GstSpeexMode;
44 
45 struct _GstSpeexEnc {
46   GstAudioEncoder   element;
47 
48   SpeexBits             bits;
49   SpeexHeader           header;
50   const SpeexMode       *speex_mode;
51   void                  *state;
52 
53   /* properties */
54   GstSpeexMode          mode;
55   gfloat                quality;
56   gint                  bitrate;
57   gboolean              vbr;
58   gint                  abr;
59   gboolean              vad;
60   gboolean              dtx;
61   gint                  complexity;
62   gint                  nframes;
63   gchar                 *last_message;
64 
65   gint                  channels;
66   gint                  rate;
67 
68   gboolean              header_sent;
69   guint64               encoded_samples;
70 
71   GstTagList            *tags;
72 
73   gint                  frame_size;
74   gint                  lookahead;
75 
76   guint8                *comments;
77   gint                  comment_len;
78 };
79 
80 G_END_DECLS
81 
82 #endif /* __GST_SPEEXENC_H__ */
83