- Timestamp:
- Aug 5, 2016 7:26:18 AM (8 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/config.h
r5301 r5410 1331 1331 #endif 1332 1332 1333 /** 1334 * Specify the number of keyframe needed to be sent after the stream is 1335 * created. Setting this to 0 will disable it. 1336 * 1337 * Default : 5 1338 */ 1339 #ifndef PJMEDIA_VID_STREAM_START_KEYFRAME_CNT 1340 # define PJMEDIA_VID_STREAM_START_KEYFRAME_CNT 5 1341 #endif 1342 1343 /** 1344 * Specify the interval to send keyframe after the stream is created, in msec. 1345 * 1346 * Default : 1000 1347 */ 1348 #ifndef PJMEDIA_VID_STREAM_START_KEYFRAME_INTERVAL_MSEC 1349 # define PJMEDIA_VID_STREAM_START_KEYFRAME_INTERVAL_MSEC 1000 1350 #endif 1351 1333 1352 1334 1353 /** -
pjproject/trunk/pjmedia/include/pjmedia/vid_stream.h
r4043 r5410 117 117 118 118 } pjmedia_vid_stream_rc_config; 119 120 /** 121 * Structure of configuration settings for video stream sending keyframe 122 * after it is created. 123 */ 124 typedef struct pjmedia_vid_stream_sk_config 125 { 126 /** 127 * The number of keyframe to be sent after the stream is created. 128 * 129 * Default: PJMEDIA_VID_STREAM_START_KEYFRAME_CNT 130 */ 131 unsigned count; 132 133 /** 134 * The keyframe sending interval after the stream is created. 135 * 136 * Default: PJMEDIA_VID_STREAM_START_KEYFRAME_INTERVAL_MSEC 137 */ 138 unsigned interval; 139 140 } pjmedia_vid_stream_sk_config; 119 141 120 142 … … 166 188 pjmedia_vid_stream_rc_config rc_cfg; 167 189 /**< Stream send rate control settings. */ 190 191 pjmedia_vid_stream_sk_config sk_cfg; 192 /**< Stream send keyframe settings. */ 168 193 } pjmedia_vid_stream_info; 169 194 … … 201 226 PJ_DECL(void) 202 227 pjmedia_vid_stream_rc_config_default(pjmedia_vid_stream_rc_config *cfg); 228 229 /** 230 * Initialize the video stream send keyframe with default settings. 231 * 232 * @param cfg Video stream send keyframe structure to be initialized. 233 */ 234 PJ_DECL(void) 235 pjmedia_vid_stream_sk_config_default(pjmedia_vid_stream_sk_config *cfg); 203 236 204 237 -
pjproject/trunk/pjmedia/src/pjmedia/vid_stream.c
r5234 r5410 155 155 156 156 pj_bool_t force_keyframe;/**< Forced to encode keyframe? */ 157 unsigned num_keyframe; /**< The number of keyframe needed 158 to be sent, after the stream 159 is created. */ 160 pj_timestamp last_keyframe_tx; 161 /**< Timestamp of the last 162 keyframe. */ 163 157 164 158 165 #if defined(PJMEDIA_STREAM_ENABLE_KA) && PJMEDIA_STREAM_ENABLE_KA!=0 … … 851 858 frame_out.size = 0; 852 859 860 /* Check if need to send keyframe. */ 861 if (stream->num_keyframe) { 862 unsigned elapse_time; 863 pj_timestamp now; 864 865 pj_get_timestamp(&now); 866 867 elapse_time = pj_elapsed_msec(&stream->last_keyframe_tx, &now); 868 869 if (elapse_time > stream->info.sk_cfg.interval) 870 { 871 stream->force_keyframe = PJ_TRUE; 872 if (--stream->num_keyframe) 873 stream->last_keyframe_tx = now; 874 } 875 } 876 853 877 /* Init encoding option */ 854 878 pj_bzero(&enc_opt, sizeof(enc_opt)); … … 1460 1484 stream->use_ka = info->use_ka; 1461 1485 #endif 1486 stream->num_keyframe = info->sk_cfg.count; 1462 1487 1463 1488 /* Build random RTCP CNAME. CNAME has user@host format */ … … 2010 2035 2011 2036 2037 /* 2038 * Initialize the video stream send keyframe with default settings. 2039 */ 2040 PJ_DEF(void) 2041 pjmedia_vid_stream_sk_config_default(pjmedia_vid_stream_sk_config *cfg) 2042 { 2043 pj_bzero(cfg, sizeof(*cfg)); 2044 cfg->count = PJMEDIA_VID_STREAM_START_KEYFRAME_CNT; 2045 cfg->interval = PJMEDIA_VID_STREAM_START_KEYFRAME_INTERVAL_MSEC; 2046 } 2047 2048 2012 2049 #endif /* PJMEDIA_HAS_VIDEO */ -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r5326 r5410 3307 3307 3308 3308 /** 3309 * Specify the send keyframe config for video stream. 3310 * 3311 * Default: see #pjmedia_vid_stream_sk_config 3312 */ 3313 pjmedia_vid_stream_sk_config vid_stream_sk_cfg; 3314 3315 /** 3309 3316 * Media transport config. 3310 3317 */ -
pjproject/trunk/pjsip/include/pjsua2/account.hpp
r4957 r5410 832 832 unsigned rateControlBandwidth; 833 833 834 /** 835 * The number of keyframe to be sent after the stream is created. 836 * 837 * Default: PJMEDIA_VID_STREAM_START_KEYFRAME_CNT 838 */ 839 unsigned startKeyframeCount; 840 841 /** 842 * The keyframe sending interval after the stream is created. 843 * 844 * Default: PJMEDIA_VID_STREAM_START_KEYFRAME_INTERVAL_MSEC 845 */ 846 unsigned startKeyframeInterval; 847 848 834 849 public: 835 850 /** -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r5383 r5410 278 278 #if PJMEDIA_HAS_VIDEO 279 279 pjmedia_vid_stream_rc_config_default(&cfg->vid_stream_rc_cfg); 280 pjmedia_vid_stream_sk_config_default(&cfg->vid_stream_sk_cfg); 280 281 #endif 281 282 pjsua_transport_config_default(&cfg->rtp_cfg); -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c
r5407 r5410 911 911 /* Set rate control config from account setting */ 912 912 si->rc_cfg = acc->cfg.vid_stream_rc_cfg; 913 914 /* Set send keyframe config from account setting */ 915 si->sk_cfg = acc->cfg.vid_stream_sk_cfg; 913 916 914 917 #if defined(PJMEDIA_STREAM_ENABLE_KA) && PJMEDIA_STREAM_ENABLE_KA!=0 -
pjproject/trunk/pjsip/src/pjsua2/account.cpp
r5346 r5410 278 278 NODE_READ_NUM_T ( this_node, pjmedia_vid_stream_rc_method, rateControlMethod); 279 279 NODE_READ_UNSIGNED( this_node, rateControlBandwidth); 280 NODE_READ_UNSIGNED( this_node, startKeyframeCount); 281 NODE_READ_UNSIGNED( this_node, startKeyframeInterval); 280 282 } 281 283 … … 291 293 NODE_WRITE_NUM_T ( this_node, pjmedia_vid_stream_rc_method, rateControlMethod); 292 294 NODE_WRITE_UNSIGNED( this_node, rateControlBandwidth); 295 NODE_WRITE_UNSIGNED( this_node, startKeyframeCount); 296 NODE_WRITE_UNSIGNED( this_node, startKeyframeInterval); 293 297 } 294 298 … … 434 438 ret.vid_stream_rc_cfg.method= videoConfig.rateControlMethod; 435 439 ret.vid_stream_rc_cfg.bandwidth = videoConfig.rateControlBandwidth; 440 ret.vid_stream_sk_cfg.count = videoConfig.startKeyframeCount; 441 ret.vid_stream_sk_cfg.interval = videoConfig.startKeyframeInterval; 436 442 } 437 443 … … 599 605 videoConfig.rateControlMethod = prm.vid_stream_rc_cfg.method; 600 606 videoConfig.rateControlBandwidth = prm.vid_stream_rc_cfg.bandwidth; 607 videoConfig.startKeyframeCount = prm.vid_stream_sk_cfg.count; 608 videoConfig.startKeyframeInterval = prm.vid_stream_sk_cfg.interval; 601 609 } 602 610
Note: See TracChangeset
for help on using the changeset viewer.