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 b5d80560f1f28d1e7decb5a5df09295bf3e01414..a327613ef68851aff7a9a7760d1e7451bffe741c 100644 |
| --- a/webrtc/video/receive_statistics_proxy.cc |
| +++ b/webrtc/video/receive_statistics_proxy.cc |
| @@ -28,16 +28,24 @@ ReceiveStatisticsProxy::~ReceiveStatisticsProxy() { |
| UpdateHistograms(); |
| } |
| -void ReceiveStatisticsProxy::UpdateHistograms() const { |
| - int fraction_lost; |
| - { |
| - rtc::CritScope lock(&crit_); |
| - fraction_lost = report_block_stats_.FractionLostInPercent(); |
| - } |
| +void ReceiveStatisticsProxy::UpdateHistograms() { |
| + int fraction_lost = report_block_stats_.FractionLostInPercent(); |
| if (fraction_lost != -1) { |
| RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.ReceivedPacketsLostInPercent", |
| fraction_lost); |
| } |
| + |
| + int render_fps = static_cast<int>(render_fps_tracker_total_.units_second()); |
| + if (render_fps > 0) |
| + RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.RenderFramesPerSecond", render_fps); |
| + |
| + const int kMinRequiredSamples = 100; |
| + int width = render_width_counter_.Avg(kMinRequiredSamples); |
| + if (width != -1) |
| + RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedWidthInPixels", width); |
| + int height = render_height_counter_.Avg(kMinRequiredSamples); |
|
pbos-webrtc
2015/07/20 13:52:22
Get both width and height at the same time, if wid
åsapersson
2015/07/20 15:06:30
Done.
|
| + if (height != -1) |
| + RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedHeightInPixels", height); |
| } |
| VideoReceiveStream::Stats ReceiveStatisticsProxy::GetStats() const { |
| @@ -117,12 +125,15 @@ void ReceiveStatisticsProxy::OnDecodedFrame() { |
| stats_.decode_frame_rate = decode_fps_estimator_.Rate(now); |
| } |
| -void ReceiveStatisticsProxy::OnRenderedFrame() { |
| +void ReceiveStatisticsProxy::OnRenderedFrame(int width, int height) { |
| uint64_t now = clock_->TimeInMilliseconds(); |
| rtc::CritScope lock(&crit_); |
| renders_fps_estimator_.Update(1, now); |
| stats_.render_frame_rate = renders_fps_estimator_.Rate(now); |
| + render_width_counter_.Add(width); |
| + render_height_counter_.Add(height); |
| + render_fps_tracker_total_.Update(1); |
| } |
| void ReceiveStatisticsProxy::OnReceiveRatesUpdated(uint32_t bitRate, |