Debian Codegraph @

Xpjproject/pjmedia/include/pjmedia-audiodev/errno.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program 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
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18 #ifndef __PJMEDIA_AUDIODEV_AUDIODEV_ERRNO_H__
19 #define __PJMEDIA_AUDIODEV_AUDIODEV_ERRNO_H__
20
21 /**
22 * @file errno.h Error Codes
23 * @brief Audiodev specific error codes.
24 */
25
26 #include <pjmedia-audiodev/config.h>
27 #include <pj/errno.h>
28
29 /**
30 * @defgroup error_codes Error Codes
31 * @ingroup audio_device_api
32 * @brief Audio devive library specific error codes.
33 * @{
34 */
35
36
37 PJ_BEGIN_DECL
38
39
40 /**
41 * Start of error code relative to PJ_ERRNO_START_USER.
42 * This value is 420000.
43 */
44 #define PJMEDIA_AUDIODEV_ERRNO_START \
45 (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*5)
46 #define PJMEDIA_AUDIODEV_ERRNO_END \
47 (PJMEDIA_AUDIODEV_ERRNO_START + PJ_ERRNO_SPACE_SIZE - 1)
48
49
50 /**
51 * Mapping from PortAudio error codes to pjmedia error space.
52 */
53 #define PJMEDIA_AUDIODEV_PORTAUDIO_ERRNO_START \
54 (PJMEDIA_AUDIODEV_ERRNO_END-10000)
55 #define PJMEDIA_AUDIODEV_PORTAUDIO_ERRNO_END \
56 (PJMEDIA_AUDIODEV_PORTAUDIO_ERRNO_START + 10000 -1)
57 /**
58 * Convert PortAudio error code to PJLIB error code.
59 * PortAudio error code range: 0 >= err >= -10000
60 */
61 #define PJMEDIA_AUDIODEV_ERRNO_FROM_PORTAUDIO(err) \
62 ((int)PJMEDIA_AUDIODEV_PORTAUDIO_ERRNO_START-err)
63
64 /**
65 * Mapping from Windows multimedia WaveIn error codes.
66 */
67 #define PJMEDIA_AUDIODEV_WMME_IN_ERROR_START \
68 (PJMEDIA_AUDIODEV_ERRNO_START + 30000)
69 #define PJMEDIA_AUDIODEV_WMME_IN_ERROR_END \
70 (PJMEDIA_AUDIODEV_WMME_IN_ERROR_START + 1000 - 1)
71 /**
72 * Convert WaveIn operation error codes to PJLIB error space.
73 */
74 #define PJMEDIA_AUDIODEV_ERRNO_FROM_WMME_IN(err) \
75 ((int)PJMEDIA_AUDIODEV_WMME_IN_ERROR_START+err)
76
77
78 /**
79 * Mapping from Windows multimedia WaveOut error codes.
80 */
81 #define PJMEDIA_AUDIODEV_WMME_OUT_ERROR_START \
82 (PJMEDIA_AUDIODEV_WMME_IN_ERROR_END + 1000)
83 #define PJMEDIA_AUDIODEV_WMME_OUT_ERROR_END \
84 (PJMEDIA_AUDIODEV_WMME_OUT_ERROR_START + 1000)
85 /**
86 * Convert WaveOut operation error codes to PJLIB error space.
87 */
88 #define PJMEDIA_AUDIODEV_ERRNO_FROM_WMME_OUT(err) \
89 ((int)PJMEDIA_AUDIODEV_WMME_OUT_ERROR_START+err)
90
91
92 /**
93 * Mapping from CoreAudio error codes to pjmedia error space.
94 */
95 #define PJMEDIA_AUDIODEV_COREAUDIO_ERRNO_START \
96 (PJMEDIA_AUDIODEV_ERRNO_START+20000)
97 #define PJMEDIA_AUDIODEV_COREAUDIO_ERRNO_END \
98 (PJMEDIA_AUDIODEV_COREAUDIO_ERRNO_START + 20000 -1)
99 /**
100 * Convert CoreAudio error code to PJLIB error code.
101 * CoreAudio error code range: 0 >= err >= -10000
102 */
103 #define PJMEDIA_AUDIODEV_ERRNO_FROM_COREAUDIO(err) \
104 ((int)PJMEDIA_AUDIODEV_COREAUDIO_ERRNO_START-err)
105
106 /**
107 * Mapping from BDIMAD error codes to pjmedia error space.
108 */
109 #define PJMEDIA_AUDIODEV_BDIMAD_ERROR_START \
110 (PJMEDIA_AUDIODEV_ERRNO_START + 40000)
111 #define PJMEDIA_AUDIODEV_BDIMAD_ERROR_END \
112 (PJMEDIA_AUDIODEV_BDIMAD_ERROR_START + 2000 - 1)
113 /**
114 * Convert BDIMAD error codes to PJLIB error space.
115 */
116 #define PJMEDIA_AUDIODEV_ERRNO_FROM_BDIMAD(err) \
117 ((int)PJMEDIA_AUDIODEV_BDIMAD_ERROR_START+err)
118
119 /************************************************************
120 * Audio Device API error codes
121 ***********************************************************/
122 /**
123 * @hideinitializer
124 * General/unknown error.
125 */
126 #define PJMEDIA_EAUD_ERR (PJMEDIA_AUDIODEV_ERRNO_START+1) /* 420001 */
127
128 /**
129 * @hideinitializer
130 * Unknown error from audio driver
131 */
132 #define PJMEDIA_EAUD_SYSERR (PJMEDIA_AUDIODEV_ERRNO_START+2) /* 420002 */
133
134 /**
135 * @hideinitializer
136 * Audio subsystem not initialized
137 */
138 #define PJMEDIA_EAUD_INIT (PJMEDIA_AUDIODEV_ERRNO_START+3) /* 420003 */
139
140 /**
141 * @hideinitializer
142 * Invalid audio device
143 */
144 #define PJMEDIA_EAUD_INVDEV (PJMEDIA_AUDIODEV_ERRNO_START+4) /* 420004 */
145
146 /**
147 * @hideinitializer
148 * Found no devices
149 */
150 #define PJMEDIA_EAUD_NODEV (PJMEDIA_AUDIODEV_ERRNO_START+5) /* 420005 */
151
152 /**
153 * @hideinitializer
154 * Unable to find default device
155 */
156 #define PJMEDIA_EAUD_NODEFDEV (PJMEDIA_AUDIODEV_ERRNO_START+6) /* 420006 */
157
158 /**
159 * @hideinitializer
160 * Device not ready
161 */
162 #define PJMEDIA_EAUD_NOTREADY (PJMEDIA_AUDIODEV_ERRNO_START+7) /* 420007 */
163
164 /**
165 * @hideinitializer
166 * The audio capability is invalid or not supported
167 */
168 #define PJMEDIA_EAUD_INVCAP (PJMEDIA_AUDIODEV_ERRNO_START+8) /* 420008 */
169
170 /**
171 * @hideinitializer
172 * The operation is invalid or not supported
173 */
174 #define PJMEDIA_EAUD_INVOP (PJMEDIA_AUDIODEV_ERRNO_START+9) /* 420009 */
175
176 /**
177 * @hideinitializer
178 * Bad or invalid audio device format
179 */
180 #define PJMEDIA_EAUD_BADFORMAT (PJMEDIA_AUDIODEV_ERRNO_START+10) /* 4200010 */
181
182 /**
183 * @hideinitializer
184 * Invalid audio device sample format
185 */
186 #define PJMEDIA_EAUD_SAMPFORMAT (PJMEDIA_AUDIODEV_ERRNO_START+11) /* 4200011 */
187
188 /**
189 * @hideinitializer
190 * Bad latency setting
191 */
192 #define PJMEDIA_EAUD_BADLATENCY (PJMEDIA_AUDIODEV_ERRNO_START+12) /* 4200012 */
193
194 /**
195 * @hideinitializer
196 * General WASAPI error
197 */
198 #define PJMEDIA_EAUD_WASAPI_ERROR \
199 (PJMEDIA_AUDIODEV_ERRNO_START+13) /* 4200013 */
200
201 /**
202 * Get error message for the specified error code. Note that this
203 * function is only able to decode PJMEDIA Audiodev specific error code.
204 * Application should use pj_strerror(), which should be able to
205 * decode all error codes belonging to all subsystems (e.g. pjlib,
206 * pjmedia, pjsip, etc).
207 *
208 * @param status The error code.
209 * @param buffer The buffer where to put the error message.
210 * @param bufsize Size of the buffer.
211 *
212 * @return The error message as NULL terminated string,
213 * wrapped with pj_str_t.
214 */
215 PJ_DECL(pj_str_t) pjmedia_audiodev_strerror(pj_status_t status, char *buffer,
216 pj_size_t bufsize);
217
218
219 PJ_END_DECL
220
221 /**
222 * @}
223 */
224
225
226 #endif /* __PJMEDIA_AUDIODEV_AUDIODEV_ERRNO_H__ */
227