Ignore:
Timestamp:
May 29, 2009 1:04:03 PM (15 years ago)
Author:
bennylp
Message:

Integration of Sipit24 branch, many tickets involved:

  • #793: AMR encoder should regard 'mode-set' param specified by remote decoder.
  • #831: Automatically switch to TCP transport when sending large request
  • #832: Support for outbound proxy setting without using Route header
  • #849: Modify conference audio switch behavior in connecting ports.
  • #850: Remove 'Require=replaces' param in 'Refer-To' header (in call transfer with replaces).
  • #851: Support for regular nomination in ICE
  • #852: --ip-addr support for IPv6 for media transport in pjsua
  • #854: Adding SOFTWARE attribute in all outgoing requests may cause compatibility problem with older STUN server (thanks Alexei Kuznetsov for the report)
  • #855: Bug in digit map frequencies for DTMF digits (thanks FCCH for the report)
  • #856: Put back the ICE candidate priority values according to the default values in the draft-mmusic-ice
  • #857: Support for ICE keep-alive with Binding indication
  • #858: Do not authenticate STUN 438 response
  • #859: AMR-WB format param in the SDP is not negotiated correctly.
  • #867: Return error instead of asserting when PJSUA-LIB fails to open log file
File:
1 edited

Legend:

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

    r2573 r2724  
    234234{ 
    235235#   if PJMEDIA_HAS_INTEL_IPP_CODEC_AMR 
     236    /* AMR-NB SID seems to produce noise, so let's just disable its VAD. */ 
    236237    {1, "AMR",      PJMEDIA_RTP_PT_AMR,       &USC_GSMAMR_Fxns,  8000, 1, 160,  
    237                     5900, 12200, 4, 1, 1,  
    238                     &predecode_amr, &parse_amr, &pack_amr 
    239                     /*, {1, {{{"octet-align", 11}, {"1", 1}}} } */ 
     238                    7400, 12200, 2, 0, 1,  
     239                    &predecode_amr, &parse_amr, &pack_amr, 
     240                    {1, {{{"octet-align", 11}, {"1", 1}}} } 
    240241    }, 
    241242#   endif 
     
    244245    {1, "AMR-WB",   PJMEDIA_RTP_PT_AMRWB,     &USC_AMRWB_Fxns,  16000, 1, 320, 
    245246                    15850, 23850, 1, 1, 1,  
    246                     &predecode_amr, &parse_amr, &pack_amr 
     247                    &predecode_amr, &parse_amr, &pack_amr, 
     248                    {1, {{{"octet-align", 11}, {"1", 1}}} } 
    247249    }, 
    248250#   endif 
     
    561563    /* Check Change Mode Request. */ 
    562564    if ((setting->amr_nb && cmr <= 7) || (!setting->amr_nb && cmr <= 8)) { 
     565        struct ipp_codec *ippc = &ipp_codec[codec_data->codec_idx]; 
     566 
    563567        s->enc_mode = cmr; 
     568        codec_data->info->params.modes.bitrate = s->enc_setting.amr_nb? 
     569                                pjmedia_codec_amrnb_bitrates[s->enc_mode] : 
     570                                pjmedia_codec_amrwb_bitrates[s->enc_mode]; 
     571        ippc->fxns->std.Control(&codec_data->info->params.modes,  
     572                                codec_data->enc); 
    564573    } 
    565574 
     
    10341043 
    10351044    /* Not sure if VAD affects decoder, just try to be safe */ 
    1036     codec_data->info->params.modes.vad = ippc->has_native_vad; 
     1045    //codec_data->info->params.modes.vad = ippc->has_native_vad; 
    10371046 
    10381047    /* Get number of memory blocks needed by the decoder */ 
     
    10851094        amr_settings_t *s; 
    10861095        pj_uint8_t octet_align = 0; 
    1087         const pj_str_t STR_FMTP_OCTET_ALIGN = {"octet-align", 11}; 
    1088  
    1089         /* Check octet-align */ 
     1096        pj_int8_t enc_mode = -1; 
     1097 
     1098        /* Check AMR specific attributes */ 
     1099 
    10901100        for (i = 0; i < attr->setting.dec_fmtp.cnt; ++i) { 
     1101            /* octet-align, one of the parameters that must have same value  
     1102             * in offer & answer (RFC 4867 Section 8.3.1). Just check fmtp 
     1103             * in the decoder side, since it's value is guaranteed to fulfil  
     1104             * above requirement (by SDP negotiator). 
     1105             */ 
     1106            const pj_str_t STR_FMTP_OCTET_ALIGN = {"octet-align", 11}; 
     1107             
    10911108            if (pj_stricmp(&attr->setting.dec_fmtp.param[i].name,  
    10921109                           &STR_FMTP_OCTET_ALIGN) == 0) 
    10931110            { 
    10941111                octet_align=(pj_uint8_t) 
    1095                             (pj_strtoul(&attr->setting.dec_fmtp.param[i].val)); 
     1112                            pj_strtoul(&attr->setting.dec_fmtp.param[i].val); 
    10961113                break; 
    10971114            } 
    10981115        } 
    1099  
     1116        for (i = 0; i < attr->setting.enc_fmtp.cnt; ++i) { 
     1117            /* mode-set */ 
     1118            const pj_str_t STR_FMTP_MODE_SET = {"mode-set", 8}; 
     1119             
     1120            if (pj_stricmp(&attr->setting.enc_fmtp.param[i].name,  
     1121                           &STR_FMTP_MODE_SET) == 0) 
     1122            { 
     1123                pj_int8_t tmp; 
     1124 
     1125                /* Just get the first value. */ 
     1126                tmp = (pj_int8_t) 
     1127                      pj_strtoul(&attr->setting.enc_fmtp.param[i].val); 
     1128 
     1129                if ((ippc->pt == PJMEDIA_RTP_PT_AMR && tmp > 0 && tmp < 8) || 
     1130                    (ippc->pt == PJMEDIA_RTP_PT_AMRWB && tmp > 0 && tmp < 9)) 
     1131                { 
     1132                    enc_mode = tmp; 
     1133                    PJ_LOG(4,(THIS_FILE, "Remote specifies AMR mode-set attr, " 
     1134                              "selected: %d", enc_mode)); 
     1135                } 
     1136                break; 
     1137            } 
     1138        } 
     1139 
     1140        /* Initialize AMR specific settings */ 
    11001141        s = PJ_POOL_ZALLOC_T(pool, amr_settings_t); 
    11011142        codec_data->codec_setting = s; 
    1102  
    1103         s->enc_mode = pjmedia_codec_amr_get_mode(ippc->def_bitrate); 
    1104         if (s->enc_mode < 0) 
    1105             goto on_error; 
    11061143 
    11071144        s->enc_setting.amr_nb = (pj_uint8_t)(ippc->pt == PJMEDIA_RTP_PT_AMR); 
     
    11091146        s->enc_setting.reorder = PJ_TRUE; 
    11101147        s->enc_setting.cmr = 15; 
    1111          
     1148 
    11121149        s->dec_setting.amr_nb = (pj_uint8_t)(ippc->pt == PJMEDIA_RTP_PT_AMR); 
    11131150        s->dec_setting.octet_aligned = octet_align; 
    11141151        s->dec_setting.reorder = PJ_TRUE; 
     1152 
     1153        s->enc_mode = pjmedia_codec_amr_get_mode( 
     1154                                    codec_data->info->params.modes.bitrate); 
     1155        if (s->enc_mode < 0) 
     1156            goto on_error; 
     1157 
     1158        if (enc_mode != -1) { 
     1159            s->enc_mode = enc_mode; 
     1160 
     1161            /* Apply requested encoder bitrate */ 
     1162            codec_data->info->params.modes.bitrate = s->enc_setting.amr_nb? 
     1163                                    pjmedia_codec_amrnb_bitrates[s->enc_mode] : 
     1164                                    pjmedia_codec_amrwb_bitrates[s->enc_mode]; 
     1165            ippc->fxns->std.Control(&codec_data->info->params.modes,  
     1166                                    codec_data->enc); 
     1167        }   
     1168 
    11151169    } 
    11161170#endif 
Note: See TracChangeset for help on using the changeset viewer.