Changes between Version 6 and Version 7 of Video_Users_Guide
- Timestamp:
- Aug 15, 2011 8:40:16 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Video_Users_Guide
v6 v7 28 28 29 29 Windows: 30 1. ?30 1. - 31 31 32 32 Mac OS X: 33 -33 1. - 34 34 35 35 Mobile platforms (iPhone, Symbian, Windows Mobile, etc): … … 62 62 ==== 2. Configuring video support ==== 63 63 64 Add this inyour {{{config_site.h}}}:64 Add this to your {{{config_site.h}}}: 65 65 66 66 {{{ … … 88 88 1. SDL 89 89 1. ffmpeg 90 1. !DirectX (?)91 1. Base classes (?)92 90 93 91 ==== 2. Configure Video Settings ==== … … 143 141 This section provides several sample scenarios of using video in your application. Please see [#vidref Video API Reference] section for a more complete documentation about the Video API. 144 142 145 === Enabling video === 143 [[BR]] 144 145 === Enabling Video === 146 146 147 147 By default, video is enabled in '''{{{pjsua_acc_config}}}''', via '''{{{max_video_cnt}}}''' setting. The subsequent discussions assume that video is enabled on the account. 148 148 149 === Incoming video display === 149 [[BR]] 150 151 === Incoming Video Display === 150 152 151 153 As long as video is enabled in the account config (see above), incoming video by default will be accepted as long as we have matching codec for it. However, this does not necessarily mean that the video will be displayed automatically to the screen, nor that outgoing video will be transmitted automatically, as there will be separate settings for these. Outgoing video behavior will be explained in the next section. 154 155 ==== Display Incoming Video Automatically ==== 152 156 153 157 By default, incoming video '''is not''' displayed automatically, since the app may want to seek user approval first. Use the following code to change this behavior on per account basis: … … 159 163 cfg.vid_in_auto_show = PJ_TRUE; 160 164 }}} 165 166 ==== Show or Hide Incoming Video ==== 161 167 162 168 Regardless of the setting above, you can use the following steps to show or hide the display incoming video: … … 178 184 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. 179 185 186 ==== Controlling Incoming Video Stream ==== 187 180 188 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: 181 189 - ''PJSUA_CALL_VID_STRM_CHANGE_DIR'': change the media direction (e.g. to "sendonly", or even "inactive") … … 185 193 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'''. 186 194 195 [[BR]] 187 196 188 197 === Outgoing Video Transmission === 189 198 190 Outgoing video transmission is independent from the incoming video transmission; each can be operated separately. Even though video by default is enabled 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. 199 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. 200 201 ==== Default Capture Device ==== 191 202 192 203 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. 193 204 194 Application uses '''{{{pjsua_call_set_vid_strm()}}}''' API to control video media on a call. The following ''op_code'' can be used on the API to control the video media: 205 ==== Controlling Video Stream ==== 206 207 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: 195 208 - ''PJSUA_CALL_VID_STRM_ADD'': add a new video stream 196 209 - ''PJSUA_CALL_VID_STRM_REMOVE'': remove video stream (set port to zero) … … 202 215 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. 203 216 217 [[BR]] 204 218 205 219 === Working with Video Window === #wwin