Ignore:
Timestamp:
Nov 11, 2008 11:25:13 AM (12 years ago)
Author:
nanang
Message:

Ticket #670: Minor update on naming of AMR helper and updated AMR in IPP codecs to enable octet-align from FMTP settings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-codec/ipp_codecs.c

    r2359 r2363  
    230230                    5900, 12200, 4, 1, 1,  
    231231                    &predecode_amr, &parse_amr, &pack_amr 
     232                    /*, {1, {{{"octet-align", 11}, {"1", 1}}} } */ 
    232233    }, 
    233234#   endif 
     
    424425 
    425426typedef struct amr_settings_t { 
    426     pjmedia_codec_amr_settings enc_setting; 
    427     pjmedia_codec_amr_settings dec_setting; 
     427    pjmedia_codec_amr_pack_setting enc_setting; 
     428    pjmedia_codec_amr_pack_setting dec_setting; 
    428429    pj_int8_t enc_mode; 
    429430} amr_settings_t; 
     
    442443    pjmedia_frame frame; 
    443444    pjmedia_codec_amr_bit_info *info; 
    444     pjmedia_codec_amr_settings *setting; 
     445    pjmedia_codec_amr_pack_setting *setting; 
    445446 
    446447    setting = &((amr_settings_t*)codec_data->codec_setting)->dec_setting; 
     
    492493    pj_uint8_t *r; /* Read cursor */ 
    493494    pj_uint8_t SID_FT; 
    494     pjmedia_codec_amr_settings *setting; 
     495    pjmedia_codec_amr_pack_setting *setting; 
    495496 
    496497    setting = &((amr_settings_t*)codec_data->codec_setting)->enc_setting; 
     
    540541{ 
    541542    amr_settings_t* s = (amr_settings_t*)codec_data->codec_setting; 
    542     pjmedia_codec_amr_settings *setting; 
     543    pjmedia_codec_amr_pack_setting *setting; 
    543544    pj_status_t status; 
    544     pj_uint8_t CMR; 
     545    pj_uint8_t cmr; 
    545546 
    546547    setting = &s->dec_setting; 
    547548 
    548549    status = pjmedia_codec_amr_parse(pkt, pkt_size, ts, setting, frames,  
    549                                      frame_cnt, &CMR); 
     550                                     frame_cnt, &cmr); 
    550551    if (status != PJ_SUCCESS) 
    551552        return status; 
    552553 
    553554    /* Check Change Mode Request. */ 
    554     if ((setting->amr_nb && CMR <= 7) || (!setting->amr_nb && CMR <= 8)) { 
    555         s->enc_mode = CMR; 
     555    if ((setting->amr_nb && cmr <= 7) || (!setting->amr_nb && cmr <= 8)) { 
     556        s->enc_mode = cmr; 
    556557    } 
    557558 
     
    10241025    if (ippc->pt == PJMEDIA_RTP_PT_AMR || ippc->pt == PJMEDIA_RTP_PT_AMRWB) { 
    10251026        amr_settings_t *s; 
     1027        pj_uint8_t octet_align = 0; 
     1028        const pj_str_t STR_FMTP_OCTET_ALIGN = {"octet-align", 11}; 
     1029 
     1030        /* Check octet-align */ 
     1031        for (i = 0; i < attr->setting.dec_fmtp.cnt; ++i) { 
     1032            if (pj_stricmp(&attr->setting.dec_fmtp.param[i].name,  
     1033                           &STR_FMTP_OCTET_ALIGN) == 0) 
     1034            { 
     1035                octet_align=(pj_uint8_t) 
     1036                            (pj_strtoul(&attr->setting.dec_fmtp.param[i].val)); 
     1037                break; 
     1038            } 
     1039        } 
    10261040 
    10271041        s = PJ_POOL_ZALLOC_T(pool, amr_settings_t); 
     
    10331047 
    10341048        s->enc_setting.amr_nb = ippc->pt == PJMEDIA_RTP_PT_AMR; 
    1035         s->enc_setting.octet_aligned = 0; 
     1049        s->enc_setting.octet_aligned = octet_align; 
    10361050        s->enc_setting.reorder = PJ_TRUE; 
    1037         s->enc_setting.CMR = 15; 
     1051        s->enc_setting.cmr = 15; 
    10381052         
    10391053        s->dec_setting.amr_nb = ippc->pt == PJMEDIA_RTP_PT_AMR; 
    1040         s->dec_setting.octet_aligned = 0; 
     1054        s->dec_setting.octet_aligned = octet_align; 
    10411055        s->dec_setting.reorder = PJ_TRUE; 
    10421056    } 
Note: See TracChangeset for help on using the changeset viewer.