Ignore:
Timestamp:
Feb 21, 2006 12:11:18 AM (18 years ago)
Author:
bennylp
Message:

Initial conference implementation

File:
1 moved

Legend:

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

    r203 r205  
    2222 
    2323/** 
    24  * @file conf.h 
     24 * @file conference.h 
    2525 * @brief Conference bridge. 
    2626 */ 
    27 #include <pjmedia/types.h> 
     27#include <pjmedia/port.h> 
     28 
     29 
     30PJ_BEGIN_DECL 
     31 
    2832 
    2933/** 
     
    3236typedef struct pjmedia_conf pjmedia_conf; 
    3337 
     38/** 
     39 * Conference port info. 
     40 */ 
     41typedef struct pjmedia_conf_port_info 
     42{ 
     43    pj_str_t            name; 
     44    pjmedia_port_op     tx_setting; 
     45    pjmedia_port_op     rx_setting; 
     46    pj_bool_t          *listener; 
     47} pjmedia_conf_port_info; 
     48 
    3449 
    3550/** 
     
    3752 */ 
    3853PJ_DECL(pj_status_t) pjmedia_conf_create( pj_pool_t *pool, 
    39                                           unsigned max_ports, 
     54                                          unsigned max_slots, 
     55                                          unsigned sampling_rate, 
     56                                          unsigned samples_per_frame, 
     57                                          unsigned bits_per_sample, 
    4058                                          pjmedia_conf **p_conf ); 
    4159 
    4260 
    4361/** 
    44  * Add stream port to the conference bridge. 
     62 * Destroy conference bridge. 
     63 */ 
     64PJ_DECL(pj_status_t) pjmedia_conf_destroy( pjmedia_conf *conf ); 
     65 
     66 
     67/** 
     68 * Add stream port to the conference bridge. By default, the new conference 
     69 * port will have both TX and RX enabled, but it is not connected to any 
     70 * other ports. 
     71 * 
     72 * Application SHOULD call #pjmedia_conf_connect_port() to enable audio 
     73 * transmission and receipt to/from this port. 
     74 * 
     75 * @param conf          The conference bridge. 
     76 * @param pool          Pool to allocate buffers for this port. 
     77 * @param strm_port     Stream port interface. 
     78 * @param name          Port name. 
     79 * @param p_slot        Pointer to receive the slot index of the port in 
     80 *                      the conference bridge. 
     81 * 
     82 * @return              PJ_SUCCESS on success. 
    4583 */ 
    4684PJ_DECL(pj_status_t) pjmedia_conf_add_port( pjmedia_conf *conf, 
    4785                                            pj_pool_t *pool, 
    48                                             pjmedia_stream_port *strm_port, 
    49                                             const pj_str_t *port_name, 
    50                                             unsigned *p_port ); 
     86                                            pjmedia_port *strm_port, 
     87                                            const pj_str_t *name, 
     88                                            unsigned *p_slot ); 
     89 
    5190 
    5291 
    5392/** 
    54  * Mute or unmute port. 
     93 * Change TX and RX settings for the port. 
     94 * 
     95 * @param conf          The conference bridge. 
     96 * @param slot          Port number/slot in the conference bridge. 
     97 * @param tx            Settings for the transmission TO this port. 
     98 * @param rx            Settings for the receipt FROM this port. 
     99 * 
     100 * @return              PJ_SUCCESS on success. 
    55101 */ 
    56 PJ_DECL(pj_status_t) pjmedia_conf_set_mute( pjmedia_conf *conf, 
    57                                             unsigned port, 
    58                                             pj_bool_t mute ); 
     102PJ_DECL(pj_status_t) pjmedia_conf_configure_port( pjmedia_conf *conf, 
     103                                                  unsigned slot, 
     104                                                  pjmedia_port_op tx, 
     105                                                  pjmedia_port_op rx); 
    59106 
    60107 
    61108/** 
    62  * Set the specified port to be member of conference bridge. 
     109 * Enable unidirectional audio from the specified source slot to the 
     110 * specified sink slot. 
     111 * 
     112 * @param conf          The conference bridge. 
     113 * @param src_slot      Source slot. 
     114 * @param sink_slot     Sink slot. 
     115 * 
     116 * @return              PJ_SUCCES on success. 
    63117 */ 
    64 PJ_DECL(pj_status_t) pjmedia_conf_set_membership( pjmedia_conf *conf, 
    65                                                   unsigned port, 
    66                                                   pj_bool_t enabled ); 
     118PJ_DECL(pj_status_t) pjmedia_conf_connect_port( pjmedia_conf *conf, 
     119                                                unsigned src_slot, 
     120                                                unsigned sink_slot ); 
    67121 
    68122 
    69123/** 
    70  * Remove the specified port. 
     124 * Disconnect unidirectional audio from the specified source to the specified 
     125 * sink slot. 
     126 * 
     127 * @param conf          The conference bridge. 
     128 * @param src_slot      Source slot. 
     129 * @param sink_slot     Sink slot. 
     130 * 
     131 * @reutrn              PJ_SUCCESS on success. 
     132 */ 
     133PJ_DECL(pj_status_t) pjmedia_conf_disconnect_port( pjmedia_conf *conf, 
     134                                                   unsigned src_slot, 
     135                                                   unsigned sink_slot ); 
     136 
     137 
     138/** 
     139 * Remove the specified port from the conference bridge. 
     140 * 
     141 * @param conf          The conference bridge. 
     142 * @param slot          The port index to be removed. 
     143 * 
     144 * @return              PJ_SUCCESS on success. 
    71145 */ 
    72146PJ_DECL(pj_status_t) pjmedia_conf_remove_port( pjmedia_conf *conf, 
    73                                                unsigned port ); 
     147                                               unsigned slot ); 
    74148 
     149 
     150 
     151/** 
     152 * Get port info. 
     153 */ 
     154PJ_DECL(pj_status_t) pjmedia_conf_get_port_info( pjmedia_conf *conf, 
     155                                                 unsigned slot, 
     156                                                 pjmedia_conf_port_info *info); 
     157 
     158 
     159PJ_END_DECL 
    75160 
    76161 
Note: See TracChangeset for help on using the changeset viewer.