Ignore:
Timestamp:
Jan 27, 2010 11:48:31 AM (14 years ago)
Author:
nanang
Message:

Ticket #1028: Recommit r3074 with updated codec.h.

File:
1 edited

Legend:

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

    r3075 r3078  
    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.