Ignore:
Timestamp:
Jan 26, 2010 3:29:23 PM (14 years ago)
Author:
nanang
Message:

Ticket #1028:

  • Added new API pjmedia_codec_mgr_set_default_param() to set/update default codec parameter and implemented pjsua_codec_set_param() based on it.
  • Added mutex in codec manager to protect states manipulations.
  • Modified API pjmedia_codec_mgr_init() to add pool factory param.
  • Added new API pjmedia_codec_mgr_destroy().
  • Updated passthrough codec AMR to regard peer's mode-set setting.
  • Fixed VAS audio device to apply AMR encoding bitrate setting.
  • Fixed IPP codec codec_open() to update AMR bitrate info (for stream) when AMR encoding bitrate is not using the default, e.g: requested by peer via format param 'mode-set' in SDP.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c

    r3041 r3074  
    30553055 * Set codec parameters. 
    30563056 */ 
    3057 PJ_DEF(pj_status_t) pjsua_codec_set_param( const pj_str_t *id, 
     3057PJ_DEF(pj_status_t) pjsua_codec_set_param( const pj_str_t *codec_id, 
    30583058                                           const pjmedia_codec_param *param) 
    30593059{ 
    3060     PJ_UNUSED_ARG(id); 
    3061     PJ_UNUSED_ARG(param); 
    3062     PJ_TODO(set_codec_param); 
    3063     return PJ_SUCCESS; 
    3064 } 
     3060    const pjmedia_codec_info *info[2]; 
     3061    pjmedia_codec_mgr *codec_mgr; 
     3062    unsigned count = 2; 
     3063    pj_status_t status; 
     3064 
     3065    codec_mgr = pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt); 
     3066 
     3067    status = pjmedia_codec_mgr_find_codecs_by_id(codec_mgr, codec_id, 
     3068                                                 &count, info, NULL); 
     3069    if (status != PJ_SUCCESS) 
     3070        return status; 
     3071 
     3072    /* Codec ID should be specific, except for G.722.1 */ 
     3073    if (count > 1 &&  
     3074        pj_strnicmp2(codec_id, "G7221/16", 8) != 0 && 
     3075        pj_strnicmp2(codec_id, "G7221/32", 8) != 0) 
     3076    { 
     3077        pj_assert(!"Codec ID is not specific"); 
     3078        return PJ_ETOOMANY; 
     3079    } 
     3080 
     3081    status = pjmedia_codec_mgr_set_default_param(codec_mgr, info[0], param); 
     3082    return status; 
     3083} 
Note: See TracChangeset for help on using the changeset viewer.