Changes between Version 42 and Version 43 of Video_Users_Guide


Ignore:
Timestamp:
Mar 21, 2012 4:14:58 AM (12 years ago)
Author:
ming
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Video_Users_Guide

    v42 v43  
    292292Application 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. 
    293293 
    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 
     296Video 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{{{ 
     298const pj_str_t codec_id = {"H264", 4}; 
     299pjmedia_vid_codec_param *param; 
     300 
     301pjsua_vid_codec_get_param(&codec_id, &param); 
     302/* Modify param here */ 
     303pjsua_vid_codec_set_param(&codec_id, &param); 
     304}}} 
    297305 
    298306==== Size or resolution ==== 
     
    306314pjmedia_vid_codec_param.enc_fmt.vid.size.h = 720; 
    307315    }}} 
    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: 
    310318    1. {{{pjmedia_vid_codec_param.dec_fmt.vid.size}}} should be set to the highest value expected for incoming video size. 
    311319    2. signalling to remote, configured via codec specific SDP format parameter (fmtp): {{{pjmedia_vid_codec_param.dec_fmtp}}}. 
     
    315323pjmedia_vid_codec_param.dec_fmtp.param[n].name = pj_str("CIF"); 
    316324pjmedia_vid_codec_param.dec_fmtp.param[n].value = pj_str("1"); /* the value actually specifies framerate, see framerate section below */ 
    317 /* 2nd preference: 172 x 144 (QCIF) */ 
     325/* 2nd preference: 176 x 144 (QCIF) */ 
    318326pjmedia_vid_codec_param.dec_fmtp.param[n+1].name = pj_str("QCIF"); 
    319327pjmedia_vid_codec_param.dec_fmtp.param[n+1].value = pj_str("1"); /* the value actually specifies framerate, see framerate section below */ 
     
    323331/* Can receive up to 1280×720 @30fps */ 
    324332pjmedia_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("xxxx1e"); /* "1e" means level 3.1 */ 
     333pjmedia_vid_codec_param.dec_fmtp.param[n].value = pj_str("xxxx1f"); /* "1f" means level 3.1 */ 
    326334         }}} 
    327335 
    328336==== Framerate ==== 
    329337 
    330 Specify number of frame processed per second. 
     338Specify number of frames processed per second. 
    331339 
    332340 a. For encoding direction, configured via {{{pjmedia_vid_codec_param.enc_fmt.vid.fps}}}, e.g: 
     
    336344pjmedia_vid_codec_param.enc_fmt.vid.fps.denum = 1; 
    337345    }}} 
    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: 
    340348    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. 
    341349    2. signalling to remote, configured via codec specific SDP format parameter (fmtp): {{{pjmedia_vid_codec_param.dec_fmtp}}}. 
     
    353361/* Can receive up to 1280×720 @30fps */ 
    354362pjmedia_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("xxxx1e"); 
     363pjmedia_vid_codec_param.dec_fmtp.param[n].value = pj_str("xxxx1f"); 
    356364         }}} 
    357365 
     
    369377Notes: 
    370378 - 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. 
    373381 - 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: 
    374382   {{{