Changes between Initial Version and Version 7 of Ticket #2181
- Timestamp:
- Apr 23, 2019 10:48:08 AM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #2181 – Description
initial v7 32 32 33 33 34 === Sample usage: three parties video conference using PJSUA===34 === Sample usage: three parties video conference === 35 35 36 36 Here are steps to setup a three parties video conference: 37 37 38 38 1. Make two video calls as normal to two other participants. 39 1. After all calls are established, simply connect those port IDs using {{{pjsua_vid_conf_connect()}}}, e.g: 39 1. After all calls are established, simply connect those port IDs using {{{pjsua_vid_conf_connect()}}} for PJSUA or {{{VideoMedia::startTransmit()}}} for PJSUA2, e.g: 40 - using PJSUA: 40 41 {{{ 41 ...42 42 /* Get video ports of call 1, there are two ports as in a video call as 43 43 * encoding and decoding directions may not use the same frame rate or … … 57 57 status = pjsua_vid_conf_connect(call_1_dec_port, call_2_enc_port, NULL); 58 58 status = pjsua_vid_conf_connect(call_2_dec_port, call_1_enc_port, NULL); 59 ... 59 }}} 60 - using PJSUA2 (exception handling excluded): 61 {{{ 62 /* Get video ports of call 1 */ 63 VideoMedia call_1_dec_port = call1->getDecodingVideoMedia(-1); 64 VideoMedia call_1_enc_port = call1->getEncodingVideoMedia(-1); 65 66 /* Get video ports of call 2 */ 67 VideoMedia call_2_dec_port = call2->getDecodingVideoMedia(-1); 68 VideoMedia call_2_enc_port = call2->getEncodingVideoMedia(-1); 69 70 /* Connect video ports of call 1 and call 2 */ 71 VideoMediaTransmitParam transmit_param; 72 call_1_dec_port.startTransmit(call_2_enc_port, transmit_param); 73 call_2_dec_port.startTransmit(call_1_enc_port, transmit_param); 60 74 }}} 61 75 1. At this point, each participant should be able to see video from the two other participants. The caller will see them in separate windows as it has two video calls (may be combined if preferred, see below), while the other two will only have one incoming video window as usual, just it contains a mixed video (from the caller and the other participant). 62 76 1. On the caller side, it may combine video window of call 1 and call 2 into a single window (for simpler UI management perhaps), e.g: 77 - using PJSUA: 63 78 {{{ 64 79 pjsua_vid_win_id wid1, wid2; … … 74 89 pjsua_vid_win_set_show(wid1, PJ_FALSE); 75 90 }}} 91 - using PJSUA2: 92 {{{ 93 /* Function for querying any first video window of the specified call */ 94 VideoWindow getCallVideoWindow(const Call *call) { 95 CallInfo ci = call->getInfo(); 96 CallMediaInfoVector::iterator it; 97 for (it = ci.media.begin(); it != ci.media.end(); ++it) { 98 if (it->type == PJMEDIA_TYPE_VIDEO && 99 it->videoIncomingWindowId != PJSUA_INVALID_ID) 100 { 101 return it->videoWindow; 102 } 103 } 104 return VideoWindow(PJSUA_INVALID_ID); 105 } 76 106 107 /* Put incoming video stream from call 1 into call 2 window */ 108 VideoWindow wid2 = getCallVideoWindow(call2); 109 VideoMediaTransmitParam transmit_param; 110 call_1_dec_port.startTransmit(wid2.getVideoMedia(), transmit_param); 111 112 /* Now hide the video window of call 1 */ 113 VideoWindow wid1 = getCallVideoWindow(call1); 114 wid1.Show(false); 115 }}}