Ignore:
Timestamp:
Mar 17, 2006 12:16:01 AM (18 years ago)
Author:
bennylp
Message:

Added feature in conference bridge to get and set the signal level of individual port and individual stream direction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia/conference.h

    r322 r323  
    5959    PJMEDIA_CONF_NO_MIC  = 1,   /**< Disable audio streams from the 
    6060                                     microphone device.                     */ 
     61    PJMEDIA_CONF_NO_DEVICE = 2, /**< Do not create sound device.            */ 
    6162}; 
    6263 
    6364 
    6465/** 
    65  * Create conference bridge. This normally will also create instances of 
    66  * sound device to be attached to the port zero of the bridge. 
     66 * Create conference bridge with the specified parameters. The sampling rate, 
     67 * samples per frame, and bits per sample will be used for the internal 
     68 * operation of the bridge (e.g. when mixing audio frames). However, ports  
     69 * with different configuration may be connected to the bridge. In this case, 
     70 * the bridge is able to perform sampling rate conversion, and buffering in  
     71 * case the samples per frame is different. 
     72 * 
     73 * For this version of PJMEDIA, only 16bits per sample is supported. 
     74 * 
     75 * For this version of PJMEDIA, the channel count of the ports MUST match 
     76 * the channel count of the bridge. 
     77 * 
     78 * Under normal operation (i.e. when PJMEDIA_CONF_NO_DEVICE option is NOT 
     79 * specified), the bridge internally create an instance of sound device 
     80 * and connect the sound device to port zero of the bridge.  
     81 * 
     82 * If PJMEDIA_CONF_NO_DEVICE options is specified, no sound device will 
     83 * be created in the conference bridge. Application MUST acquire the port 
     84 * interface of the bridge by calling #pjmedia_conf_get_master_port(), and 
     85 * connect this port interface to a sound device port by calling 
     86 * #pjmedia_snd_port_connect(). 
     87 * 
     88 * The sound device is crucial for the bridge's operation, because it provides 
     89 * the bridge with necessary clock to process the audio frames periodically. 
     90 * Internally, the bridge runs when get_frame() to port zero is called. 
    6791 * 
    6892 * @param pool              Pool to use to allocate the bridge and  
     
    114138 
    115139/** 
     140 * Get the master port interface of the conference bridge. The master port 
     141 * corresponds to the port zero of the bridge. This is only usefull when  
     142 * application wants to manage the sound device by itself, instead of  
     143 * allowing the bridge to automatically create a sound device implicitly. 
     144 * 
     145 * This function will only return a port interface if PJMEDIA_CONF_NO_DEVICE 
     146 * option was specified when the bridge was created. 
     147 * 
     148 * Application can connect the port returned by this function to a  
     149 * sound device by calling #pjmedia_snd_port_connect(). 
     150 * 
     151 * @param conf              The conference bridge. 
     152 * 
     153 * @return                  The port interface of port zero of the bridge, 
     154 *                          only when PJMEDIA_CONF_NO_DEVICE options was 
     155 *                          specified when the bridge was created. 
     156 */ 
     157PJ_DECL(pjmedia_port*) pjmedia_conf_get_master_port(pjmedia_conf *conf); 
     158 
     159 
     160/** 
    116161 * Add stream port to the conference bridge. By default, the new conference 
    117162 * port will have both TX and RX enabled, but it is not connected to any 
     
    161206 * @param src_slot      Source slot. 
    162207 * @param sink_slot     Sink slot. 
     208 * @param level         This argument is reserved for future improvements 
     209 *                      where it is possible to adjust the level of signal 
     210 *                      transmitted in a specific connection. For now, 
     211 *                      this argument MUST be zero. 
    163212 * 
    164213 * @return              PJ_SUCCES on success. 
     
    166215PJ_DECL(pj_status_t) pjmedia_conf_connect_port( pjmedia_conf *conf, 
    167216                                                unsigned src_slot, 
    168                                                 unsigned sink_slot ); 
     217                                                unsigned sink_slot, 
     218                                                int level ); 
    169219 
    170220 
     
    224274PJ_DECL(pj_status_t) pjmedia_conf_get_ports_info(pjmedia_conf *conf, 
    225275                                                 unsigned *size, 
    226                                                  pjmedia_conf_port_info info[]); 
     276                                                 pjmedia_conf_port_info info[] 
     277                                                 ); 
     278 
     279 
     280/** 
     281 * Get last signal level transmitted to or received from the specified port. 
     282 * The signal level is an integer value in zero to 255, with zero indicates 
     283 * no signal, and 255 indicates the loudest signal level. 
     284 * 
     285 * @param conf          The conference bridge. 
     286 * @param slot          Slot number. 
     287 * @param tx_level      Optional argument to receive the level of signal 
     288 *                      transmitted to the specified port (i.e. the direction 
     289 *                      is from the bridge to the port). 
     290 * @param rx_level      Optional argument to receive the level of signal 
     291 *                      received from the port (i.e. the direction is from the 
     292 *                      port to the bridge). 
     293 * 
     294 * @return              PJ_SUCCESS on success. 
     295 */ 
     296PJ_DECL(pj_status_t) pjmedia_conf_get_signal_level(pjmedia_conf *conf, 
     297                                                   unsigned slot, 
     298                                                   unsigned *tx_level, 
     299                                                   unsigned *rx_level); 
     300 
     301 
     302/** 
     303 * Adjust the level of signal received from the specified port. 
     304 * Application may adjust the level to make the signal received from the port 
     305 * either louder or more quiet, by giving the value from +127 to -128. The 
     306 * value zero indicates no adjustment, the value -128 will mute the signal,  
     307 * and the value of +127 will make the signal twice as loud. 
     308 * 
     309 * @param conf          The conference bridge. 
     310 * @param slot          Slot number. 
     311 * @param adj_level     Adjustment level, with valid values are from -128 
     312 *                      to +127. A value of zero means there is no level 
     313 *                      adjustment to be made, the value -128 will mute the  
     314 *                      signal, and the value of +127 will make the signal  
     315 *                      twice as loud. 
     316 * 
     317 * @return              PJ_SUCCESS on success. 
     318 */ 
     319PJ_DECL(pj_status_t) pjmedia_conf_adjust_rx_level( pjmedia_conf *conf, 
     320                                                   unsigned slot, 
     321                                                   int adj_level ); 
     322 
     323 
     324/** 
     325 * Adjust the level of signal to be transmitted to the specified port. 
     326 * Application may adjust the level to make the signal transmitted to the port 
     327 * either louder or more quiet, by giving the value from +127 to -128. The 
     328 * value zero indicates no adjustment, the value -128 will mute the signal,  
     329 * and the value of +127 will make the signal twice as loud. 
     330 * 
     331 * @param conf          The conference bridge. 
     332 * @param slot          Slot number. 
     333 * @param adj_level     Adjustment level, with valid values are from -128 
     334 *                      to +127. A value of zero means there is no level 
     335 *                      adjustment to be made, the value -128 will mute the  
     336 *                      signal, and the value of +127 will make the signal  
     337 *                      twice as loud. 
     338 * 
     339 * @return              PJ_SUCCESS on success. 
     340 */ 
     341PJ_DECL(pj_status_t) pjmedia_conf_adjust_tx_level( pjmedia_conf *conf, 
     342                                                   unsigned slot, 
     343                                                   int adj_level ); 
     344 
    227345 
    228346 
Note: See TracChangeset for help on using the changeset viewer.