Changeset 1735 for pjproject/trunk/pjmedia/src/pjmedia/errno.c
- Timestamp:
- Jan 23, 2008 8:39:07 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/errno.c
r1639 r1735 24 24 #endif 25 25 26 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 27 const char* get_libsrtp_errstr(int err); 28 #endif 26 29 27 30 … … 142 145 PJ_BUILD_ERR( PJMEDIA_ESNDINDEVID, "Invalid sound device ID" ), 143 146 PJ_BUILD_ERR( PJMEDIA_ESNDINSAMPLEFMT, "Invalid sample format for sound device" ), 147 148 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 149 /* SRTP transport errors: */ 150 PJ_BUILD_ERR( PJMEDIA_SRTP_ECRYPTONOTMATCH, "SRTP crypto-suite name not match the offerer tag" ), 151 PJ_BUILD_ERR( PJMEDIA_SRTP_EINKEYLEN, "Invalid SRTP key length for specific crypto" ), 152 PJ_BUILD_ERR( PJMEDIA_SRTP_ENOTSUPCRYPTO, "Unsupported SRTP crypto-suite" ), 153 PJ_BUILD_ERR( PJMEDIA_SRTP_ESDPAMBIGUEANS, "SRTP SDP contains ambigue answer" ), 154 PJ_BUILD_ERR( PJMEDIA_SRTP_ESDPDUPCRYPTOTAG,"Duplicated SRTP crypto tag" ), 155 PJ_BUILD_ERR( PJMEDIA_SRTP_ESDPINCRYPTO, "Invalid SRTP crypto attribute" ), 156 PJ_BUILD_ERR( PJMEDIA_SRTP_ESDPINCRYPTOTAG, "Invalid SRTP crypto tag" ), 157 PJ_BUILD_ERR( PJMEDIA_SRTP_ESDPINTRANSPORT, "Invalid SDP media transport for SRTP" ), 158 PJ_BUILD_ERR( PJMEDIA_SRTP_ESDPREQCRYPTO, "SRTP crypto attribute required" ), 159 PJ_BUILD_ERR( PJMEDIA_SRTP_ESDPREQSECTP, "Secure transport required in SDP media descriptor" ) 160 #endif 161 144 162 }; 145 163 … … 160 178 /* See if the error comes from PortAudio. */ 161 179 #if PJMEDIA_SOUND_IMPLEMENTATION==PJMEDIA_SOUND_PORTAUDIO_SOUND 162 if (statcode >= PJMEDIA_ ERRNO_FROM_PORTAUDIO(paNotInitialized)&&163 statcode < PJMEDIA_ERRNO_FROM_PORTAUDIO(paNotInitialized + 10000))180 if (statcode >= PJMEDIA_PORTAUDIO_ERRNO_START && 181 statcode <= PJMEDIA_PORTAUDIO_ERRNO_END) 164 182 { 165 183 166 int pa_err = statcode - PJMEDIA_ERRNO_FROM_PORTAUDIO(0); 184 //int pa_err = statcode - PJMEDIA_ERRNO_FROM_PORTAUDIO(0); 185 int pa_err = PJMEDIA_PORTAUDIO_ERRNO_START - statcode; 167 186 pj_str_t msg; 168 187 … … 176 195 } else 177 196 #endif /* PJMEDIA_SOUND_IMPLEMENTATION */ 197 198 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 199 /* LIBSRTP error */ 200 if (statcode >= PJMEDIA_LIBSRTP_ERRNO_START && 201 statcode < PJMEDIA_LIBSRTP_ERRNO_END) 202 { 203 int err = statcode - PJMEDIA_PORTAUDIO_ERRNO_START; 204 pj_str_t msg; 205 206 msg = pj_str((char*)get_libsrtp_errstr(err)); 207 208 pj_strncpy_with_null(&errstr, &msg, bufsize); 209 return errstr; 210 211 } else 212 #endif 213 214 /* PJMEDIA error */ 178 215 if (statcode >= PJMEDIA_ERRNO_START && 179 statcode < PJMEDIA_ERRNO_ START + PJ_ERRNO_SPACE_SIZE)216 statcode < PJMEDIA_ERRNO_END) 180 217 { 181 218 /* Find the error in the table. … … 212 249 213 250 } 214 } 215 251 } 216 252 #endif /* PJ_HAS_ERROR_STRING */ 217 253
Note: See TracChangeset
for help on using the changeset viewer.