Speex  1.2~beta4
speex_callbacks.h
Go to the documentation of this file.
1 /* Copyright (C) 2002 Jean-Marc Valin*/
6 /*
7  Redistribution and use in source and binary forms, with or without
8  modification, are permitted provided that the following conditions
9  are met:
10 
11  - Redistributions of source code must retain the above copyright
12  notice, this list of conditions and the following disclaimer.
13 
14  - Redistributions in binary form must reproduce the above copyright
15  notice, this list of conditions and the following disclaimer in the
16  documentation and/or other materials provided with the distribution.
17 
18  - Neither the name of the Xiph.org Foundation nor the names of its
19  contributors may be used to endorse or promote products derived from
20  this software without specific prior written permission.
21 
22  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
26  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 
34 */
35 
36 #ifndef SPEEX_CALLBACKS_H
37 #define SPEEX_CALLBACKS_H
38 
42 #include "speex.h"
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
49 #define SPEEX_MAX_CALLBACKS 16
50 
51 /* Describes all the in-band requests */
52 
53 /*These are 1-bit requests*/
55 #define SPEEX_INBAND_ENH_REQUEST 0
56 
57 #define SPEEX_INBAND_RESERVED1 1
58 
59 /*These are 4-bit requests*/
61 #define SPEEX_INBAND_MODE_REQUEST 2
62 
63 #define SPEEX_INBAND_LOW_MODE_REQUEST 3
64 
65 #define SPEEX_INBAND_HIGH_MODE_REQUEST 4
66 
67 #define SPEEX_INBAND_VBR_QUALITY_REQUEST 5
68 
69 #define SPEEX_INBAND_ACKNOWLEDGE_REQUEST 6
70 
71 #define SPEEX_INBAND_VBR_REQUEST 7
72 
73 /*These are 8-bit requests*/
75 #define SPEEX_INBAND_CHAR 8
76 
77 #define SPEEX_INBAND_STEREO 9
78 
79 /*These are 16-bit requests*/
81 #define SPEEX_INBAND_MAX_BITRATE 10
82 
83 /*These are 32-bit requests*/
85 #define SPEEX_INBAND_ACKNOWLEDGE 12
86 
88 typedef int (*speex_callback_func)(SpeexBits *bits, void *state, void *data);
89 
91 typedef struct SpeexCallback {
94  void *data;
95  void *reserved1;
96  int reserved2;
98 
100 int speex_inband_handler(SpeexBits *bits, SpeexCallback *callback_list, void *state);
101 
103 int speex_std_mode_request_handler(SpeexBits *bits, void *state, void *data);
104 
106 int speex_std_high_mode_request_handler(SpeexBits *bits, void *state, void *data);
107 
109 int speex_std_char_handler(SpeexBits *bits, void *state, void *data);
110 
112 int speex_default_user_handler(SpeexBits *bits, void *state, void *data);
113 
114 
115 
117 int speex_std_low_mode_request_handler(SpeexBits *bits, void *state, void *data);
118 
120 int speex_std_vbr_request_handler(SpeexBits *bits, void *state, void *data);
121 
123 int speex_std_enh_request_handler(SpeexBits *bits, void *state, void *data);
124 
126 int speex_std_vbr_quality_request_handler(SpeexBits *bits, void *state, void *data);
127 
128 
129 #ifdef __cplusplus
130 }
131 #endif
132 
134 #endif