~ubuntu-branches/ubuntu/quantal/linphone/quantal

« back to all changes in this revision

Viewing changes to speex/libspeex/speex_callbacks.h

  • Committer: Bazaar Package Importer
  • Author(s): Samuel Mimram
  • Date: 2004-06-30 13:58:16 UTC
  • Revision ID: james.westby@ubuntu.com-20040630135816-wwx75gdlodkqbabb
Tags: upstream-0.12.2
ImportĀ upstreamĀ versionĀ 0.12.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2002 Jean-Marc Valin*/
 
2
/**
 
3
  @file speex_callbacks.h
 
4
  @brief Describes callback handling and in-band signalling
 
5
*/
 
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
 
 
39
#include "speex.h"
 
40
 
 
41
#ifdef __cplusplus
 
42
extern "C" {
 
43
#endif
 
44
 
 
45
/** Total number of callbacks */
 
46
#define SPEEX_MAX_CALLBACKS 16
 
47
 
 
48
/* Describes all the in-band requests */
 
49
 
 
50
/*These are 1-bit requests*/
 
51
/** Request for perceptual enhancement (1 for on, 0 for off) */
 
52
#define SPEEX_INBAND_ENH_REQUEST         0
 
53
/** Reserved */
 
54
#define SPEEX_INBAND_RESERVED1           1
 
55
 
 
56
/*These are 4-bit requests*/
 
57
/** Request for a mode change */
 
58
#define SPEEX_INBAND_MODE_REQUEST        2
 
59
/** Request for a low mode change */
 
60
#define SPEEX_INBAND_LOW_MODE_REQUEST    3
 
61
/** Request for a high mode change */
 
62
#define SPEEX_INBAND_HIGH_MODE_REQUEST   4
 
63
/** Request for VBR (1 on, 0 off) */
 
64
#define SPEEX_INBAND_VBR_QUALITY_REQUEST 5
 
65
/** Request to be sent acknowledge */
 
66
#define SPEEX_INBAND_ACKNOWLEDGE_REQUEST 6
 
67
/** Request for VBR (1 for on, 0 for off) */
 
68
#define SPEEX_INBAND_VBR_REQUEST         7
 
69
 
 
70
/*These are 8-bit requests*/
 
71
/** Send a character in-band */
 
72
#define SPEEX_INBAND_CHAR                8
 
73
/** Intensity stereo information */
 
74
#define SPEEX_INBAND_STEREO              9
 
75
 
 
76
/*These are 16-bit requests*/
 
77
/** Transmit max bit-rate allowed */
 
78
#define SPEEX_INBAND_MAX_BITRATE         10
 
79
 
 
80
/*These are 32-bit requests*/
 
81
/** Acknowledge packet reception */
 
82
#define SPEEX_INBAND_ACKNOWLEDGE         12
 
83
 
 
84
/** Callback function type */
 
85
typedef int (*speex_callback_func)(SpeexBits *bits, void *state, void *data);
 
86
 
 
87
/** Callback information */
 
88
typedef struct SpeexCallback {
 
89
   int callback_id;             /**< ID associated to the callback */
 
90
   speex_callback_func func;    /**< Callback handler function */
 
91
   void *data;                  /**< Data that will be sent to the handler */
 
92
   void *reserved1;             /**< Reserved for future use */
 
93
   int   reserved2;             /**< Reserved for future use */
 
94
} SpeexCallback;
 
95
 
 
96
/** Handle in-band request */
 
97
int speex_inband_handler(SpeexBits *bits, SpeexCallback *callback_list, void *state);
 
98
 
 
99
/** Standard handler for mode request (change mode, no questions asked) */
 
100
int speex_std_mode_request_handler(SpeexBits *bits, void *state, void *data);
 
101
 
 
102
/** Standard handler for high mode request (change high mode, no questions asked) */
 
103
int speex_std_high_mode_request_handler(SpeexBits *bits, void *state, void *data);
 
104
 
 
105
/** Standard handler for in-band characters (write to stderr) */
 
106
int speex_std_char_handler(SpeexBits *bits, void *state, void *data);
 
107
 
 
108
/** Default handler for user-defined requests: in this case, just ignore */
 
109
int speex_default_user_handler(SpeexBits *bits, void *state, void *data);
 
110
 
 
111
 
 
112
 
 
113
 
 
114
int speex_std_low_mode_request_handler(SpeexBits *bits, void *state, void *data);
 
115
 
 
116
int speex_std_vbr_request_handler(SpeexBits *bits, void *state, void *data);
 
117
 
 
118
int speex_std_enh_request_handler(SpeexBits *bits, void *state, void *data);
 
119
 
 
120
int speex_std_vbr_quality_request_handler(SpeexBits *bits, void *state, void *data);
 
121
 
 
122
 
 
123
#ifdef __cplusplus
 
124
}
 
125
#endif
 
126
 
 
127
 
 
128
#endif