Ignore:
Timestamp:
Dec 30, 2006 2:46:57 AM (18 years ago)
Author:
bennylp
Message:

Implement ticket #40: support for asymmetric encoding/decoding ptime (e.g. with iLBC when local and remote have different mode)

File:
1 edited

Legend:

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

    r867 r874  
    6464                                    pj_pool_t *pool ); 
    6565static pj_status_t  ilbc_codec_open(pjmedia_codec *codec,  
    66                                     const pjmedia_codec_param *attr ); 
     66                                    pjmedia_codec_param *attr ); 
    6767static pj_status_t  ilbc_codec_close(pjmedia_codec *codec ); 
    6868static pj_status_t  ilbc_codec_modify(pjmedia_codec *codec,  
     
    365365 */ 
    366366static pj_status_t ilbc_codec_open(pjmedia_codec *codec,  
    367                                    const pjmedia_codec_param *param_attr ) 
     367                                   pjmedia_codec_param *attr ) 
    368368{ 
    369369    struct ilbc_codec *ilbc_codec = (struct ilbc_codec*)codec; 
    370     pjmedia_codec_param attr_copy, *attr; 
    371370    pj_status_t status; 
    372371 
     
    374373    pj_assert(ilbc_codec->enc_ready == PJ_FALSE &&  
    375374              ilbc_codec->dec_ready == PJ_FALSE); 
    376  
    377     /* Copy param to temporary location since we need to modify fmtp_mode */ 
    378     pj_memcpy(&attr_copy, param_attr, sizeof(*param_attr)); 
    379     attr = &attr_copy; 
    380375 
    381376    /* Decoder mode must be set */ 
     
    392387    PJ_ASSERT_RETURN(attr->setting.enc_fmtp_mode==20 || 
    393388                     attr->setting.enc_fmtp_mode==30, PJMEDIA_CODEC_EINMODE); 
     389 
     390    /* Update enc_ptime in the param */ 
     391    if (attr->setting.enc_fmtp_mode != attr->setting.dec_fmtp_mode) { 
     392        attr->info.enc_ptime = attr->setting.enc_fmtp_mode; 
     393    } else { 
     394        attr->info.enc_ptime = 0; 
     395    } 
    394396 
    395397    /* Create enc */ 
Note: See TracChangeset for help on using the changeset viewer.