Changeset 4708
- Timestamp:
- Jan 21, 2014 10:59:25 AM (11 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/samples/pjsua2_demo.cpp
r4704 r4708 92 92 void MyCall::onCallState(OnCallStateParam &prm) 93 93 { 94 PJ_UNUSED_ARG(prm); 95 94 96 CallInfo ci = getInfo(); 95 97 std::cout << "*** Call: " << ci.remoteUri << " [" << ci.stateText … … 205 207 } 206 208 209 210 void mainProg3() throw(Error) 211 { 212 Endpoint ep; 213 214 // Create library 215 ep.libCreate(); 216 217 // Init library 218 EpConfig ep_cfg; 219 ep.libInit( ep_cfg ); 220 221 // Start library 222 ep.libStart(); 223 std::cout << "*** PJSUA2 STARTED ***" << std::endl; 224 225 // Create player and recorder 226 { 227 AudioMediaPlayer amp; 228 amp.createPlayer("../../tests/pjsua/wavs/input.16.wav"); 229 230 AudioMediaRecorder amr; 231 amr.createRecorder("recorder_test_output.wav"); 232 233 amp.startTransmit(ep.audDevManager().getPlaybackDevMedia()); 234 amp.startTransmit(amr); 235 236 pj_thread_sleep(5000); 237 } 238 239 ep.libDestroy(); 240 } 241 242 207 243 void mainProg() throw(Error) 208 244 { … … 272 308 { 273 309 Endpoint ep; 274 ep.natDetectType();275 {276 }277 310 } 278 311 279 312 try { 280 mainProg 1();313 mainProg3(); 281 314 std::cout << "Success" << std::endl; 282 315 } catch (Error & err) { -
pjproject/trunk/pjsip/src/pjsua2/media.cpp
r4704 r4708 248 248 AudioMediaPlayer::~AudioMediaPlayer() 249 249 { 250 if (playerId != PJSUA_INVALID_ID) 250 if (playerId != PJSUA_INVALID_ID) { 251 unregisterMediaPort(); 251 252 pjsua_player_destroy(playerId); 253 } 252 254 } 253 255 … … 256 258 throw(Error) 257 259 { 260 if (playerId != PJSUA_INVALID_ID) { 261 PJSUA2_RAISE_ERROR(PJ_EEXISTS); 262 } 263 258 264 pj_str_t pj_name = str2Pj(file_name); 259 265 … … 273 279 throw(Error) 274 280 { 281 if (playerId != PJSUA_INVALID_ID) { 282 PJSUA2_RAISE_ERROR(PJ_EEXISTS); 283 } 284 275 285 pj_str_t pj_files[MAX_FILE_NAMES]; 276 286 unsigned i, count = 0; … … 318 328 AudioMediaRecorder::~AudioMediaRecorder() 319 329 { 320 if (recorderId != PJSUA_INVALID_ID) 330 if (recorderId != PJSUA_INVALID_ID) { 331 unregisterMediaPort(); 321 332 pjsua_recorder_destroy(recorderId); 333 } 322 334 } 323 335 … … 329 341 { 330 342 PJ_UNUSED_ARG(max_size); 343 344 if (recorderId != PJSUA_INVALID_ID) { 345 PJSUA2_RAISE_ERROR(PJ_EEXISTS); 346 } 331 347 332 348 pj_str_t pj_name = str2Pj(file_name);
Note: See TracChangeset
for help on using the changeset viewer.