- Timestamp:
- Feb 16, 2009 4:29:05 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia/symbian_sound_aps.cpp
r2449 r2456 509 509 iSession.Stop(); 510 510 state_ = STATE_READY; 511 TRACE_((THIS_FILE, "S treamingstopped"));511 TRACE_((THIS_FILE, "Sound device stopped")); 512 512 } 513 513 } … … 550 550 if (parentStrm_->dir != PJMEDIA_DIR_CAPTURE) { 551 551 iSession.Write(); 552 TRACE_((THIS_FILE, "Player st reaming started"));552 TRACE_((THIS_FILE, "Player started")); 553 553 } 554 554 … … 556 556 if (parentStrm_->dir != PJMEDIA_DIR_PLAYBACK) { 557 557 iSession.Read(); 558 TRACE_((THIS_FILE, "Recorder st reaming started"));558 TRACE_((THIS_FILE, "Recorder started")); 559 559 } 560 560 … … 569 569 void CPjAudioEngine::InputStreamInitialized(const TInt aStatus) 570 570 { 571 TRACE_((THIS_FILE, " InputStreamInitialized%d", aStatus));571 TRACE_((THIS_FILE, "Recorder initialized, err=%d", aStatus)); 572 572 573 573 state_ = STATE_READY; … … 579 579 void CPjAudioEngine::OutputStreamInitialized(const TInt aStatus) 580 580 { 581 TRACE_((THIS_FILE, " OutputStreamInitialized%d", aStatus));581 TRACE_((THIS_FILE, "Player initialized, err=%d", aStatus)); 582 582 583 583 if (aStatus == KErrNone) { … … 605 605 if (state_ == STATE_READY || state_ == STATE_STREAMING) { 606 606 iSession.ActivateLoudspeaker(active); 607 TRACE_((THIS_FILE, "Loudspeaker on/off: %d", active));607 TRACE_((THIS_FILE, "Loudspeaker turned %s", (active? "on":"off"))); 608 608 return KErrNone; 609 609 } … … 709 709 710 710 switch(strm->setting.format.u32) { 711 case PJMEDIA_FO URCC_AMR:711 case PJMEDIA_FORMAT_AMR: 712 712 { 713 713 const pj_uint8_t *p = (const pj_uint8_t*)buf.iBuffer.Ptr() + 1; … … 724 724 break; 725 725 726 case PJMEDIA_FO URCC_G729:726 case PJMEDIA_FORMAT_G729: 727 727 { 728 728 /* Check if we got a normal or SID frame. */ … … 753 753 break; 754 754 755 case PJMEDIA_FO URCC_ILBC:755 case PJMEDIA_FORMAT_ILBC: 756 756 { 757 757 unsigned samples_got; … … 779 779 break; 780 780 781 case PJMEDIA_FO URCC_PCMU:782 case PJMEDIA_FO URCC_PCMA:781 case PJMEDIA_FORMAT_PCMU: 782 case PJMEDIA_FORMAT_PCMA: 783 783 { 784 784 unsigned samples_processed = 0; … … 837 837 838 838 switch(strm->setting.format.u32) { 839 case PJMEDIA_FO URCC_AMR:839 case PJMEDIA_FORMAT_AMR: 840 840 { 841 841 if (frame->samples_cnt == 0) { … … 884 884 break; 885 885 886 case PJMEDIA_FO URCC_G729:886 case PJMEDIA_FORMAT_G729: 887 887 { 888 888 if (frame->samples_cnt == 0) { … … 933 933 break; 934 934 935 case PJMEDIA_FO URCC_ILBC:935 case PJMEDIA_FORMAT_ILBC: 936 936 { 937 937 if (frame->samples_cnt == 0) { … … 973 973 break; 974 974 975 case PJMEDIA_FO URCC_PCMU:976 case PJMEDIA_FO URCC_PCMA:975 case PJMEDIA_FORMAT_PCMU: 976 case PJMEDIA_FORMAT_PCMA: 977 977 { 978 978 unsigned samples_ready = 0; … … 1006 1006 } else { 1007 1007 pj_uint8_t silc; 1008 silc = (strm->setting.format.u32==PJMEDIA_FO URCC_PCMU)?1008 silc = (strm->setting.format.u32==PJMEDIA_FORMAT_PCMU)? 1009 1009 pjmedia_linear2ulaw(0) : pjmedia_linear2alaw(0); 1010 1010 buf.iBuffer.AppendFill(silc, samples_cnt); … … 1017 1017 pj_uint8_t silc; 1018 1018 1019 silc = (strm->setting.format.u32==PJMEDIA_FO URCC_PCMU)?1019 silc = (strm->setting.format.u32==PJMEDIA_FORMAT_PCMU)? 1020 1020 pjmedia_linear2ulaw(0) : pjmedia_linear2alaw(0); 1021 1021 buf.iBuffer.AppendFill(silc, samples_req - samples_ready); … … 1105 1105 strm->setting = *setting; 1106 1106 1107 if (strm->setting.format.u32 == 0)1108 strm->setting.format.u32 = PJMEDIA_FOURCC_L16;1109 1110 1107 /* Set audio engine fourcc. */ 1111 if (strm->setting.format.u32 == PJMEDIA_FO URCC_PCMU ||1112 strm->setting.format.u32 == PJMEDIA_FO URCC_PCMA ||1113 strm->setting.format.u32 == PJMEDIA_FO URCC_L16)1108 if (strm->setting.format.u32 == PJMEDIA_FORMAT_PCMU || 1109 strm->setting.format.u32 == PJMEDIA_FORMAT_PCMA || 1110 strm->setting.format.u32 == PJMEDIA_FORMAT_L16) 1114 1111 { 1115 1112 aps_setting.fourcc = TFourCC(KMCPFourCCIdG711); … … 1119 1116 1120 1117 /* Set audio engine mode. */ 1121 if (strm->setting.format.u32 == PJMEDIA_FO URCC_AMR)1118 if (strm->setting.format.u32 == PJMEDIA_FORMAT_AMR) 1122 1119 { 1123 1120 aps_setting.mode = (TAPSCodecMode)strm->setting.bitrate; 1124 1121 } 1125 else if (strm->setting.format.u32 == PJMEDIA_FO URCC_PCMU ||1126 strm->setting.format.u32 == PJMEDIA_FO URCC_L16||1127 (strm->setting.format.u32 == PJMEDIA_FO URCC_ILBC &&1122 else if (strm->setting.format.u32 == PJMEDIA_FORMAT_PCMU || 1123 strm->setting.format.u32 == PJMEDIA_FORMAT_L16 || 1124 (strm->setting.format.u32 == PJMEDIA_FORMAT_ILBC && 1128 1125 strm->setting.mode == 30)) 1129 1126 { 1130 1127 aps_setting.mode = EULawOr30ms; 1131 1128 } 1132 else if (strm->setting.format.u32 == PJMEDIA_FO URCC_PCMA ||1133 (strm->setting.format.u32 == PJMEDIA_FO URCC_ILBC &&1129 else if (strm->setting.format.u32 == PJMEDIA_FORMAT_PCMA || 1130 (strm->setting.format.u32 == PJMEDIA_FORMAT_ILBC && 1134 1131 strm->setting.mode == 20)) 1135 1132 { … … 1138 1135 1139 1136 /* Disable VAD on L16 and G711. */ 1140 if (strm->setting.format.u32 == PJMEDIA_FO URCC_PCMU ||1141 strm->setting.format.u32 == PJMEDIA_FO URCC_PCMA ||1142 strm->setting.format.u32 == PJMEDIA_FO URCC_L16)1137 if (strm->setting.format.u32 == PJMEDIA_FORMAT_PCMU || 1138 strm->setting.format.u32 == PJMEDIA_FORMAT_PCMA || 1139 strm->setting.format.u32 == PJMEDIA_FORMAT_L16) 1143 1140 { 1144 1141 aps_setting.vad = EFalse; … … 1153 1150 1154 1151 /* Set audio engine callbacks. */ 1155 if (strm->setting.format.u32 == PJMEDIA_FO URCC_L16) {1152 if (strm->setting.format.u32 == PJMEDIA_FORMAT_L16) { 1156 1153 aps_play_cb = &PlayCbPcm; 1157 1154 aps_rec_cb = &RecCbPcm; … … 1183 1180 strm->rec_buf_len = 0; 1184 1181 1185 if (strm->setting.format.u32 == PJMEDIA_FO URCC_G729) {1182 if (strm->setting.format.u32 == PJMEDIA_FORMAT_G729) { 1186 1183 TBitStream *g729_bitstream = new TBitStream; 1187 1184 … … 1215 1212 1216 1213 pj_bzero(&setting, sizeof(setting)); 1217 setting.format.u32 = PJMEDIA_FO URCC_L16;1214 setting.format.u32 = PJMEDIA_FORMAT_L16; 1218 1215 1219 1216 return sound_open(PJMEDIA_DIR_CAPTURE, clock_rate, channel_count, … … 1237 1234 1238 1235 pj_bzero(&setting, sizeof(setting)); 1239 setting.format.u32 = PJMEDIA_FO URCC_L16;1236 setting.format.u32 = PJMEDIA_FORMAT_L16; 1240 1237 1241 1238 return sound_open(PJMEDIA_DIR_PLAYBACK, clock_rate, channel_count, … … 1262 1259 1263 1260 pj_bzero(&setting, sizeof(setting)); 1264 setting.format.u32 = PJMEDIA_FO URCC_L16;1261 setting.format.u32 = PJMEDIA_FORMAT_L16; 1265 1262 1266 1263 return sound_open(PJMEDIA_DIR_CAPTURE_PLAYBACK, clock_rate, channel_count, … … 1350 1347 stream->engine = NULL; 1351 1348 1352 if (stream->setting.format.u32 == PJMEDIA_FO URCC_G729) {1349 if (stream->setting.format.u32 == PJMEDIA_FORMAT_G729) { 1353 1350 TBitStream *g729_bitstream = (TBitStream*)stream->strm_data; 1354 1351 stream->strm_data = NULL;
Note: See TracChangeset
for help on using the changeset viewer.