Changeset 5058


Ignore:
Timestamp:
Apr 9, 2015 8:15:48 AM (4 years ago)
Author:
nanang
Message:

Re #1794:

  • Updated G7221, the bitrate can also be set via param.info.avg_bps, this is applicable only when param.setting.dec_fmtp doesn't contain bitrate info.
  • Fixed failing codec vector test in pjmedia-test due to wrong G7221 bitrate setting.
Location:
pjproject/trunk/pjmedia
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia-codec/g7221.h

    r3553 r5058  
    7676 * - for 14kHz audio bandwidth (32kHz sampling rate): 24000 to 48000 bps, 
    7777 *   multiplication of 400 
     78 * 
     79 * The bitrate is set via <tt>param.setting.dec_fmtp</tt>, if it does not 
     80 * contain bitrate info, the codec will check <tt>param.info.avg_bps</tt>. 
    7881 * 
    7982 * \note 
  • pjproject/trunk/pjmedia/src/pjmedia-codec/g7221.c

    r4987 r5058  
    679679    } 
    680680 
    681     /* Validation mode first! */ 
     681    if (fmtp_bitrate == 0) 
     682        fmtp_bitrate = attr->info.avg_bps; 
     683 
     684    /* Validate bitrate */ 
    682685    if (!fmtp_bitrate || !validate_mode(attr->info.clock_rate, fmtp_bitrate)) 
    683686        return PJMEDIA_CODEC_EINMODE; 
  • pjproject/trunk/pjmedia/src/test/codec_vectors.c

    r4712 r5058  
    7474    codec_param.info.avg_bps = bitrate; 
    7575    codec_param.setting.vad = 0; 
     76 
     77    /* For G7221, the bitrate is set via param.setting.dec_fmtp, if it has 
     78     * no info about bitrate, the codec will check info.avg_bps. So, let's 
     79     * just clear the SDP fmtp. 
     80     */ 
     81    if (pj_ansi_strstr(codec_name, "G7221/")) { 
     82        codec_param.setting.dec_fmtp.cnt = 0; 
     83    } 
    7684 
    7785    status = pjmedia_codec_init(codec, pool); 
     
    325333    codec_param.info.avg_bps = bitrate; 
    326334    codec_param.setting.vad = 0; 
     335 
     336    /* For G7221, the bitrate is set via param.setting.dec_fmtp, if it has 
     337     * no info about bitrate, the codec will check info.avg_bps. So, let's 
     338     * just clear the SDP fmtp. 
     339     */ 
     340    if (pj_ansi_strstr(codec_name, "G7221/")) { 
     341        codec_param.setting.dec_fmtp.cnt = 0; 
     342    } 
    327343 
    328344    status = pjmedia_codec_init(codec, pool); 
Note: See TracChangeset for help on using the changeset viewer.