Changes between Version 42 and Version 43 of Video_Users_Guide
- Timestamp:
- Mar 21, 2012 4:14:58 AM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Video_Users_Guide
v42 v43 292 292 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. 293 293 294 === Modifying video codec parameters for video call === 295 296 Video codec parameters are specified in {{{pjmedia_vid_codec_param}}}. The codec parameters provides separate settings for each direction, encoding and decoding. Any modifications on video codec parameters can be applied using {{{pjsua_vid_codec_set_param()}}}. 294 === Modifying video codec parameters for video call === #modvcodec 295 296 Video codec parameters are specified in {{{pjmedia_vid_codec_param}}}. The codec parameters provide separate settings for each direction, encoding and decoding. Any modifications on video codec parameters can be applied using {{{pjsua_vid_codec_set_param()}}}, here is a sample code for reference: 297 {{{ 298 const pj_str_t codec_id = {"H264", 4}; 299 pjmedia_vid_codec_param *param; 300 301 pjsua_vid_codec_get_param(&codec_id, ¶m); 302 /* Modify param here */ 303 pjsua_vid_codec_set_param(&codec_id, ¶m); 304 }}} 297 305 298 306 ==== Size or resolution ==== … … 306 314 pjmedia_vid_codec_param.enc_fmt.vid.size.h = 720; 307 315 }}} 308 Note that there is possibility that the value will be adjusted to follow remote capability. For example, if remote signals that maximum resolution supported is 640 x 480 and locally the encoding direction size is set to 1280 x 720, then 640 x 480 will be used.309 b. For decoding direction, two steps needed:316 Note that there is a possibility that the value will be adjusted to follow remote capability. For example, if remote signals that maximum resolution supported is 640 x 480 and locally the encoding direction size is set to 1280 x 720, then 640 x 480 will be used. 317 b. For decoding direction, two steps are needed: 310 318 1. {{{pjmedia_vid_codec_param.dec_fmt.vid.size}}} should be set to the highest value expected for incoming video size. 311 319 2. signalling to remote, configured via codec specific SDP format parameter (fmtp): {{{pjmedia_vid_codec_param.dec_fmtp}}}. … … 315 323 pjmedia_vid_codec_param.dec_fmtp.param[n].name = pj_str("CIF"); 316 324 pjmedia_vid_codec_param.dec_fmtp.param[n].value = pj_str("1"); /* the value actually specifies framerate, see framerate section below */ 317 /* 2nd preference: 17 2x 144 (QCIF) */325 /* 2nd preference: 176 x 144 (QCIF) */ 318 326 pjmedia_vid_codec_param.dec_fmtp.param[n+1].name = pj_str("QCIF"); 319 327 pjmedia_vid_codec_param.dec_fmtp.param[n+1].value = pj_str("1"); /* the value actually specifies framerate, see framerate section below */ … … 323 331 /* Can receive up to 1280×720 @30fps */ 324 332 pjmedia_vid_codec_param.dec_fmtp.param[n].name = pj_str("profile-level-id"); 325 pjmedia_vid_codec_param.dec_fmtp.param[n].value = pj_str("xxxx1 e"); /* "1e" means level 3.1 */333 pjmedia_vid_codec_param.dec_fmtp.param[n].value = pj_str("xxxx1f"); /* "1f" means level 3.1 */ 326 334 }}} 327 335 328 336 ==== Framerate ==== 329 337 330 Specify number of frame processed per second.338 Specify number of frames processed per second. 331 339 332 340 a. For encoding direction, configured via {{{pjmedia_vid_codec_param.enc_fmt.vid.fps}}}, e.g: … … 336 344 pjmedia_vid_codec_param.enc_fmt.vid.fps.denum = 1; 337 345 }}} 338 Note that there is possibility that the value will be adjusted to follow remote capability. For example, if remote signals that maximum framerate supported is 10fps and locally the encoding direction framerate is set to 30fps, then 10fps will be used.339 b. For decoding direction, two steps needed:346 Note that there is a possibility that the value will be adjusted to follow remote capability. For example, if remote signals that maximum framerate supported is 10fps and locally the encoding direction framerate is set to 30fps, then 10fps will be used. 347 b. For decoding direction, two steps are needed: 340 348 1. {{{pjmedia_vid_codec_param.dec_fmt.vid.fps}}} should be set to the highest value expected for incoming video framerate. Note that it is even better if this is set to 1.5x (or more) of the expected incoming framerate because the renderer will use this setting for its clock and there is always possibility that remote clock runs a bit faster (clock drift), so setting it higher will avoid high latency issue caused by clock drift. 341 349 2. signalling to remote, configured via codec specific SDP format parameter (fmtp): {{{pjmedia_vid_codec_param.dec_fmtp}}}. … … 353 361 /* Can receive up to 1280×720 @30fps */ 354 362 pjmedia_vid_codec_param.dec_fmtp.param[n].name = pj_str("profile-level-id"); 355 pjmedia_vid_codec_param.dec_fmtp.param[n].value = pj_str("xxxx1 e");363 pjmedia_vid_codec_param.dec_fmtp.param[n].value = pj_str("xxxx1f"); 356 364 }}} 357 365 … … 369 377 Notes: 370 378 - This setting is applicable for encoding and decoding direction, currently there is no way to set asymmetric bitrate. 371 - The bitrate setting of all codecs will be enumerated and the highest value will be signalled in bandwidth info in local SDP (see #1244).372 - There is possibility that the encoding bitrate will be adjusted to follow remote bitrate setting, i.e: read from SDP bandwidth info (b=TIAS line) in remote SDP. For example, if remote signals that maximum bitrate is 128kbps and locally the bitrate is set to 512kbps, then 128kbps will be used.379 - The bitrate setting of all codecs will be enumerated and the highest value will be signalled in bandwidth info in local SDP (see ticket #1244). 380 - There is a possibility that the encoding bitrate will be adjusted to follow remote bitrate setting, i.e: read from SDP bandwidth info (b=TIAS line) in remote SDP. For example, if remote signals that maximum bitrate is 128kbps and locally the bitrate is set to 512kbps, then 128kbps will be used. 373 381 - If codec specific bitrate setting signalling (via SDP fmtp) is desired, e.g: ''MaxBR'' for H263, application should put the SDP fmtp manually, for example: 374 382 {{{