- Timestamp:
- Nov 27, 2006 9:54:03 AM (18 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/conference.h
r655 r833 173 173 174 174 /** 175 * Set master port name. 176 * 177 * @param conf The conference bridge. 178 * @param name Name to be assigned. 179 * 180 * @return PJ_SUCCESS on success. 181 */ 182 PJ_DECL(pj_status_t) pjmedia_conf_set_port0_name(pjmedia_conf *conf, 183 const pj_str_t *name); 184 185 186 /** 175 187 * Add media port to the conference bridge. 176 188 * -
pjproject/trunk/pjmedia/src/pjmedia/conference.c
r796 r833 182 182 pjmedia_snd_port *snd_dev_port; /**< Sound device port. */ 183 183 pjmedia_port *master_port; /**< Port zero's port. */ 184 char master_name_buf[80]; /**< Port0 name buffer. */ 184 185 pj_mutex_t *mutex; /**< Conference mutex. */ 185 186 struct conf_port **ports; /**< Array of ports. */ … … 391 392 392 393 if ((conf->options & PJMEDIA_CONF_NO_DEVICE) == 0) { 394 pjmedia_snd_stream *strm; 395 pjmedia_snd_stream_info si; 393 396 394 397 /* … … 415 418 if (status != PJ_SUCCESS) 416 419 return status; 420 421 strm = pjmedia_snd_port_get_snd_stream(conf->snd_dev_port); 422 status = pjmedia_snd_stream_get_info(strm, &si); 423 if (status == PJ_SUCCESS) { 424 const pjmedia_snd_dev_info *snd_dev_info; 425 if (conf->options & PJMEDIA_CONF_NO_MIC) 426 snd_dev_info = pjmedia_snd_get_dev_info(si.play_id); 427 else 428 snd_dev_info = pjmedia_snd_get_dev_info(si.rec_id); 429 pj_strdup2_with_null(pool, &conf_port->name, snd_dev_info->name); 430 } 417 431 } 418 432 … … 582 596 } 583 597 598 599 /* 600 * Set master port name. 601 */ 602 PJ_DEF(pj_status_t) pjmedia_conf_set_port0_name(pjmedia_conf *conf, 603 const pj_str_t *name) 604 { 605 int len; 606 607 /* Sanity check. */ 608 PJ_ASSERT_RETURN(conf != NULL && name != NULL, PJ_EINVAL); 609 610 len = name->slen; 611 if (len > sizeof(conf->master_name_buf)) 612 len = sizeof(conf->master_name_buf); 613 614 if (len > 0) pj_memcpy(conf->master_name_buf, name->ptr, len); 615 616 conf->ports[0]->name.ptr = conf->master_name_buf; 617 conf->ports[0]->name.slen = len; 618 619 if (conf->master_port) 620 conf->master_port->info.name = conf->ports[0]->name; 621 622 return PJ_SUCCESS; 623 } 584 624 585 625 /* -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r815 r833 1013 1013 unsigned selected_clock_rate = 0; 1014 1014 unsigned i; 1015 pjmedia_snd_stream *strm; 1016 pjmedia_snd_stream_info si; 1017 pj_str_t tmp; 1015 1018 pj_status_t status = -1; 1016 1019 … … 1018 1021 close_snd_dev(); 1019 1022 1020 1021 cap_info = pjmedia_snd_get_dev_info(capture_dev);1022 play_info = pjmedia_snd_get_dev_info(playback_dev);1023 1023 1024 1024 /* Set default clock rate */ … … 1095 1095 pjsua_var.play_dev = playback_dev; 1096 1096 1097 /* Update sound device name. */ 1098 strm = pjmedia_snd_port_get_snd_stream(pjsua_var.snd_port); 1099 pjmedia_snd_stream_get_info(strm, &si); 1100 play_info = pjmedia_snd_get_dev_info(si.rec_id); 1101 1102 pjmedia_conf_set_port0_name(pjsua_var.mconf, 1103 pj_cstr(&tmp, play_info->name)); 1104 1097 1105 return PJ_SUCCESS; 1098 1106 }
Note: See TracChangeset
for help on using the changeset viewer.