Ignore:
Timestamp:
Feb 10, 2009 4:43:16 AM (12 years ago)
Author:
nanang
Message:
  • Fixed conf switch on reinit-ing conf port TX buf.
  • Updated conf switch to enable RX/TX level adjustment.
  • Added VAD & PLC setting in passthrough codecs.
  • Changed G711 fourcc codes.
  • Updated bits-to-bytes calculations all over the places.
  • Minor update: changed log level for dumping jbuf states in stream.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia/symbian_sound_aps.cpp

    r2444 r2445  
    779779        break; 
    780780         
    781     case PJMEDIA_FOURCC_G711U: 
    782     case PJMEDIA_FOURCC_G711A: 
     781    case PJMEDIA_FOURCC_PCMU: 
     782    case PJMEDIA_FOURCC_PCMA: 
    783783        { 
    784784            unsigned samples_processed = 0; 
     
    858858                     * 0xxxxy00, where xxxx:frame type, y:not sure.  
    859859                     */ 
    860                     unsigned len = sf->bitlen>>3; 
     860                    unsigned len = (sf->bitlen+7)>>3; 
    861861                    enum {SID_FT = 8 }; 
    862862                    pj_uint8_t amr_header = 4, ft = SID_FT; 
    863  
    864                     if (sf->bitlen & 0x07) 
    865                         ++len; 
    866863 
    867864                    if (len >= pjmedia_codec_amrnb_framelen[0]) 
     
    976973        break; 
    977974         
    978     case PJMEDIA_FOURCC_G711U: 
    979     case PJMEDIA_FOURCC_G711A: 
     975    case PJMEDIA_FOURCC_PCMU: 
     976    case PJMEDIA_FOURCC_PCMA: 
    980977        { 
    981978            unsigned samples_ready = 0; 
     
    11051102        strm->setting.format.u32 = PJMEDIA_FOURCC_L16; 
    11061103 
    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 || 
    11091107        strm->setting.format.u32 == PJMEDIA_FOURCC_L16) 
    11101108    { 
     
    11141112    } 
    11151113 
     1114    /* Set audio engine mode. */ 
    11161115    if (strm->setting.format.u32 == PJMEDIA_FOURCC_AMR) 
    11171116    { 
    11181117        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)) 
    11231123    { 
    11241124        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    { 
    11261130        aps_setting.mode = EALawOr20ms; 
    11271131    } 
    11281132 
    11291133    /* 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) 
    11331137    { 
    11341138        aps_setting.vad = EFalse; 
     
    11371141    } 
    11381142     
     1143    /* Set other audio engine attributes. */ 
    11391144    aps_setting.plc = strm->setting.plc; 
    11401145    aps_setting.cng = strm->setting.cng; 
    11411146    aps_setting.loudspk = strm->setting.loudspk; 
    11421147 
     1148    /* Set audio engine callbacks. */ 
    11431149    if (strm->setting.format.u32 == PJMEDIA_FOURCC_L16) { 
    11441150        aps_play_cb = &PlayCbPcm; 
     
    11491155    } 
    11501156 
    1151     // Create the audio engine. 
     1157    /* Create the audio engine. */ 
    11521158    TRAPD(err, strm->engine = CPjAudioEngine::NewL(strm, 
    11531159                                                   aps_rec_cb, aps_play_cb, 
Note: See TracChangeset for help on using the changeset viewer.