Changeset 4059
- Timestamp:
- Apr 17, 2012 7:18:52 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/vid_stream.c
r4043 r4059 46 46 #define SIGNATURE PJMEDIA_SIG_PORT_VID_STREAM 47 47 48 #define TRACE_RC 0 49 48 50 /* Tracing jitter buffer operations in a stream session to a CSV file. 49 51 * The trace will contain JB operation timestamp, frame info, RTP info, and … … 159 161 160 162 pj_timestamp ts_freq; /**< Timestamp frequency. */ 163 164 #if TRACE_RC 165 unsigned rc_total_sleep; 166 unsigned rc_total_pkt; 167 unsigned rc_total_img; 168 pj_timestamp tx_start; 169 pj_timestamp tx_end; 170 #endif 161 171 }; 162 172 … … 918 928 } 919 929 920 #if 0930 #if TRACE_RC 921 931 /* Trace log for rate control */ 922 932 { 923 933 pj_timestamp end_time; 934 unsigned total_sleep; 935 924 936 pj_get_timestamp(&end_time); 937 total_sleep = pj_elapsed_msec(&initial_time, &end_time); 925 938 PJ_LOG(5, (stream->name.ptr, "total pkt=%d size=%d sleep=%d", 926 pkt_cnt, total_sent, 927 pj_elapsed_msec(&initial_time, &end_time))); 939 pkt_cnt, total_sent, total_sleep)); 940 941 if (stream->tx_start.u64 == 0) 942 stream->tx_start = initial_time; 943 stream->tx_end = end_time; 944 stream->rc_total_pkt += pkt_cnt; 945 stream->rc_total_sleep += total_sleep; 946 stream->rc_total_img++; 928 947 } 929 948 #endif … … 1458 1477 pj_get_timestamp_freq(&stream->ts_freq); 1459 1478 if (info->rc_cfg.bandwidth == 0) 1460 info->rc_cfg.bandwidth = vfd_enc->max_bps * 150 / 100; 1479 info->rc_cfg.bandwidth = vfd_enc->max_bps; 1480 1481 /* For simple blocking, need to have bandwidth large enough, otherwise 1482 * we can slow down the transmission too much 1483 */ 1484 if (info->rc_cfg.method==PJMEDIA_VID_STREAM_RC_SIMPLE_BLOCKING && 1485 info->rc_cfg.bandwidth < vfd_enc->avg_bps * 3) 1486 { 1487 info->rc_cfg.bandwidth = vfd_enc->avg_bps * 3; 1488 } 1461 1489 1462 1490 /* Override the initial framerate in the decoding direction. This initial … … 1474 1502 if (status != PJ_SUCCESS) 1475 1503 return status; 1476 1477 1504 1478 1505 /* Create encoder channel */ … … 1631 1658 PJ_ASSERT_RETURN(stream != NULL, PJ_EINVAL); 1632 1659 1660 #if TRACE_RC 1661 { 1662 unsigned total_time; 1663 1664 total_time = pj_elapsed_msec(&stream->tx_start, &stream->tx_end); 1665 PJ_LOG(5, (stream->name.ptr, 1666 "RC stat: pkt_cnt=%.2f/image, sleep=%.2fms/s, fps=%.2f", 1667 stream->rc_total_pkt*1.0/stream->rc_total_img, 1668 stream->rc_total_sleep*1000.0/total_time, 1669 stream->rc_total_img*1000.0/total_time)); 1670 } 1671 #endif 1672 1633 1673 /* Send RTCP BYE (also SDES) */ 1634 1674 if (!stream->rtcp_sdes_bye_disabled) {
Note: See TracChangeset
for help on using the changeset viewer.