| Index: webrtc/video/receive_statistics_proxy.cc
|
| diff --git a/webrtc/video/receive_statistics_proxy.cc b/webrtc/video/receive_statistics_proxy.cc
|
| index 66726a57b3b012282cee3b2f62e59735535f0eac..e4be1cc43c310665f9b7be40a1ec1fa62c27369c 100644
|
| --- a/webrtc/video/receive_statistics_proxy.cc
|
| +++ b/webrtc/video/receive_statistics_proxy.cc
|
| @@ -94,11 +94,14 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
|
| RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.CurrentDelayInMs",
|
| current_delay_ms);
|
| }
|
| -
|
| int delay_ms = delay_counter_.Avg(kMinRequiredDecodeSamples);
|
| if (delay_ms != -1)
|
| RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.OnewayDelayInMs", delay_ms);
|
|
|
| + int e2e_delay_ms = e2e_delay_counter_.Avg(kMinRequiredSamples);
|
| + if (e2e_delay_ms != -1)
|
| + RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.EndToEndDelayInMs", e2e_delay_ms);
|
| +
|
| StreamDataCounters rtp = stats_.rtp_stats;
|
| StreamDataCounters rtx;
|
| for (auto it : rtx_stats_)
|
| @@ -248,7 +251,9 @@ void ReceiveStatisticsProxy::OnDecodedFrame() {
|
| stats_.decode_frame_rate = decode_fps_estimator_.Rate(now).value_or(0);
|
| }
|
|
|
| -void ReceiveStatisticsProxy::OnRenderedFrame(int width, int height) {
|
| +void ReceiveStatisticsProxy::OnRenderedFrame(const VideoFrame& frame) {
|
| + int width = frame.width();
|
| + int height = frame.height();
|
| RTC_DCHECK_GT(width, 0);
|
| RTC_DCHECK_GT(height, 0);
|
| uint64_t now = clock_->TimeInMilliseconds();
|
| @@ -262,6 +267,12 @@ void ReceiveStatisticsProxy::OnRenderedFrame(int width, int height) {
|
| render_height_counter_.Add(height);
|
| render_fps_tracker_.AddSamples(1);
|
| render_pixel_tracker_.AddSamples(sqrt(width * height));
|
| +
|
| + if (frame.ntp_time_ms() > 0) {
|
| + int64_t delay_ms = clock_->CurrentNtpInMilliseconds() - frame.ntp_time_ms();
|
| + if (delay_ms >= 0)
|
| + e2e_delay_counter_.Add(delay_ms);
|
| + }
|
| }
|
|
|
| void ReceiveStatisticsProxy::OnSyncOffsetUpdated(int64_t sync_offset_ms) {
|
|
|