- Timestamp:
- Aug 21, 2009 11:12:19 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r2897 r2906 24 24 #define NO_LIMIT (int)0x7FFFFFFF 25 25 26 //#define STEREO_DEMO26 #define STEREO_DEMO 27 27 //#define TRANSPORT_ADAPTER_SAMPLE 28 28 … … 104 104 #ifdef STEREO_DEMO 105 105 pjmedia_snd_port *snd; 106 pjmedia_port *sc, *sc_ch1; 107 pjsua_conf_port_id sc_ch1_slot; 106 108 #endif 107 109 … … 4679 4681 app_config.snd = NULL; 4680 4682 } 4683 if (app_config.sc_ch1) { 4684 pjsua_conf_remove_port(app_config.sc_ch1_slot); 4685 app_config.sc_ch1_slot = PJSUA_INVALID_ID; 4686 pjmedia_port_destroy(app_config.sc_ch1); 4687 app_config.sc_ch1 = NULL; 4688 } 4689 if (app_config.sc) { 4690 pjmedia_port_destroy(app_config.sc); 4691 app_config.sc = NULL; 4692 } 4681 4693 #endif 4682 4694 … … 4718 4730 4719 4731 #ifdef STEREO_DEMO 4732 /* 4733 * In this stereo demo, we open the sound device in stereo mode and 4734 * arrange the attachment to the PJSUA-LIB conference bridge as such 4735 * so that channel0/left channel of the sound device corresponds to 4736 * slot 0 in the bridge, and channel1/right channel of the sound 4737 * device corresponds to slot 1 in the bridge. Then user can independently 4738 * feed different media to/from the speakers/microphones channels, by 4739 * connecting them to slot 0 or 1 respectively. 4740 * 4741 * Here's how the connection looks like: 4742 * 4743 +-----------+ stereo +-----------------+ 2x mono +-----------+ 4744 | AUDIO DEV |<------>| SPLITCOMB left|<------->|#0 BRIDGE | 4745 +-----------+ | right|<------->|#1 | 4746 +-----------------+ +-----------+ 4747 */ 4720 4748 static void stereo_demo() 4721 4749 { 4722 pjmedia_port *conf , *splitter, *ch1;4750 pjmedia_port *conf; 4723 4751 pj_status_t status; 4724 4752 … … 4733 4761 conf->info.bits_per_sample, 4734 4762 0 /* options */, 4735 & splitter);4763 &app_config.sc); 4736 4764 pj_assert(status == PJ_SUCCESS); 4737 4765 4738 4766 /* Connect channel0 (left channel?) to conference port slot0 */ 4739 status = pjmedia_splitcomb_set_channel( splitter, 0 /* ch0 */,4767 status = pjmedia_splitcomb_set_channel(app_config.sc, 0 /* ch0 */, 4740 4768 0 /*options*/, 4741 4769 conf); … … 4744 4772 /* Create reverse channel for channel1 (right channel?)... */ 4745 4773 status = pjmedia_splitcomb_create_rev_channel(app_config.pool, 4746 splitter,4774 app_config.sc, 4747 4775 1 /* ch1 */, 4748 4776 0 /* options */, 4749 & ch1);4777 &app_config.sc_ch1); 4750 4778 pj_assert(status == PJ_SUCCESS); 4751 4779 … … 4753 4781 * if there's no other devices connected to the bridge) 4754 4782 */ 4755 status = pjsua_conf_add_port(app_config.pool, ch1, NULL); 4783 status = pjsua_conf_add_port(app_config.pool, app_config.sc_ch1, 4784 &app_config.sc_ch1_slot); 4756 4785 pj_assert(status == PJ_SUCCESS); 4757 4786 … … 4767 4796 4768 4797 /* Connect the splitter to the sound device */ 4769 status = pjmedia_snd_port_connect(app_config.snd, splitter);4798 status = pjmedia_snd_port_connect(app_config.snd, app_config.sc); 4770 4799 pj_assert(status == PJ_SUCCESS); 4771 4800
Note: See TracChangeset
for help on using the changeset viewer.