1
/* $Id: errno.h 3553 2011-05-05 06:14:19Z nanang $ */
3
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
#ifndef __PJMEDIA_AUDIODEV_AUDIODEV_ERRNO_H__
20
#define __PJMEDIA_AUDIODEV_AUDIODEV_ERRNO_H__
23
* @file errno.h Error Codes
24
* @brief Audiodev specific error codes.
27
#include <pjmedia-audiodev/config.h>
31
* @defgroup error_codes Error Codes
32
* @ingroup audio_device_api
33
* @brief Audio devive library specific error codes.
42
* Start of error code relative to PJ_ERRNO_START_USER.
43
* This value is 420000.
45
#define PJMEDIA_AUDIODEV_ERRNO_START \
46
(PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*5)
47
#define PJMEDIA_AUDIODEV_ERRNO_END \
48
(PJMEDIA_AUDIODEV_ERRNO_START + PJ_ERRNO_SPACE_SIZE - 1)
52
* Mapping from PortAudio error codes to pjmedia error space.
54
#define PJMEDIA_AUDIODEV_PORTAUDIO_ERRNO_START \
55
(PJMEDIA_AUDIODEV_ERRNO_END-10000)
56
#define PJMEDIA_AUDIODEV_PORTAUDIO_ERRNO_END \
57
(PJMEDIA_AUDIODEV_PORTAUDIO_ERRNO_START + 10000 -1)
59
* Convert PortAudio error code to PJLIB error code.
60
* PortAudio error code range: 0 >= err >= -10000
62
#define PJMEDIA_AUDIODEV_ERRNO_FROM_PORTAUDIO(err) \
63
((int)PJMEDIA_AUDIODEV_PORTAUDIO_ERRNO_START-err)
66
* Mapping from Windows multimedia WaveIn error codes.
68
#define PJMEDIA_AUDIODEV_WMME_IN_ERROR_START \
69
(PJMEDIA_AUDIODEV_ERRNO_START + 30000)
70
#define PJMEDIA_AUDIODEV_WMME_IN_ERROR_END \
71
(PJMEDIA_AUDIODEV_WMME_IN_ERROR_START + 1000 - 1)
73
* Convert WaveIn operation error codes to PJLIB error space.
75
#define PJMEDIA_AUDIODEV_ERRNO_FROM_WMME_IN(err) \
76
((int)PJMEDIA_AUDIODEV_WMME_IN_ERROR_START+err)
80
* Mapping from Windows multimedia WaveOut error codes.
82
#define PJMEDIA_AUDIODEV_WMME_OUT_ERROR_START \
83
(PJMEDIA_AUDIODEV_WMME_IN_ERROR_END + 1000)
84
#define PJMEDIA_AUDIODEV_WMME_OUT_ERROR_END \
85
(PJMEDIA_AUDIODEV_WMME_OUT_ERROR_START + 1000)
87
* Convert WaveOut operation error codes to PJLIB error space.
89
#define PJMEDIA_AUDIODEV_ERRNO_FROM_WMME_OUT(err) \
90
((int)PJMEDIA_AUDIODEV_WMME_OUT_ERROR_START+err)
94
* Mapping from CoreAudio error codes to pjmedia error space.
96
#define PJMEDIA_AUDIODEV_COREAUDIO_ERRNO_START \
97
(PJMEDIA_AUDIODEV_ERRNO_START+20000)
98
#define PJMEDIA_AUDIODEV_COREAUDIO_ERRNO_END \
99
(PJMEDIA_AUDIODEV_COREAUDIO_ERRNO_START + 20000 -1)
101
* Convert CoreAudio error code to PJLIB error code.
102
* CoreAudio error code range: 0 >= err >= -10000
104
#define PJMEDIA_AUDIODEV_ERRNO_FROM_COREAUDIO(err) \
105
((int)PJMEDIA_AUDIODEV_COREAUDIO_ERRNO_START-err)
107
/************************************************************
108
* Audio Device API error codes
109
***********************************************************/
112
* General/unknown error.
114
#define PJMEDIA_EAUD_ERR (PJMEDIA_AUDIODEV_ERRNO_START+1) /* 420001 */
118
* Unknown error from audio driver
120
#define PJMEDIA_EAUD_SYSERR (PJMEDIA_AUDIODEV_ERRNO_START+2) /* 420002 */
124
* Audio subsystem not initialized
126
#define PJMEDIA_EAUD_INIT (PJMEDIA_AUDIODEV_ERRNO_START+3) /* 420003 */
130
* Invalid audio device
132
#define PJMEDIA_EAUD_INVDEV (PJMEDIA_AUDIODEV_ERRNO_START+4) /* 420004 */
138
#define PJMEDIA_EAUD_NODEV (PJMEDIA_AUDIODEV_ERRNO_START+5) /* 420005 */
142
* Unable to find default device
144
#define PJMEDIA_EAUD_NODEFDEV (PJMEDIA_AUDIODEV_ERRNO_START+6) /* 420006 */
150
#define PJMEDIA_EAUD_NOTREADY (PJMEDIA_AUDIODEV_ERRNO_START+7) /* 420007 */
154
* The audio capability is invalid or not supported
156
#define PJMEDIA_EAUD_INVCAP (PJMEDIA_AUDIODEV_ERRNO_START+8) /* 420008 */
160
* The operation is invalid or not supported
162
#define PJMEDIA_EAUD_INVOP (PJMEDIA_AUDIODEV_ERRNO_START+9) /* 420009 */
166
* Bad or invalid audio device format
168
#define PJMEDIA_EAUD_BADFORMAT (PJMEDIA_AUDIODEV_ERRNO_START+10) /* 4200010 */
172
* Invalid audio device sample format
174
#define PJMEDIA_EAUD_SAMPFORMAT (PJMEDIA_AUDIODEV_ERRNO_START+11) /* 4200011 */
178
* Bad latency setting
180
#define PJMEDIA_EAUD_BADLATENCY (PJMEDIA_AUDIODEV_ERRNO_START+12) /* 4200012 */
187
* Get error message for the specified error code. Note that this
188
* function is only able to decode PJMEDIA Audiodev specific error code.
189
* Application should use pj_strerror(), which should be able to
190
* decode all error codes belonging to all subsystems (e.g. pjlib,
191
* pjmedia, pjsip, etc).
193
* @param status The error code.
194
* @param buffer The buffer where to put the error message.
195
* @param bufsize Size of the buffer.
197
* @return The error message as NULL terminated string,
198
* wrapped with pj_str_t.
200
PJ_DECL(pj_str_t) pjmedia_audiodev_strerror(pj_status_t status, char *buffer,
211
#endif /* __PJMEDIA_AUDIODEV_AUDIODEV_ERRNO_H__ */