- Timestamp:
- Mar 4, 2010 3:47:25 PM (15 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-audiodev/symb_aps_dev.cpp
r2958 r3116 1035 1035 buf.iBuffer.Append((TUint8*)sf->data, len); 1036 1036 } else { 1037 buf.iBuffer.Append(0); 1037 enum {NO_DATA_FT = 15 }; 1038 pj_uint8_t amr_header = 4 || (NO_DATA_FT << 3); 1039 1040 buf.iBuffer.Append(amr_header); 1038 1041 } 1039 1042 … … 1041 1044 1042 1045 } else { /* PJMEDIA_FRAME_TYPE_NONE */ 1043 buf.iBuffer.Append(0); 1044 1046 enum {NO_DATA_FT = 15 }; 1047 pj_uint8_t amr_header = 4 || (NO_DATA_FT << 3); 1048 1049 buf.iBuffer.Append(amr_header); 1050 1045 1051 frame->samples_cnt = 0; 1046 1052 frame->subframe_cnt = 0; -
pjproject/trunk/pjmedia/src/pjmedia-audiodev/symb_vas_dev.cpp
r3078 r3116 416 416 TInt CPjAudioEngine::StartPlay() 417 417 { 418 TInt err ;418 TInt err = KErrNone; 419 419 420 420 pj_assert(iVoIPDnlink); … … 429 429 err = g711dec_if->SetMode((CVoIPFormatIntfc::TG711CodecMode) 430 430 setting_.mode); 431 pj_assert(err == KErrNone);432 431 } 433 432 break; … … 439 438 err = ilbcdec_if->SetMode((CVoIPFormatIntfc::TILBCCodecMode) 440 439 setting_.mode); 441 pj_assert(err == KErrNone); 442 } 443 break; 444 440 } 441 break; 442 443 case EAMR_NB: 444 /* Ticket #1008: AMR playback issue on few devices, e.g: E72, E52 */ 445 err = dec_fmt_if->SetFrameMode(ETrue); 446 break; 447 445 448 default: 446 449 break; 447 450 } 451 452 if (err != KErrNone) 453 goto on_return; 448 454 449 455 /* Configure audio routing */ … … 452 458 /* Start player */ 453 459 err = iVoIPDnlink->Start(); 454 460 461 on_return: 455 462 if (err == KErrNone) { 456 463 dn_state_ = STATE_STREAMING; … … 465 472 TInt CPjAudioEngine::StartRec() 466 473 { 467 TInt err ;474 TInt err = KErrNone; 468 475 469 476 pj_assert(iVoIPUplink); … … 478 485 err = g711enc_if->SetMode((CVoIPFormatIntfc::TG711CodecMode) 479 486 setting_.mode); 480 pj_assert(err == KErrNone);481 487 } 482 488 break; … … 488 494 err = ilbcenc_if->SetMode((CVoIPFormatIntfc::TILBCCodecMode) 489 495 setting_.mode); 490 pj_assert(err == KErrNone);491 496 } 492 497 break; 493 498 494 499 case EAMR_NB: 495 e nc_fmt_if->SetBitRate(setting_.mode);500 err = enc_fmt_if->SetBitRate(setting_.mode); 496 501 break; 497 502 … … 499 504 break; 500 505 } 506 507 if (err != KErrNone) 508 goto on_return; 501 509 502 510 /* Configure general codec setting */ … … 505 513 /* Start recorder */ 506 514 err = iVoIPUplink->Start(); 507 515 516 on_return: 508 517 if (err == KErrNone) { 509 518 up_state_ = STATE_STREAMING; … … 1113 1122 buffer.Append((TUint8*)sf->data, len); 1114 1123 } else { 1115 buffer.Append(0); 1124 enum {NO_DATA_FT = 15 }; 1125 pj_uint8_t amr_header = 4 || (NO_DATA_FT << 3); 1126 1127 buffer.Append(amr_header); 1116 1128 } 1117 1129 … … 1119 1131 1120 1132 } else { /* PJMEDIA_FRAME_TYPE_NONE */ 1121 buffer.Append(0); 1133 enum {NO_DATA_FT = 15 }; 1134 pj_uint8_t amr_header = 4 || (NO_DATA_FT << 3); 1135 1136 buffer.Append(amr_header); 1122 1137 1123 1138 frame->samples_cnt = 0; -
pjproject/trunk/pjmedia/src/pjmedia/codec.c
r3078 r3116 86 86 87 87 /* Destroy mutex */ 88 pj_mutex_destroy(mgr->mutex); 88 if (mgr->mutex) 89 pj_mutex_destroy(mgr->mutex); 89 90 90 91 /* Release pool */ 91 pj_pool_release(mgr->pool); 92 if (mgr->pool) 93 pj_pool_release(mgr->pool); 92 94 93 95 /* Just for safety, set codec manager states to zero */ -
pjproject/trunk/pjsip-apps/src/symsndtest/app_main.cpp
r2821 r3116 41 41 static unsigned rec_cnt, play_cnt; 42 42 static pj_time_val t_start; 43 44 pj_pool_t *pool; 45 pjmedia_delay_buf *delaybuf; 43 static pjmedia_aud_param param; 44 static pj_pool_t *pool; 45 static pjmedia_delay_buf *delaybuf; 46 static char frame_buf[256]; 47 48 static void copy_frame_ext(pjmedia_frame_ext *f_dst, 49 const pjmedia_frame_ext *f_src) 50 { 51 pj_bzero(f_dst, sizeof(*f_dst)); 52 if (f_src->subframe_cnt) { 53 f_dst->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; 54 for (unsigned i = 0; i < f_src->subframe_cnt; ++i) { 55 pjmedia_frame_ext_subframe *sf; 56 sf = pjmedia_frame_ext_get_subframe(f_src, i); 57 pjmedia_frame_ext_append_subframe(f_dst, sf->data, sf->bitlen, 58 param.samples_per_frame); 59 } 60 } else { 61 f_dst->base.type = PJMEDIA_FRAME_TYPE_NONE; 62 } 63 } 46 64 47 65 /* Logging callback */ … … 138 156 PJ_UNUSED_ARG(user_data); 139 157 140 pjmedia_delay_buf_put(delaybuf, (pj_int16_t*)frame->buf); 141 142 if (frame->size != SAMPLES_PER_FRAME*2) { 143 PJ_LOG(3, (THIS_FILE, "Size captured = %u", 144 frame->size)); 158 if (param.ext_fmt.id == PJMEDIA_FORMAT_PCM) { 159 pjmedia_delay_buf_put(delaybuf, (pj_int16_t*)frame->buf); 160 161 if (frame->size != SAMPLES_PER_FRAME*2) { 162 PJ_LOG(3, (THIS_FILE, "Size captured = %u", 163 frame->size)); 164 } 165 } else { 166 pjmedia_frame_ext *f_src = (pjmedia_frame_ext*)frame; 167 pjmedia_frame_ext *f_dst = (pjmedia_frame_ext*)frame_buf; 168 169 copy_frame_ext(f_dst, f_src); 145 170 } 146 171 … … 155 180 PJ_UNUSED_ARG(user_data); 156 181 157 pjmedia_delay_buf_get(delaybuf, (pj_int16_t*)frame->buf); 158 frame->size = SAMPLES_PER_FRAME*2; 159 frame->type = PJMEDIA_FRAME_TYPE_AUDIO; 182 if (param.ext_fmt.id == PJMEDIA_FORMAT_PCM) { 183 pjmedia_delay_buf_get(delaybuf, (pj_int16_t*)frame->buf); 184 frame->size = SAMPLES_PER_FRAME*2; 185 frame->type = PJMEDIA_FRAME_TYPE_AUDIO; 186 } else { 187 pjmedia_frame_ext *f_src = (pjmedia_frame_ext*)frame_buf; 188 pjmedia_frame_ext *f_dst = (pjmedia_frame_ext*)frame; 189 190 copy_frame_ext(f_dst, f_src); 191 } 160 192 161 193 ++play_cnt; … … 166 198 static pj_status_t snd_start(unsigned flag) 167 199 { 168 pjmedia_aud_param param;169 200 pj_status_t status; 170 201 … … 179 210 param.samples_per_frame = SAMPLES_PER_FRAME; 180 211 param.dir = (pjmedia_dir) flag; 212 param.ext_fmt.id = PJMEDIA_FORMAT_AMR; 213 param.ext_fmt.bitrate = 12200; 214 param.output_route = PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; 181 215 182 216 status = pjmedia_aud_stream_create(¶m, &rec_cb, &play_cb, NULL, &strm);
Note: See TracChangeset
for help on using the changeset viewer.