- Timestamp:
- Feb 10, 2009 4:43:16 AM (16 years ago)
- Location:
- pjproject/branches/projects/aps-direct/pjmedia
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/aps-direct/pjmedia/include/pjmedia/port.h
r2444 r2445 301 301 PJ_INLINE(void) pjmedia_frame_ext_append_subframe(pjmedia_frame_ext *frm, 302 302 const void *src, 303 pj_uint16_t bitlen, 304 pj_uint16_t samples_cnt) 305 { 303 unsigned bitlen, 304 unsigned samples_cnt) 305 { 306 pjmedia_frame_ext_subframe *fsub; 306 307 pj_uint8_t *p; 307 unsigned i , tmp;308 unsigned i; 308 309 309 310 p = (pj_uint8_t*)frm + sizeof(pjmedia_frame_ext); 310 311 for (i = 0; i < frm->subframe_cnt; ++i) { 311 pjmedia_frame_ext_subframe *fsub;312 312 fsub = (pjmedia_frame_ext_subframe*) p; 313 p += sizeof(fsub->bitlen) + (fsub->bitlen >> 3); 314 if (fsub->bitlen & 0x07) 315 ++p; 313 p += sizeof(fsub->bitlen) + ((fsub->bitlen+7) >> 3); 316 314 } 317 315 318 tmp = bitlen >> 3; 319 if (bitlen & 0x07) 320 ++tmp; 321 322 pj_memcpy(p, &bitlen, sizeof(bitlen)); 323 if (tmp) 324 pj_memcpy(p + sizeof(bitlen), src, tmp); 316 fsub = (pjmedia_frame_ext_subframe*) p; 317 fsub->bitlen = (pj_uint16_t)bitlen; 318 if (bitlen) 319 pj_memcpy(fsub->data, src, (bitlen+7) >> 3); 325 320 326 321 frm->subframe_cnt++; 327 frm->samples_cnt = frm->samples_cnt + samples_cnt;322 frm->samples_cnt = frm->samples_cnt + (pj_uint16_t)samples_cnt; 328 323 } 329 324 … … 349 344 for (i = 0; i < n; ++i) { 350 345 sf = (pjmedia_frame_ext_subframe*) p; 351 p += sizeof(sf->bitlen) + (sf->bitlen >> 3); 352 if (sf->bitlen & 0x07) 353 ++p; 346 p += sizeof(sf->bitlen) + ((sf->bitlen+7) >> 3); 354 347 } 355 348 … … 384 377 sf = pjmedia_frame_ext_get_subframe(frm, frm->subframe_cnt-1); 385 378 move_len = (pj_uint8_t*)sf - move_src + sizeof(sf->bitlen) + 386 (sf->bitlen >> 3); 387 if (sf->bitlen & 0x07) 388 ++move_len; 379 ((sf->bitlen+7) >> 3); 389 380 pj_memmove((pj_uint8_t*)frm+sizeof(pjmedia_frame_ext), 390 381 move_src, move_len); -
pjproject/branches/projects/aps-direct/pjmedia/include/pjmedia/types.h
r2444 r2445 197 197 */ 198 198 #define PJMEDIA_FOURCC_L16 PJMEDIA_FOURCC_PACK(' ', 'L', '1', '6') 199 #define PJMEDIA_FOURCC_ G711A PJMEDIA_FOURCC_PACK('G', '7', '1', '1')200 #define PJMEDIA_FOURCC_ G711U PJMEDIA_FOURCC_PACK('U', 'L', 'A', 'W')199 #define PJMEDIA_FOURCC_PCMA PJMEDIA_FOURCC_PACK('A', 'L', 'A', 'W') 200 #define PJMEDIA_FOURCC_PCMU PJMEDIA_FOURCC_PACK('u', 'L', 'A', 'W') 201 201 #define PJMEDIA_FOURCC_AMR PJMEDIA_FOURCC_PACK(' ', 'A', 'M', 'R') 202 202 #define PJMEDIA_FOURCC_G729 PJMEDIA_FOURCC_PACK('G', '7', '2', '9') -
pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia-codec/passthrough.c
r2444 r2445 163 163 unsigned max_bitrate; /* Maximum bitrate of this codec. */ 164 164 pj_uint8_t frm_per_pkt; /* Default num of frames per packet.*/ 165 pj_uint8_t vad; /* VAD enabled/disabled. */ 166 pj_uint8_t plc; /* PLC enabled/disabled. */ 165 167 parse_cb parse; /* Callback to parse bitstream. */ 166 168 pack_cb pack; /* Callback to pack bitstream. */ … … 173 175 {1, "AMR", PJMEDIA_RTP_PT_AMR, {PJMEDIA_FOURCC_AMR}, 174 176 8000, 1, 160, 175 12200, 12200, 2,177 7400, 12200, 2, 1, 1, 176 178 &parse_amr, &pack_amr 177 179 /*, {1, {{{"octet-align", 11}, {"1", 1}}} } */ … … 182 184 {1, "G729", PJMEDIA_RTP_PT_G729, {PJMEDIA_FOURCC_G729}, 183 185 8000, 1, 80, 184 8000, 8000, 2 186 8000, 8000, 2, 1, 1 185 187 }, 186 188 # endif … … 189 191 {1, "iLBC", PJMEDIA_RTP_PT_ILBC, {PJMEDIA_FOURCC_ILBC}, 190 192 8000, 1, 240, 191 13333, 15200, 2,193 13333, 15200, 1, 1, 1, 192 194 NULL, NULL, 193 195 {1, {{{"mode", 4}, {"30", 2}}} } … … 196 198 197 199 # if PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU 198 {1, "PCMU", PJMEDIA_RTP_PT_PCMU, {PJMEDIA_FOURCC_ G711U},200 {1, "PCMU", PJMEDIA_RTP_PT_PCMU, {PJMEDIA_FOURCC_PCMU}, 199 201 8000, 1, 80, 200 64000, 64000, 2 202 64000, 64000, 2, 1, 1 201 203 }, 202 204 # endif 203 205 204 206 # if PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA 205 {1, "PCMA", PJMEDIA_RTP_PT_PCMA, {PJMEDIA_FOURCC_ G711A},207 {1, "PCMA", PJMEDIA_RTP_PT_PCMA, {PJMEDIA_FOURCC_PCMA}, 206 208 8000, 1, 80, 207 64000, 64000, 2 209 64000, 64000, 2, 1, 1 208 210 }, 209 211 # endif … … 247 249 248 250 sf = pjmedia_frame_ext_get_subframe(input, i); 249 250 len = sf->bitlen >> 3; 251 if (sf->bitlen & 0x07) 252 ++len; 251 len = (sf->bitlen + 7) >> 3; 253 252 254 253 info = (pjmedia_codec_amr_bit_info*) &frames[i].bit_info; 255 254 pj_bzero(info, sizeof(*info)); 256 info->frame_type = pjmedia_codec_amr_get_mode2(enc_setting->amr_nb, 257 len); 255 256 if (len == 0) { 257 info->frame_type = (pj_uint8_t)(enc_setting->amr_nb? 14 : 15); 258 } else { 259 info->frame_type = pjmedia_codec_amr_get_mode2(enc_setting->amr_nb, 260 len); 261 } 258 262 info->good_quality = 1; 259 263 info->mode = setting->enc_mode; … … 450 454 /* Default flags. */ 451 455 attr->setting.frm_per_pkt = codec_desc[i].frm_per_pkt; 452 attr->setting.plc = 0;456 attr->setting.plc = codec_desc[i].plc; 453 457 attr->setting.penh= 0; 454 attr->setting.vad = 0;458 attr->setting.vad = codec_desc[i].vad; 455 459 attr->setting.cng = attr->setting.vad; 456 460 attr->setting.dec_fmtp = codec_desc[i].dec_fmtp; … … 759 763 sf = pjmedia_frame_ext_get_subframe(input_, i); 760 764 pj_assert(sf); 761 762 sf_len = sf->bitlen >> 3; 763 if (sf->bitlen & 0x07) 764 ++sf_len; 765 766 sf_len = (sf->bitlen + 7) >> 3; 765 767 766 768 pj_memcpy(p, sf->data, sf_len); 767 769 p += sf_len; 768 770 output->size += sf_len; 771 772 #if PJMEDIA_HAS_INTEL_IPP_CODEC_G729 773 /* If there is SID or DTX frame, break the loop. */ 774 if (desc->pt == PJMEDIA_RTP_PT_G729 && 775 sf_len < codec_data->avg_frame_size) 776 { 777 break; 778 } 779 #endif 780 769 781 } 770 782 } -
pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia/conf_switch.c
r2444 r2445 52 52 #define INVALID_SLOT ((SLOT_TYPE)-1) 53 53 #define BUFFER_SIZE PJMEDIA_MAX_MTU 54 #define MAX_LEVEL (32767) 55 #define MIN_LEVEL (-32768) 54 56 55 57 /* … … 153 155 conf_port->tx_setting = PJMEDIA_PORT_ENABLE; 154 156 157 /* Default level adjustment is 128 (which means no adjustment) */ 158 conf_port->tx_adj_level = NORMAL_LEVEL; 159 conf_port->rx_adj_level = NORMAL_LEVEL; 160 155 161 /* Create transmit flag array */ 156 162 conf_port->listener_slots = (SLOT_TYPE*) … … 166 172 f = (pjmedia_frame*)conf_port->tx_buf; 167 173 f->buf = conf_port->tx_buf + sizeof(pjmedia_frame); 168 f->size = 0;169 174 170 175 /* Done */ … … 673 678 674 679 if (i != src_port->listener_cnt) { 680 pjmedia_frame_ext *f; 681 675 682 pj_assert(src_port->listener_cnt > 0 && 676 683 src_port->listener_cnt < conf->max_ports); … … 683 690 --dst_port->transmitter_cnt; 684 691 685 /* Clean up sink TX buffer. */ 686 pj_bzero(dst_port->tx_buf, sizeof(pjmedia_frame_ext)); 692 /* Cleanup listener TX buffer. */ 693 f = (pjmedia_frame_ext*)dst_port->tx_buf; 694 f->base.type = PJMEDIA_FRAME_TYPE_NONE; 695 f->base.size = 0; 696 f->samples_cnt = 0; 697 f->subframe_cnt = 0; 687 698 688 699 PJ_LOG(4,(THIS_FILE, … … 777 788 unsigned dst_slot; 778 789 struct conf_port *dst_port; 790 pjmedia_frame_ext *f; 779 791 780 792 dst_slot = conf_port->listener_slots[conf_port->listener_cnt-1]; … … 785 797 --conf->connect_cnt; 786 798 787 /* Clean up TX buffer. */ 788 pj_bzero(dst_port->tx_buf, sizeof(pjmedia_frame_ext)); 799 /* Cleanup & reinit listener TX buffer. */ 800 f = (pjmedia_frame_ext*)dst_port->tx_buf; 801 f->base.type = PJMEDIA_FRAME_TYPE_NONE; 802 f->base.size = 0; 803 f->samples_cnt = 0; 804 f->subframe_cnt = 0; 789 805 } 790 806 … … 857 873 info->bits_per_sample = conf_port->info->bits_per_sample; 858 874 info->format = conf_port->port->info.format; 875 info->tx_adj_level = conf_port->tx_adj_level - NORMAL_LEVEL; 876 info->rx_adj_level = conf_port->rx_adj_level - NORMAL_LEVEL; 859 877 860 878 return PJ_SUCCESS; … … 935 953 conf_port = conf->ports[slot]; 936 954 955 /* Level adjustment is applicable only for ports that work with raw PCM. */ 956 PJ_ASSERT_RETURN(conf_port->info->format.u32 == 0 || 957 conf_port->info->format.u32 == PJMEDIA_FOURCC_L16, 958 PJ_EIGNORED); 959 937 960 /* Set normalized adjustment level. */ 938 961 conf_port->rx_adj_level = adj_level + NORMAL_LEVEL; … … 964 987 965 988 conf_port = conf->ports[slot]; 989 990 /* Level adjustment is applicable only for ports that work with raw PCM. */ 991 PJ_ASSERT_RETURN(conf_port->info->format.u32 == 0 || 992 conf_port->info->format.u32 == PJMEDIA_FOURCC_L16, 993 PJ_EIGNORED); 994 995 /* Set normalized adjustment level. */ 996 conf_port->tx_adj_level = adj_level + NORMAL_LEVEL; 966 997 967 998 return PJ_SUCCESS; … … 1032 1063 if (nsamples_to_copy > nsamples_req) 1033 1064 nsamples_to_copy = nsamples_req; 1065 1066 /* Adjust TX level. */ 1067 if (cport_dst->tx_adj_level != NORMAL_LEVEL) { 1068 pj_int16_t *p, *p_end; 1069 1070 p = f_start; 1071 p_end = p + nsamples_to_copy; 1072 while (p < p_end) { 1073 pj_int32_t itemp = *p; 1074 1075 /* Adjust the level */ 1076 itemp = (itemp * cport_dst->tx_adj_level) >> 7; 1077 1078 /* Clip the signal if it's too loud */ 1079 if (itemp > MAX_LEVEL) itemp = MAX_LEVEL; 1080 else if (itemp < MIN_LEVEL) itemp = MIN_LEVEL; 1081 1082 /* Put back in the buffer. */ 1083 *p = (pj_int16_t)itemp; 1084 ++p; 1085 } 1086 } 1034 1087 1035 1088 pjmedia_copy_samples((pj_int16_t*)frm_dst->buf + (frm_dst->size>>1), … … 1132 1185 unsigned ci, i; 1133 1186 1134 PJ_TODO(ADJUST_RX_TX_LEVEL_FOR_PCM_FRAMES);1135 1136 1187 /* Must lock mutex */ 1137 1188 pj_mutex_lock(conf->mutex); … … 1174 1225 pj_status_t status; 1175 1226 unsigned j; 1176 pj_int32_t level ;1227 pj_int32_t level = 0; 1177 1228 1178 1229 pj_add_timestamp32(&cport->ts_rx, cport->info->samples_per_frame); … … 1186 1237 continue; 1187 1238 1188 /* Calculate RX level. */1239 /* Calculate & adjust RX level. */ 1189 1240 if (f->type == PJMEDIA_FRAME_TYPE_AUDIO) { 1190 level = pjmedia_calc_avg_signal((const pj_int16_t*)f->buf, 1191 f->size >>1 ); 1241 if (cport->rx_adj_level != NORMAL_LEVEL) { 1242 pj_int16_t *p = (pj_int16_t*)f->buf; 1243 pj_int16_t *end; 1244 1245 end = p + (f->size >> 1); 1246 while (p < end) { 1247 pj_int32_t itemp = *p; 1248 1249 /* Adjust the level */ 1250 itemp = (itemp * cport->rx_adj_level) >> 7; 1251 1252 /* Clip the signal if it's too loud */ 1253 if (itemp > MAX_LEVEL) itemp = MAX_LEVEL; 1254 else if (itemp < MIN_LEVEL) itemp = MIN_LEVEL; 1255 1256 level += PJ_ABS(itemp); 1257 1258 /* Put back in the buffer. */ 1259 *p = (pj_int16_t)itemp; 1260 ++p; 1261 } 1262 level /= (f->size >> 1); 1263 } else { 1264 level = pjmedia_calc_avg_signal((const pj_int16_t*)f->buf, 1265 f->size >> 1); 1266 } 1192 1267 } else if (f->type == PJMEDIA_FRAME_TYPE_EXTENDED) { 1193 1268 /* For extended frame, TX level is unknown, so we just set … … 1195 1270 */ 1196 1271 level = NORMAL_LEVEL; 1197 } else { /* PJMEDIA_FRAME_TYPE_NONE */1198 level = 0;1199 1272 } 1273 1200 1274 cport->rx_level = pjmedia_linear2ulaw(level) ^ 0xff; 1201 1275 … … 1221 1295 } 1222 1296 1223 /* Set listener TX level equal to transmitter RX level. */ 1224 listener->tx_level = cport->rx_level; 1297 /* Set listener TX level based on transmitter RX level & 1298 * listener TX level. 1299 */ 1300 listener->tx_level = (cport->rx_level * listener->tx_adj_level) 1301 >> 8; 1225 1302 } 1226 1303 } … … 1242 1319 if (cport->tx_setting==PJMEDIA_PORT_MUTE || cport->transmitter_cnt==0) 1243 1320 { 1321 pjmedia_frame_ext *f; 1322 1244 1323 /* Clear left-over samples in tx_buffer, if any, so that it won't 1245 1324 * be transmitted next time we have audio signal. 1246 1325 */ 1247 pj_bzero(cport->tx_buf, sizeof(pjmedia_frame_ext)); 1326 f = (pjmedia_frame_ext*)cport->tx_buf; 1327 f->base.type = PJMEDIA_FRAME_TYPE_NONE; 1328 f->base.size = 0; 1329 f->samples_cnt = 0; 1330 f->subframe_cnt = 0; 1248 1331 1249 1332 cport->tx_level = 0; … … 1280 1363 1281 1364 if (f_src_->samples_cnt < this_cport->info->samples_per_frame) { 1282 pj_bzero(this_cport->tx_buf, sizeof(pjmedia_frame_ext)); 1283 frame->type = PJMEDIA_FRAME_TYPE_NONE; 1365 f_dst->base.type = PJMEDIA_FRAME_TYPE_NONE; 1366 f_dst->samples_cnt = 0; 1367 f_dst->subframe_cnt = 0; 1284 1368 break; 1285 1369 } … … 1303 1387 } else if (f_src->type == PJMEDIA_FRAME_TYPE_AUDIO) { 1304 1388 if ((f_src->size>>1) < this_cport->info->samples_per_frame) { 1305 pj_bzero(this_cport->tx_buf, sizeof(pjmedia_frame_ext));1306 1389 frame->type = PJMEDIA_FRAME_TYPE_NONE; 1390 frame->size = 0; 1307 1391 break; 1308 1392 } … … 1321 1405 f_src->size >> 1); 1322 1406 } else { /* PJMEDIA_FRAME_TYPE_NONE */ 1407 pjmedia_frame_ext *f_dst = (pjmedia_frame_ext*)frame; 1408 1323 1409 /* Reset TX buffer */ 1324 pj_bzero(this_cport->tx_buf, sizeof(pjmedia_frame_ext)); 1325 frame->type = PJMEDIA_FRAME_TYPE_NONE; 1410 f_dst->base.type = PJMEDIA_FRAME_TYPE_NONE; 1411 f_dst->samples_cnt = 0; 1412 f_dst->subframe_cnt = 0; 1326 1413 } 1327 1414 } while (0); … … 1342 1429 struct conf_port *cport = conf->ports[this_port->port_data.ldata]; 1343 1430 unsigned j; 1344 pj_int32_t level ;1431 pj_int32_t level = 0; 1345 1432 1346 1433 pj_add_timestamp32(&cport->ts_rx, cport->info->samples_per_frame); … … 1358 1445 } 1359 1446 1360 /* Calculate RX level. */1447 /* Calculate & adjust RX level. */ 1361 1448 if (f->type == PJMEDIA_FRAME_TYPE_AUDIO) { 1362 level = pjmedia_calc_avg_signal((const pj_int16_t*)f->buf, 1363 f->size >>1 ); 1449 if (cport->rx_adj_level != NORMAL_LEVEL) { 1450 pj_int16_t *p = (pj_int16_t*)f->buf; 1451 pj_int16_t *end; 1452 1453 end = p + (f->size >> 1); 1454 while (p < end) { 1455 pj_int32_t itemp = *p; 1456 1457 /* Adjust the level */ 1458 itemp = (itemp * cport->rx_adj_level) >> 7; 1459 1460 /* Clip the signal if it's too loud */ 1461 if (itemp > MAX_LEVEL) itemp = MAX_LEVEL; 1462 else if (itemp < MIN_LEVEL) itemp = MIN_LEVEL; 1463 1464 level += PJ_ABS(itemp); 1465 1466 /* Put back in the buffer. */ 1467 *p = (pj_int16_t)itemp; 1468 ++p; 1469 } 1470 level /= (f->size >> 1); 1471 } else { 1472 level = pjmedia_calc_avg_signal((const pj_int16_t*)f->buf, 1473 f->size >> 1); 1474 } 1364 1475 } else if (f->type == PJMEDIA_FRAME_TYPE_EXTENDED) { 1365 1476 /* For extended frame, TX level is unknown, so we just set … … 1367 1478 */ 1368 1479 level = NORMAL_LEVEL; 1369 } else { /* PJMEDIA_FRAME_TYPE_NONE. */ 1370 level = 0; 1371 } 1480 } 1481 1372 1482 cport->rx_level = pjmedia_linear2ulaw(level) ^ 0xff; 1373 1483 … … 1402 1512 } 1403 1513 1404 /* Set listener TX level equal to transmitter RX level. */ 1405 listener->tx_level = cport->rx_level; 1514 /* Set listener TX level based on transmitter RX level & listener 1515 * TX level. 1516 */ 1517 listener->tx_level = (cport->rx_level * listener->tx_adj_level) >> 8; 1406 1518 } 1407 1519 -
pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia/stream.c
r2438 r2445 483 483 484 484 if (frame_type == PJMEDIA_JB_MISSING_FRAME) { 485 PJ_LOG( 1,(stream->port.info.name.ptr, "Frame lost!"));485 PJ_LOG(5,(stream->port.info.name.ptr, "Frame lost!")); 486 486 } else if (frame_type == PJMEDIA_JB_ZERO_EMPTY_FRAME) { 487 487 /* Jitter buffer is empty. Check if this is the first "empty" … … 493 493 /* Report the state of jitter buffer */ 494 494 pjmedia_jbuf_get_state(stream->jb, &jb_state); 495 PJ_LOG( 1,(stream->port.info.name.ptr,495 PJ_LOG(5,(stream->port.info.name.ptr, 496 496 "Jitter buffer empty (prefetch=%d)", 497 497 jb_state.prefetch)); … … 507 507 508 508 if (stream->jb_last_frm != frame_type) { 509 PJ_LOG( 1,(stream->port.info.name.ptr,509 PJ_LOG(5,(stream->port.info.name.ptr, 510 510 "Jitter buffer is bufferring (prefetch=%d)", 511 511 jb_state.prefetch)); -
pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia/symbian_sound_aps.cpp
r2444 r2445 779 779 break; 780 780 781 case PJMEDIA_FOURCC_ G711U:782 case PJMEDIA_FOURCC_ G711A:781 case PJMEDIA_FOURCC_PCMU: 782 case PJMEDIA_FOURCC_PCMA: 783 783 { 784 784 unsigned samples_processed = 0; … … 858 858 * 0xxxxy00, where xxxx:frame type, y:not sure. 859 859 */ 860 unsigned len = sf->bitlen>>3;860 unsigned len = (sf->bitlen+7)>>3; 861 861 enum {SID_FT = 8 }; 862 862 pj_uint8_t amr_header = 4, ft = SID_FT; 863 864 if (sf->bitlen & 0x07)865 ++len;866 863 867 864 if (len >= pjmedia_codec_amrnb_framelen[0]) … … 976 973 break; 977 974 978 case PJMEDIA_FOURCC_ G711U:979 case PJMEDIA_FOURCC_ G711A:975 case PJMEDIA_FOURCC_PCMU: 976 case PJMEDIA_FOURCC_PCMA: 980 977 { 981 978 unsigned samples_ready = 0; … … 1105 1102 strm->setting.format.u32 = PJMEDIA_FOURCC_L16; 1106 1103 1107 /* Set audio engine settings. */ 1108 if (strm->setting.format.u32 == PJMEDIA_FOURCC_G711U || 1104 /* Set audio engine fourcc. */ 1105 if (strm->setting.format.u32 == PJMEDIA_FOURCC_PCMU || 1106 strm->setting.format.u32 == PJMEDIA_FOURCC_PCMA || 1109 1107 strm->setting.format.u32 == PJMEDIA_FOURCC_L16) 1110 1108 { … … 1114 1112 } 1115 1113 1114 /* Set audio engine mode. */ 1116 1115 if (strm->setting.format.u32 == PJMEDIA_FOURCC_AMR) 1117 1116 { 1118 1117 aps_setting.mode = (TAPSCodecMode)strm->setting.bitrate; 1119 } else if (strm->setting.format.u32 == PJMEDIA_FOURCC_G711U || 1120 strm->setting.format.u32 == PJMEDIA_FOURCC_L16 || 1121 (strm->setting.format.u32 == PJMEDIA_FOURCC_ILBC && 1122 strm->setting.mode == 30)) 1118 } 1119 else if (strm->setting.format.u32 == PJMEDIA_FOURCC_PCMU || 1120 strm->setting.format.u32 == PJMEDIA_FOURCC_L16 || 1121 (strm->setting.format.u32 == PJMEDIA_FOURCC_ILBC && 1122 strm->setting.mode == 30)) 1123 1123 { 1124 1124 aps_setting.mode = EULawOr30ms; 1125 } else { 1125 } 1126 else if (strm->setting.format.u32 == PJMEDIA_FOURCC_PCMA || 1127 (strm->setting.format.u32 == PJMEDIA_FOURCC_ILBC && 1128 strm->setting.mode == 20)) 1129 { 1126 1130 aps_setting.mode = EALawOr20ms; 1127 1131 } 1128 1132 1129 1133 /* Disable VAD on L16 and G711. */ 1130 if (strm->setting.format.u32 == PJMEDIA_FOURCC_ L16||1131 strm->setting.format.u32 == PJMEDIA_FOURCC_ G711U||1132 strm->setting.format.u32 == PJMEDIA_FOURCC_ G711A)1134 if (strm->setting.format.u32 == PJMEDIA_FOURCC_PCMU || 1135 strm->setting.format.u32 == PJMEDIA_FOURCC_PCMA || 1136 strm->setting.format.u32 == PJMEDIA_FOURCC_L16) 1133 1137 { 1134 1138 aps_setting.vad = EFalse; … … 1137 1141 } 1138 1142 1143 /* Set other audio engine attributes. */ 1139 1144 aps_setting.plc = strm->setting.plc; 1140 1145 aps_setting.cng = strm->setting.cng; 1141 1146 aps_setting.loudspk = strm->setting.loudspk; 1142 1147 1148 /* Set audio engine callbacks. */ 1143 1149 if (strm->setting.format.u32 == PJMEDIA_FOURCC_L16) { 1144 1150 aps_play_cb = &PlayCbPcm; … … 1149 1155 } 1150 1156 1151 / / Create the audio engine.1157 /* Create the audio engine. */ 1152 1158 TRAPD(err, strm->engine = CPjAudioEngine::NewL(strm, 1153 1159 aps_rec_cb, aps_play_cb,
Note: See TracChangeset
for help on using the changeset viewer.