Changeset 4680


Ignore:
Timestamp:
Dec 5, 2013 4:15:24 AM (10 years ago)
Author:
bennylp
Message:

Re #1519: added Tx/Rx? level adjustment in conf port info in pjsua-lib and pjsua2, and format in conf_port_info

Location:
pjproject/branches/projects/pjsua2/pjsip
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/pjsua2/pjsip/include/pjsua-lib/pjsua.h

    r4639 r4680  
    58005800    pj_str_t            name; 
    58015801 
     5802    /** Format. */ 
     5803    pjmedia_format      format; 
     5804 
    58025805    /** Clock rate. */ 
    58035806    unsigned            clock_rate; 
     
    58115814    /** Bits per sample */ 
    58125815    unsigned            bits_per_sample; 
     5816 
     5817    /** Tx level adjustment. */ 
     5818    float               tx_level_adj; 
     5819 
     5820    /** Rx level adjustment. */ 
     5821    float               rx_level_adj; 
    58135822 
    58145823    /** Number of listeners in the array. */ 
  • pjproject/branches/projects/pjsua2/pjsip/include/pjsua2/media.hpp

    r4676 r4680  
    123123 
    124124    /** 
     125     * Tx level adjustment. Value 1.0 means no adjustment, value 0 means 
     126     * the port is muted, value 2.0 means the level is amplified two times. 
     127     */ 
     128    float               txLevelAdj; 
     129 
     130    /** 
     131     * Rx level adjustment. Value 1.0 means no adjustment, value 0 means 
     132     * the port is muted, value 2.0 means the level is amplified two times. 
     133     */ 
     134    float               rxLevelAdj; 
     135 
     136    /** 
    125137     * Array of listeners (in other words, ports where this port is 
    126138     * transmitting to. 
     
    133145     */ 
    134146    void fromPj(const pjsua_conf_port_info &port_info); 
    135  
    136147}; 
    137148 
     
    238249    /** 
    239250     * Get the last received signal level. 
     251     * 
     252     * @return                  Signal level in percent. 
    240253     */ 
    241254    unsigned getRxLevel() const throw(Error); 
     
    243256    /** 
    244257     * Get the last transmitted signal level. 
     258     * 
     259     * @return                  Signal level in percent. 
    245260     */ 
    246261    unsigned getTxLevel() const throw(Error); 
  • pjproject/branches/projects/pjsua2/pjsip/src/pjsua-lib/pjsua_aud.c

    r4537 r4680  
    742742    info->slot_id = id; 
    743743    info->name = cinfo.name; 
     744    info->format = cinfo.format; 
    744745    info->clock_rate = cinfo.clock_rate; 
    745746    info->channel_count = cinfo.channel_count; 
    746747    info->samples_per_frame = cinfo.samples_per_frame; 
    747748    info->bits_per_sample = cinfo.bits_per_sample; 
     749    info->tx_level_adj = ((float)cinfo.tx_adj_level) / 128 + 1; 
     750    info->rx_level_adj = ((float)cinfo.rx_adj_level) / 128 + 1; 
    748751 
    749752    /* Build array of listeners */ 
  • pjproject/branches/projects/pjsua2/pjsip/src/pjsua2/media.cpp

    r4678 r4680  
    7676    portId = port_info.slot_id; 
    7777    name = pj2Str(port_info.name); 
    78  
     78    format.fromPj(port_info.format); 
     79    txLevelAdj = port_info.tx_level_adj; 
     80    rxLevelAdj = port_info.rx_level_adj; 
     81 
     82    /* 
    7983    format.id = PJMEDIA_FORMAT_PCM; 
    8084    format.type = PJMEDIA_TYPE_AUDIO; 
     
    9094                                    port_info.channel_count * 
    9195                                    port_info.bits_per_sample; 
    92  
     96    */ 
    9397    listeners.clear(); 
    9498    for (unsigned i=0; i<port_info.listener_cnt; ++i) { 
Note: See TracChangeset for help on using the changeset viewer.