Chromium Code Reviews| Index: webrtc/video/receive_statistics_proxy.cc |
| diff --git a/webrtc/video/receive_statistics_proxy.cc b/webrtc/video/receive_statistics_proxy.cc |
| index 97c1cf17b6f6f910fa013d392a70b1d8ae0b2099..438a70b5f31f2e90dcd66e0e25bd923f3701daee 100644 |
| --- a/webrtc/video/receive_statistics_proxy.cc |
| +++ b/webrtc/video/receive_statistics_proxy.cc |
| @@ -93,7 +93,7 @@ void ReceiveStatisticsProxy::UpdateHistograms() { |
| current_delay_ms); |
| } |
| - int delay_ms = delay_counter_.Avg(kMinRequiredDecodeSamples); |
| + int delay_ms = e2e_delay_counter_.Avg(kMinRequiredSamples); |
| if (delay_ms != -1) |
| RTC_LOGGED_HISTOGRAM_COUNTS_10000("WebRTC.Video.OnewayDelayInMs", delay_ms); |
| @@ -189,9 +189,6 @@ void ReceiveStatisticsProxy::OnDecoderTiming(int decode_ms, |
| jitter_buffer_delay_counter_.Add(jitter_buffer_ms); |
| target_delay_counter_.Add(target_delay_ms); |
| current_delay_counter_.Add(current_delay_ms); |
|
åsapersson
2016/04/28 07:42:18
Should we let target delay replace this metric and
mflodman
2016/05/06 08:23:42
I'd prefer to have a new stat tracking this in par
åsapersson
2016/09/22 12:23:08
Added end-to-end delay as a separate metric.
|
| - // Network delay (rtt/2) + target_delay_ms (jitter delay + decode time + |
| - // render delay). |
| - delay_counter_.Add(target_delay_ms + rtt_ms / 2); |
| } |
| void ReceiveStatisticsProxy::RtcpPacketTypesCounterUpdated( |
| @@ -248,7 +245,9 @@ void ReceiveStatisticsProxy::OnDecodedFrame() { |
| stats_.decode_frame_rate = decode_fps_estimator_.Rate(now); |
| } |
| -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(); |
| @@ -260,6 +259,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) { |