Ignore:
Timestamp:
May 15, 2018 8:23:44 AM (17 months ago)
Author:
ming
Message:

Closed #2113: Implement conference signal level adjustment for a specific connection

File:
1 edited

Legend:

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

    r5748 r5792  
    715715} 
    716716 
     717PJ_DEF(void) pjsua_conf_connect_param_default(pjsua_conf_connect_param *prm) 
     718{ 
     719    pj_bzero(prm, sizeof(*prm)); 
     720    prm->level = 1.0; 
     721} 
     722 
    717723/* 
    718724 * Get maxinum number of conference ports. 
     
    825831PJ_DEF(pj_status_t) pjsua_conf_connect( pjsua_conf_port_id source, 
    826832                                        pjsua_conf_port_id sink) 
     833{ 
     834    pjsua_conf_connect_param prm; 
     835 
     836    pjsua_conf_connect_param_default(&prm); 
     837    return pjsua_conf_connect2(source, sink, &prm); 
     838} 
     839                                         
     840/* 
     841 * Establish unidirectional media flow from souce to sink, with signal 
     842 * level adjustment. 
     843 */ 
     844PJ_DEF(pj_status_t) pjsua_conf_connect2( pjsua_conf_port_id source, 
     845                                         pjsua_conf_port_id sink, 
     846                                         const pjsua_conf_connect_param *prm) 
    827847{ 
    828848    pj_status_t status = PJ_SUCCESS; 
     
    958978 
    959979    if (status == PJ_SUCCESS) { 
    960         status = pjmedia_conf_connect_port(pjsua_var.mconf, source, sink, 0); 
     980        pjsua_conf_connect_param cc_param; 
     981         
     982        if (!prm) 
     983            pjsua_conf_connect_param_default(&cc_param); 
     984        else 
     985            pj_memcpy(&cc_param, prm, sizeof(cc_param)); 
     986        status = pjmedia_conf_connect_port(pjsua_var.mconf, source, sink,  
     987                                           (int)((cc_param.level-1) * 128)); 
    961988    } 
    962989 
Note: See TracChangeset for help on using the changeset viewer.