Changes between Version 8 and Version 9 of Video_Users_Guide
- Timestamp:
- Aug 15, 2011 8:49:33 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Video_Users_Guide
v8 v9 165 165 Regardless of the setting above, you can use the following steps to show or hide the display incoming video: 166 166 167 1. Use '''{{{pjsua_call_get_vid_stream_idx()}}}'''or enumerate the call's media stream to find the media index of the default video. If there are multiple video streams in a call, the default video is the first active video media in the call.168 1. Locate the media information of the specified stream index in the '''{{{pjsua_call_info}}}''', and acquire the window ID associated with the remote video. Sample code:167 1. Use {{{pjsua_call_get_vid_stream_idx()}}} or enumerate the call's media stream to find the media index of the default video. If there are multiple video streams in a call, the default video is the first active video media in the call. 168 1. Locate the media information of the specified stream index in the {{{pjsua_call_info}}}, and acquire the window ID associated with the remote video. Sample code: 169 169 {{{ 170 170 int vid_idx; … … 179 179 } 180 180 }}} 181 1. Using the video window ID, you may retrieve the associated native video handle with '''{{{pjsua_vid_win_get_info()}}}''' and then show or hide the video window using native API, or use '''{{{pjsua_vid_win_set_show()}}}'''to show/hide the window using PJSUA API. See [#wwin Working with Window] section below for information on manipulating video windows.181 1. Using the video window ID, you may retrieve the associated native video handle with {{{pjsua_vid_win_get_info()}}} and then show or hide the video window using native API, or use {{{pjsua_vid_win_set_show()}}} to show/hide the window using PJSUA API. See [#wwin Working with Window] section below for information on manipulating video windows. 182 182 183 183 ==== Controlling Incoming Video Stream ==== 184 184 185 Controlling the video window above will not cause any re-INVITE or UPDATE to be sent to remote, since the operation occurs locally. However, if you wish, you may alter the incoming video stream with '''{{{pjsua_call_set_vid_strm()}}}''' API, and this '''will''' cause re-INVITE or UPDATE to be sent to negotiate the new SDP. The relevant operation to control incoming video with '''{{{pjsua_call_set_vid_strm()}}}'''are:185 Controlling the video window above will not cause any re-INVITE or UPDATE to be sent to remote, since the operation occurs locally. However, if you wish, you may alter the incoming video stream with {{{pjsua_call_set_vid_strm()}}} API, and this '''will''' cause re-INVITE or UPDATE to be sent to negotiate the new SDP. The relevant operation to control incoming video with {{{pjsua_call_set_vid_strm()}}} are: 186 186 - ''PJSUA_CALL_VID_STRM_CHANGE_DIR'': change the media direction (e.g. to "sendonly", or even "inactive") 187 187 - ''PJSUA_CALL_VID_STRM_REMOVE'': remove the media stream altogether by settings its port to zero 188 188 - ''PJSUA_CALL_VID_STRM_ADD'': add new video media stream 189 189 190 Since '''{{{pjsua_call_set_vid_strm()}}}''' will result in renegotiation of the SDP in a re-INVITE or UPDATE transaction, the result of this operation will not be available immediately. Application can monitor the status by implementing '''{{{on_call_media_state()}}}''' callback and enumerate the media stream status with '''pjsua_call_info'''.190 Since {{{pjsua_call_set_vid_strm()}}} will result in renegotiation of the SDP in a re-INVITE or UPDATE transaction, the result of this operation will not be available immediately. Application can monitor the status by implementing {{{on_call_media_state()}}} callback and enumerate the media stream status with pjsua_call_info. 191 191 192 192 [[BR]] … … 194 194 === Outgoing Video Transmission === 195 195 196 Outgoing video transmission is independent from the incoming video transmission; each can be operated separately. Even though video is enabled by default on the account, outgoing video transmission '''is not started by default'''. Not even when incoming offer contains video support. This behavior is controlled by '''{{{pjsua_acc_config.vid_out_auto_transmit}}}''' setting, which default to ''PJ_FALSE''. Setting this to ''PJ_TRUE''' will cause video transmission to be started automatically on each outgoing calls and on incoming calls that indicates video support in its offer. However, it is more flexible and appropriate to leave this setting at PJ_FALSE, and add video later during the call by using '''{{{pjsua_call_set_vid_strm()}}}'''API, as will be explained shortly.196 Outgoing video transmission is independent from the incoming video transmission; each can be operated separately. Even though video is enabled by default on the account, outgoing video transmission '''is not started by default'''. Not even when incoming offer contains video support. This behavior is controlled by {{{pjsua_acc_config.vid_out_auto_transmit}}} setting, which default to ''PJ_FALSE''. Setting this to ''PJ_TRUE'' will cause video transmission to be started automatically on each outgoing calls and on incoming calls that indicates video support in its offer. However, it is more flexible and appropriate to leave this setting at PJ_FALSE, and add video later during the call by using {{{pjsua_call_set_vid_strm()}}} API, as will be explained shortly. 197 197 198 198 ==== Default Capture Device ==== 199 199 200 The default capture device that is used by an account is configured in '''{{{pjsua_acc_config.vid_cap_dev}}}'''setting. It is more convenient to set the "correct" device here rather than having to set it in every other API calls later.200 The default capture device that is used by an account is configured in {{{pjsua_acc_config.vid_cap_dev}}} setting. It is more convenient to set the "correct" device here rather than having to set it in every other API calls later. 201 201 202 202 ==== Controlling Video Stream ==== 203 203 204 Application uses '''{{{pjsua_call_set_vid_strm()}}}'''API to control video stream on a call. The following ''op_code'' can be used on the API to control the video media:204 Application uses {{{pjsua_call_set_vid_strm()}}} API to control video stream on a call. The following ''op_code'' can be used on the API to control the video media: 205 205 - ''PJSUA_CALL_VID_STRM_ADD'': add a new video stream 206 206 - ''PJSUA_CALL_VID_STRM_REMOVE'': remove video stream (set port to zero) … … 210 210 - ''PJSUA_CALL_VID_STRM_STOP_TRANSMIT'': stop transmission 211 211 212 Some of the video operations above require re-INVITE or UPDATE to be sent, hence the result will not be available immediately. In that case, application can implement '''{{{on_call_media_state()}}}''' callback and inspect the resulting negotiation by looking at the '''{{{pjsua_call_info}}}'''. Please see [#vcm Video Call Manipulation] in the API reference section below for more information about the operations above.212 Some of the video operations above require re-INVITE or UPDATE to be sent, hence the result will not be available immediately. In that case, application can implement {{{on_call_media_state()}}} callback and inspect the resulting negotiation by looking at the {{{pjsua_call_info}}}. Please see [#vcm Video Call Manipulation] in the API reference section below for more information about the operations above. 213 213 214 214 [[BR]] … … 219 219 220 220 Application may retrieve video windows from the following places: 221 - for calls, the video window of incoming video stream is contained in the media stream inside '''{{{pjsua_call_info}}}'''structure.222 - preview window associated with a capture device can be queried with '''{{{pjsua_vid_preview_get_win()}}}'''.223 - for all other purposes, application may enumerate all video windows with '''{{{pjsua_vid_enum_wins()}}}'''.224 225 Application retrieves '''{{{pjsua_vid_win_info}}}''' with '''{{{pjsua_vid_win_get_info()}}}'''. The one window property that most applications will be interested with is the native window handle of the video. The native video handle is contained by '''{{{pjmedia_vid_dev_hwnd}}}''' structure inside '''{{{pjsua_vid_win_info}}}'''. Application can use the native handle to embed the video window into application's GUI structure. Alternatively, the library also provides few simple and most commonly used API to operate the window, such as {{{pjsua_vid_win_set_show()}}}, {{{pjsua_vid_win_set_size()}}}, etc., however the availability of these APIs are not guaranteed since it depends on the underlying backend device.221 - for calls, the video window of incoming video stream is contained in the media stream inside {{{pjsua_call_info}}} structure. 222 - preview window associated with a capture device can be queried with {{{pjsua_vid_preview_get_win()}}}. 223 - for all other purposes, application may enumerate all video windows with {{{pjsua_vid_enum_wins()}}}. 224 225 Application retrieves {{{pjsua_vid_win_info}}} with {{{pjsua_vid_win_get_info()}}}. The one window property that most applications will be interested with is the native window handle of the video. The native video handle is contained by {{{pjmedia_vid_dev_hwnd}}} structure inside {{{pjsua_vid_win_info}}}. Application can use the native handle to embed the video window into application's GUI structure. Alternatively, the library also provides few simple and most commonly used API to operate the window, such as {{{pjsua_vid_win_set_show()}}}, {{{pjsua_vid_win_set_size()}}}, etc., however the availability of these APIs are not guaranteed since it depends on the underlying backend device. 226 226 227 227