Ignore:
Timestamp:
Aug 31, 2012 11:42:17 AM (12 years ago)
Author:
nanang
Message:

Fix #1579: Update Symbian APS/VAS to use new pjmedia_format.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-audiodev/symb_aps_dev.cpp

    r3841 r4243  
    974974            unsigned samples_got; 
    975975             
    976             samples_got = strm->param.ext_fmt.bitrate == 15200? 160 : 240; 
     976            samples_got = 
     977                strm->param.ext_fmt.det.aud.avg_bps == 15200? 160 : 240; 
    977978             
    978979            /* Check if we got a normal frame. */ 
     
    11721173                samples_cnt = frame->samples_cnt / frame->subframe_cnt; 
    11731174                 
    1174                 pj_assert((strm->param.ext_fmt.bitrate == 15200 &&  
     1175                pj_assert((strm->param.ext_fmt.det.aud.avg_bps == 15200 &&  
    11751176                           samples_cnt == 160) || 
    1176                           (strm->param.ext_fmt.bitrate != 15200 && 
     1177                          (strm->param.ext_fmt.det.aud.avg_bps != 15200 && 
    11771178                           samples_cnt == 240)); 
    11781179                 
     
    13921393 
    13931394        if (supported) { 
     1395            pjmedia_format ext_fmt; 
     1396             
    13941397            switch(i) { 
    13951398            case 0: /* AMRNB */ 
    1396                 af->dev_info.ext_fmt[fmt_cnt].id = PJMEDIA_FORMAT_AMR; 
    1397                 af->dev_info.ext_fmt[fmt_cnt].bitrate = 7400; 
    1398                 af->dev_info.ext_fmt[fmt_cnt].vad = PJ_TRUE; 
     1399                pjmedia_format_init_audio(&ext_fmt, PJMEDIA_FORMAT_AMR, 
     1400                                          8000, 1, 16, 20, 7400, 12200); 
     1401                af->dev_info.ext_fmt[fmt_cnt] = ext_fmt; 
     1402                //af->dev_info.ext_fmt[fmt_cnt].vad = PJ_TRUE; 
    13991403                ++fmt_cnt; 
    14001404                break; 
    14011405            case 1: /* G.711 */ 
    1402                 af->dev_info.ext_fmt[fmt_cnt].id = PJMEDIA_FORMAT_PCMU; 
    1403                 af->dev_info.ext_fmt[fmt_cnt].bitrate = 64000; 
    1404                 af->dev_info.ext_fmt[fmt_cnt].vad = PJ_FALSE; 
     1406                pjmedia_format_init_audio(&ext_fmt, PJMEDIA_FORMAT_PCMU, 
     1407                                          8000, 1, 16, 20, 64000, 64000); 
     1408                af->dev_info.ext_fmt[fmt_cnt] = ext_fmt; 
     1409                //af->dev_info.ext_fmt[fmt_cnt].vad = PJ_FALSE; 
    14051410                ++fmt_cnt; 
    1406                 af->dev_info.ext_fmt[fmt_cnt].id = PJMEDIA_FORMAT_PCMA; 
    1407                 af->dev_info.ext_fmt[fmt_cnt].bitrate = 64000; 
    1408                 af->dev_info.ext_fmt[fmt_cnt].vad = PJ_FALSE; 
     1411                pjmedia_format_init_audio(&ext_fmt, PJMEDIA_FORMAT_PCMA, 
     1412                                          8000, 1, 16, 20, 64000, 64000); 
     1413                af->dev_info.ext_fmt[fmt_cnt] = ext_fmt; 
     1414                //af->dev_info.ext_fmt[fmt_cnt].vad = PJ_FALSE; 
    14091415                ++fmt_cnt; 
    14101416                g711_supported = PJ_TRUE; 
    14111417                break; 
    14121418            case 2: /* G.729 */ 
    1413                 af->dev_info.ext_fmt[fmt_cnt].id = PJMEDIA_FORMAT_G729; 
    1414                 af->dev_info.ext_fmt[fmt_cnt].bitrate = 8000; 
    1415                 af->dev_info.ext_fmt[fmt_cnt].vad = PJ_FALSE; 
     1419                pjmedia_format_init_audio(&ext_fmt, PJMEDIA_FORMAT_G729, 
     1420                                          8000, 1, 16, 20, 8000, 8000); 
     1421                af->dev_info.ext_fmt[fmt_cnt] = ext_fmt; 
     1422                //af->dev_info.ext_fmt[fmt_cnt].vad = PJ_FALSE; 
    14161423                ++fmt_cnt; 
    14171424                break; 
    14181425            case 3: /* iLBC */ 
    1419                 af->dev_info.ext_fmt[fmt_cnt].id = PJMEDIA_FORMAT_ILBC; 
    1420                 af->dev_info.ext_fmt[fmt_cnt].bitrate = 13333; 
    1421                 af->dev_info.ext_fmt[fmt_cnt].vad = PJ_TRUE; 
     1426                pjmedia_format_init_audio(&ext_fmt, PJMEDIA_FORMAT_ILBC, 
     1427                                          8000, 1, 16, 30, 13333, 15200); 
     1428                af->dev_info.ext_fmt[fmt_cnt] = ext_fmt; 
     1429                //af->dev_info.ext_fmt[fmt_cnt].vad = PJ_TRUE; 
    14221430                ++fmt_cnt; 
    14231431                break; 
     
    15711579    if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_AMR) 
    15721580    { 
    1573         aps_setting.mode = (TAPSCodecMode)strm->param.ext_fmt.bitrate; 
     1581        aps_setting.mode = (TAPSCodecMode)strm->param.ext_fmt.det.aud.avg_bps; 
    15741582    }  
    15751583    else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMU || 
    15761584             strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16 || 
    15771585            (strm->param.ext_fmt.id == PJMEDIA_FORMAT_ILBC  && 
    1578              strm->param.ext_fmt.bitrate != 15200)) 
     1586             strm->param.ext_fmt.det.aud.avg_bps != 15200)) 
    15791587    { 
    15801588        aps_setting.mode = EULawOr30ms; 
     
    15821590    else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMA || 
    15831591            (strm->param.ext_fmt.id == PJMEDIA_FORMAT_ILBC && 
    1584              strm->param.ext_fmt.bitrate == 15200)) 
     1592             strm->param.ext_fmt.det.aud.avg_bps == 15200)) 
    15851593    { 
    15861594        aps_setting.mode = EALawOr20ms; 
     
    15971605        aps_setting.vad = EFalse; 
    15981606    } else { 
    1599         aps_setting.vad = strm->param.ext_fmt.vad; 
     1607        aps_setting.vad = (strm->param.flags & PJMEDIA_AUD_DEV_CAP_VAD) && 
     1608                          strm->param.vad_enabled; 
    16001609    } 
    16011610     
    16021611    /* Set other audio engine attributes. */ 
    1603     aps_setting.plc = strm->param.plc_enabled; 
     1612    aps_setting.plc = (strm->param.flags & PJMEDIA_AUD_DEV_CAP_PLC) && 
     1613                      strm->param.plc_enabled; 
    16041614    aps_setting.cng = aps_setting.vad; 
    16051615    aps_setting.loudspk =  
Note: See TracChangeset for help on using the changeset viewer.