Index: webrtc/video/receive_statistics_proxy.cc |
diff --git a/webrtc/video/receive_statistics_proxy.cc b/webrtc/video/receive_statistics_proxy.cc |
index b6063a80afbb1719b2c013a0881a52910da3a38d..534428b7eeec9b6d8ff49ffe0cb8d94650632394 100644 |
--- a/webrtc/video/receive_statistics_proxy.cc |
+++ b/webrtc/video/receive_statistics_proxy.cc |
@@ -53,6 +53,10 @@ void ReceiveStatisticsProxy::UpdateHistograms() { |
int decode_ms = decode_time_counter_.Avg(kMinRequiredDecodeSamples); |
if (decode_ms != -1) |
RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.DecodeTimeInMs", decode_ms); |
+ |
+ int delay_ms = delay_counter_.Avg(kMinRequiredDecodeSamples); |
+ if (delay_ms != -1) |
+ RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.OnewayDelayInMs", delay_ms); |
} |
VideoReceiveStream::Stats ReceiveStatisticsProxy::GetStats() const { |
@@ -78,7 +82,8 @@ void ReceiveStatisticsProxy::OnDecoderTiming(int decode_ms, |
int target_delay_ms, |
int jitter_buffer_ms, |
int min_playout_delay_ms, |
- int render_delay_ms) { |
+ int render_delay_ms, |
+ int64_t rtt_ms) { |
rtc::CritScope lock(&crit_); |
stats_.decode_ms = decode_ms; |
stats_.max_decode_ms = max_decode_ms; |
@@ -88,6 +93,9 @@ void ReceiveStatisticsProxy::OnDecoderTiming(int decode_ms, |
stats_.min_playout_delay_ms = min_playout_delay_ms; |
stats_.render_delay_ms = render_delay_ms; |
decode_time_counter_.Add(decode_ms); |
+ // 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( |