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 649ea0cd6e0523ccb7a4ba9df512608a805ff482..12b04218c0c2e4077a5b70bc2801d0716023b5ea 100644 |
| --- a/webrtc/video/receive_statistics_proxy.cc |
| +++ b/webrtc/video/receive_statistics_proxy.cc |
| @@ -109,9 +109,6 @@ 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( |
| @@ -161,7 +158,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(); |
| @@ -173,6 +172,11 @@ 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) { |
| + delay_counter_.Add(clock_->CurrentNtpInMilliseconds() - |
| + frame.ntp_time_ms()); |
|
stefan-webrtc
2016/02/22 16:18:21
Maybe we should make sure this is positive before
åsapersson
2016/03/01 12:01:43
RemoteNtpTimeEstimator::Estimate returns -1 on err
stefan-webrtc
2016/03/01 12:38:20
I'm not sure that's enough as there are no guarant
åsapersson
2016/03/01 13:46:42
Ok. Added a check that the delay is positive befor
|
| + } |
| } |
| void ReceiveStatisticsProxy::OnReceiveRatesUpdated(uint32_t bitRate, |