- Timestamp:
- Feb 16, 2009 4:29:05 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/aps-direct/pjsip-apps/src/symbian_ua/ua.cpp
r2450 r2456 93 93 94 94 static pj_pool_t *app_pool; 95 static pjmedia_snd_port * snd_port;95 static pjmedia_snd_port *g_snd_port; 96 96 97 97 … … 134 134 if (call_id == g_call_id) 135 135 g_call_id = PJSUA_INVALID_ID; 136 if (snd_port) {137 pjmedia_snd_port_destroy(snd_port);138 snd_port = NULL;139 }140 136 } else if (ci.state != PJSIP_INV_STATE_INCOMING) { 141 137 if (g_call_id == PJSUA_INVALID_ID) … … 270 266 unsigned samples_per_frame; 271 267 pj_status_t status; 268 269 PJ_UNUSED_ARG(call_id); 270 PJ_UNUSED_ARG(p_port); 272 271 273 272 status = pjmedia_session_get_info(sess, &sess_info); … … 289 288 setting.vad = strm_info->param->setting.vad; 290 289 setting.plc = strm_info->param->setting.plc; 291 if (setting.format.u32 == PJMEDIA_FO URCC_ILBC) {290 if (setting.format.u32 == PJMEDIA_FORMAT_ILBC) { 292 291 unsigned i; 293 292 pjmedia_codec_fmtp *fmtp = &strm_info->param->setting.dec_fmtp; … … 315 314 /* Reset conference attributes. */ 316 315 conf->info.samples_per_frame = samples_per_frame; 317 conf->info.clock_rate = 8000;318 conf->info.channel_count = 1;316 conf->info.clock_rate = strm_info->param->info.clock_rate; 317 conf->info.channel_count = strm_info->param->info.channel_cnt; 319 318 conf->info.bits_per_sample = 16; 319 conf->info.format = strm_info->param->info.format; 320 320 321 321 /* Reopen sound device. */ … … 324 324 0, 325 325 0, 326 8000,327 1,326 strm_info->param->info.clock_rate, 327 strm_info->param->info.channel_cnt, 328 328 samples_per_frame, 329 329 16, 330 330 &setting, 331 & snd_port);331 &g_snd_port); 332 332 if (status != PJ_SUCCESS) { 333 333 PJ_LOG(1,(THIS_FILE, "on_stream_created() failed to reopen sound " … … 336 336 } 337 337 338 status = pjmedia_snd_port_connect( snd_port, conf);338 status = pjmedia_snd_port_connect(g_snd_port, conf); 339 339 if (status != PJ_SUCCESS) { 340 340 PJ_LOG(1,(THIS_FILE, "on_stream_created() failed to connect sound " 341 341 "device to conference, status=%d", status)); 342 342 return; 343 } 344 } 345 346 static void on_stream_destroyed(pjsua_call_id call_id, 347 pjmedia_session *sess, 348 unsigned stream_idx) 349 { 350 PJ_UNUSED_ARG(call_id); 351 PJ_UNUSED_ARG(sess); 352 PJ_UNUSED_ARG(stream_idx); 353 354 if (g_snd_port) { 355 pjmedia_snd_port_destroy(g_snd_port); 356 g_snd_port = NULL; 343 357 } 344 358 } … … 407 421 cfg.cb.on_nat_detect = &on_nat_detect; 408 422 cfg.cb.on_stream_created = &on_stream_created; 423 cfg.cb.on_stream_destroyed = &on_stream_destroyed; 409 424 410 425 if (SIP_PROXY) { … … 429 444 log_cfg.console_level = LOG_LEVEL; 430 445 log_cfg.cb = &log_writer; 431 //log_cfg.log_filename = pj_str("C:\\data\\symbian_ua.log");446 log_cfg.log_filename = pj_str("C:\\data\\symbian_ua.log"); 432 447 433 448 pjsua_media_config_default(&med_cfg); … … 621 636 # if PJMEDIA_SOUND_IMPLEMENTATION == PJMEDIA_SOUND_SYMB_APS_SOUND 622 637 case 't': 623 if ( snd_port) {638 if (g_snd_port) { 624 639 static pj_bool_t act_loudspk = PJ_TRUE; 625 640 pjmedia_snd_stream *strm; 626 641 627 strm = pjmedia_snd_port_get_snd_stream( snd_port);642 strm = pjmedia_snd_port_get_snd_stream(g_snd_port); 628 643 pjmedia_snd_aps_activate_loudspeaker(strm, act_loudspk); 629 644 act_loudspk = !act_loudspk; … … 998 1013 #endif 999 1014 1000 if ( snd_port) {1001 pjmedia_snd_port_destroy( snd_port);1002 snd_port = NULL;1015 if (g_snd_port) { 1016 pjmedia_snd_port_destroy(g_snd_port); 1017 g_snd_port = NULL; 1003 1018 } 1004 1019
Note: See TracChangeset
for help on using the changeset viewer.