- Timestamp:
- Mar 10, 2009 1:32:09 PM (16 years ago)
- Location:
- pjproject/branches/projects/aps-direct
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia-audiodev/symb_aps_dev.cpp
r2492 r2498 1131 1131 af->dev_info.default_samples_per_sec = 8000; 1132 1132 af->dev_info.caps = PJMEDIA_AUD_DEV_CAP_EXT_FORMAT | 1133 PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING |1133 //PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING | 1134 1134 PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING | 1135 1135 PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE | … … 1141 1141 af->dev_info.output_count = 1; 1142 1142 1143 af->dev_info.ext_fmt_cnt = 6; 1143 af->dev_info.ext_fmt_cnt = 5; 1144 1144 1145 af->dev_info.ext_fmt[0].id = PJMEDIA_FORMAT_AMR; 1146 af->dev_info.ext_fmt[0].bitrate = 7400; 1147 af->dev_info.ext_fmt[0].vad = PJ_TRUE; 1148 1145 1149 af->dev_info.ext_fmt[1].id = PJMEDIA_FORMAT_G729; 1150 af->dev_info.ext_fmt[1].bitrate = 8000; 1151 af->dev_info.ext_fmt[1].vad = PJ_FALSE; 1152 1146 1153 af->dev_info.ext_fmt[2].id = PJMEDIA_FORMAT_ILBC; 1154 af->dev_info.ext_fmt[2].bitrate = 13333; 1155 af->dev_info.ext_fmt[2].vad = PJ_TRUE; 1156 1147 1157 af->dev_info.ext_fmt[3].id = PJMEDIA_FORMAT_PCMU; 1158 af->dev_info.ext_fmt[3].bitrate = 64000; 1159 af->dev_info.ext_fmt[3].vad = PJ_FALSE; 1160 1148 1161 af->dev_info.ext_fmt[4].id = PJMEDIA_FORMAT_PCMA; 1149 af->dev_info.ext_fmt[5].id = PJMEDIA_FORMAT_L16; 1162 af->dev_info.ext_fmt[4].bitrate = 64000; 1163 af->dev_info.ext_fmt[4].vad = PJ_FALSE; 1150 1164 1151 1165 PJ_LOG(4, (THIS_FILE, "APS initialized")); … … 1207 1221 param->bits_per_sample = BITS_PER_SAMPLE; 1208 1222 param->flags = PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE; 1209 param->ext_fmt.id = PJMEDIA_FORMAT_L16;1210 1223 param->output_route = PJMEDIA_AUD_DEV_ROUTE_EARPIECE; 1211 1224 … … 1359 1372 1360 1373 pj_memcpy(pi, &strm->param, sizeof(*pi)); 1374 1375 /* Update the output volume setting */ 1376 if (stream_get_cap(s, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, 1377 &pi->output_vol) == PJ_SUCCESS) 1378 { 1379 pi->flags |= PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING; 1380 } 1361 1381 1362 1382 return PJ_SUCCESS; … … 1380 1400 } 1381 1401 break; 1402 1403 /* There is a case that GetMaxGain() stucks, e.g: in N95. */ 1404 /* 1382 1405 case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: 1383 1406 if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { … … 1395 1418 } 1396 1419 break; 1420 */ 1421 1397 1422 case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: 1398 1423 if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { … … 1453 1478 } 1454 1479 break; 1480 1481 /* There is a case that GetMaxGain() stucks, e.g: in N95. */ 1482 /* 1455 1483 case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: 1456 1484 if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { … … 1467 1495 status = PJMEDIA_EAUD_NOTREADY; 1468 1496 } 1469 } 1470 break; 1497 if (status == PJ_SUCCESS) 1498 strm->param.input_vol = *(unsigned*)pval; 1499 } 1500 break; 1501 */ 1502 1471 1503 case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: 1472 if (strm->param.dir & PJMEDIA_DIR_ CAPTURE) {1504 if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { 1473 1505 PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); 1474 1506 … … 1483 1515 status = PJMEDIA_EAUD_NOTREADY; 1484 1516 } 1517 if (status == PJ_SUCCESS) 1518 strm->param.output_vol = *(unsigned*)pval; 1485 1519 } 1486 1520 break; -
pjproject/branches/projects/aps-direct/pjsip-apps/src/symbian_ua/ua.cpp
r2491 r2498 535 535 case 't': 536 536 { 537 pjmedia_aud_stream *aud_stream = pjsua_get_aud_stream(); 538 539 if (aud_stream) { 540 pjmedia_aud_dev_route route; 541 pj_status_t status; 542 543 status = pjmedia_aud_stream_get_cap( 544 aud_stream, 545 PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE, 546 &route); 547 if (status == PJ_SUCCESS) { 548 if (route == PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER) 549 route = PJMEDIA_AUD_DEV_ROUTE_EARPIECE; 550 else 551 route = PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; 552 553 status = pjmedia_aud_stream_set_cap( 554 aud_stream, 555 PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE, 556 &route); 557 } 558 559 if (status != PJ_SUCCESS) 560 pjsua_perror(THIS_FILE, "Error switch audio route", status); 561 } else { 562 PJ_LOG(3,(THIS_FILE, "No active sound device.")); 537 pjmedia_aud_dev_route route; 538 pj_status_t status; 539 540 status = pjsua_snd_get_setting(PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE, 541 &route); 542 543 if (status == PJ_SUCCESS) { 544 if (route == PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER) 545 route = PJMEDIA_AUD_DEV_ROUTE_EARPIECE; 546 else 547 route = PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; 548 549 status = pjsua_snd_set_setting( 550 PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE, 551 &route, PJ_TRUE); 563 552 } 553 554 if (status != PJ_SUCCESS) 555 pjsua_perror(THIS_FILE, "Error switch audio route", status); 564 556 } 565 557 break;
Note: See TracChangeset
for help on using the changeset viewer.