- Timestamp:
- Mar 8, 2006 12:37:22 PM (19 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/conference.h
r277 r312 41 41 typedef struct pjmedia_conf_port_info 42 42 { 43 unsigned slot; 44 pj_str_t name; 45 pjmedia_port_op tx_setting; 46 pjmedia_port_op rx_setting; 47 pj_bool_t *listener; 48 unsigned clock_rate; 49 unsigned samples_per_frame; 43 unsigned slot; /**< Slot number. */ 44 pj_str_t name; /**< Port name. */ 45 pjmedia_port_op tx_setting; /**< Transmit settings. */ 46 pjmedia_port_op rx_setting; /**< Receive settings. */ 47 pj_bool_t *listener; /**< Array of listeners. */ 48 unsigned clock_rate; /**< Clock rate of the port. */ 49 unsigned samples_per_frame; /**< Samples per frame */ 50 50 } pjmedia_conf_port_info; 51 51 52 52 53 53 /** 54 * Create conference bridge. 54 * Conference port options. The values here can be combined in bitmask to 55 * be specified when the conference bridge is created. 56 */ 57 enum pjmedia_conf_option 58 { 59 PJMEDIA_CONF_NO_MIC = 1, /**< Disable audio streams from the 60 microphone device. */ 61 }; 62 63 64 /** 65 * Create conference bridge. This normally will also create instances of 66 * sound device to be attached to the port zero of the bridge. 67 * 68 * @param pool Pool to use to allocate the bridge and 69 * additional buffers for the sound device. 70 * @param max_slots Maximum number of slots/ports to be created in 71 * the bridge. Note that the bridge internally uses 72 * one port for the sound device, so the actual 73 * maximum number of ports will be less one than 74 * this value. 75 * @param sampling_rate Set the sampling rate of the bridge. This value 76 * is also used to set the sampling rate of the 77 * sound device. 78 * @param samples_per_frame Set the number of samples per frame. This value 79 * is also used to set the sound device. 80 * @param bits_per_sample Set the number of bits per sample. This value 81 * is also used to set the sound device. Currently 82 * only 16bit per sample is supported. 83 * @param options Bitmask options to be set for the bridge. The 84 * options are constructed from #pjmedia_conf_option 85 * enumeration. 86 * @param p_conf Pointer to receive the conference bridge instance. 87 * 88 * @return PJ_SUCCESS if conference bridge can be created. 55 89 */ 56 90 PJ_DECL(pj_status_t) pjmedia_conf_create( pj_pool_t *pool, … … 59 93 unsigned samples_per_frame, 60 94 unsigned bits_per_sample, 95 unsigned options, 61 96 pjmedia_conf **p_conf ); 62 97 … … 64 99 /** 65 100 * Destroy conference bridge. 101 * 102 * @param conf The conference bridge. 103 * 104 * @return PJ_SUCCESS on success. 66 105 */ 67 106 PJ_DECL(pj_status_t) pjmedia_conf_destroy( pjmedia_conf *conf ); -
pjproject/trunk/pjmedia/src/pjmedia/conference.c
r279 r312 128 128 struct pjmedia_conf 129 129 { 130 unsigned options; /**< Bitmask options. */ 130 131 unsigned max_ports; /**< Maximum ports. */ 131 132 unsigned port_cnt; /**< Current number of ports. */ … … 334 335 unsigned samples_per_frame, 335 336 unsigned bits_per_sample, 337 unsigned options, 336 338 pjmedia_conf **p_conf ) 337 339 { … … 352 354 PJ_ASSERT_RETURN(conf->ports, PJ_ENOMEM); 353 355 356 conf->options = options; 354 357 conf->max_ports = max_ports; 355 358 conf->clock_rate = clock_rate; … … 386 389 static pj_status_t create_sound( pjmedia_conf *conf ) 387 390 { 388 /* Open recorder. */ 389 conf->snd_rec = pj_snd_open_recorder(-1 ,&conf->snd_info, &rec_cb, conf); 390 if (conf->snd_rec == NULL) { 391 return -1; 391 /* Open recorder only if mic is not disabled. */ 392 if ((conf->options & PJMEDIA_CONF_NO_MIC) == 0) { 393 conf->snd_rec = pj_snd_open_recorder(-1 ,&conf->snd_info, 394 &rec_cb, conf); 395 if (conf->snd_rec == NULL) { 396 return -1; 397 } 392 398 } 393 399 … … 395 401 conf->snd_player = pj_snd_open_player(-1, &conf->snd_info, &play_cb, conf); 396 402 if (conf->snd_player == NULL) { 397 pj_snd_stream_close(conf->snd_rec); 403 if (conf->snd_rec) { 404 pj_snd_stream_close(conf->snd_rec); 405 } 398 406 return -1; 399 407 } … … 426 434 pj_status_t status; 427 435 428 if (conf->snd_ rec== NULL) {436 if (conf->snd_player == NULL) { 429 437 status = create_sound(conf); 430 438 if (status != PJ_SUCCESS) -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r305 r312 183 183 pjmedia_conf *mconf; /**< Media conference. */ 184 184 pj_bool_t null_audio; /**< Null audio flag. */ 185 pj_bool_t no_mic; /**< Disable microphone. */ 185 186 char *wav_file; /**< WAV file name to play. */ 186 187 unsigned wav_slot; /**< WAV player slot in bridge */ -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r305 r312 612 612 static pj_status_t init_media(void) 613 613 { 614 614 unsigned options; 615 615 pj_status_t status; 616 616 … … 733 733 } 734 734 735 /* Init options for conference bridge. */ 736 options = 0; 737 if (pjsua.no_mic) 738 options |= PJMEDIA_CONF_NO_MIC; 739 735 740 /* Init conference bridge. */ 736 741 … … 739 744 pjsua.clock_rate, 740 745 pjsua.clock_rate * 20 / 1000, 16, 746 options, 741 747 &pjsua.mconf); 742 748 if (status != PJ_SUCCESS) { -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_settings.c
r305 r312 87 87 puts (" --uwb Enable ultra-wideband codecs and set clock-rate to 32KHz"); 88 88 puts (" --null-audio Use NULL audio device"); 89 puts (" --no-mic Disable microphone device"); 89 90 puts (" --play-file=file Play WAV file in conference bridge"); 90 91 puts (" --auto-play Automatically play the file (to incoming calls only)"); … … 218 219 int option_index; 219 220 enum { OPT_CONFIG_FILE, OPT_LOG_FILE, OPT_LOG_LEVEL, OPT_APP_LOG_LEVEL, 220 OPT_HELP, OPT_VERSION, OPT_NULL_AUDIO, 221 OPT_HELP, OPT_VERSION, OPT_NULL_AUDIO, OPT_NO_MIC, 221 222 OPT_LOCAL_PORT, OPT_PROXY, OPT_OUTBOUND_PROXY, OPT_REGISTRAR, 222 223 OPT_REG_TIMEOUT, OPT_ID, OPT_CONTACT, … … 241 242 { "uwb", 0, 0, OPT_UWB}, 242 243 { "null-audio", 0, 0, OPT_NULL_AUDIO}, 244 { "no-mic", 0, 0, OPT_NO_MIC}, 243 245 { "local-port", 1, 0, OPT_LOCAL_PORT}, 244 246 { "proxy", 1, 0, OPT_PROXY}, … … 344 346 break; 345 347 348 case OPT_NO_MIC: 349 pjsua.no_mic = 1; 350 break; 351 346 352 case OPT_WB: 347 353 pjsua.clock_rate = 16000;
Note: See TracChangeset
for help on using the changeset viewer.