Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Unified Diff: webrtc/video/receive_statistics_proxy.cc

Issue 1279433006: Add a rate tracker that tracks rate over a given interval split up into buckets that accumulate uni… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: New tests and readability fixes. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video/receive_statistics_proxy.h ('k') | webrtc/video/send_statistics_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/receive_statistics_proxy.cc
diff --git a/webrtc/video/receive_statistics_proxy.cc b/webrtc/video/receive_statistics_proxy.cc
index 6604d3de6f184ea439a825c73892e2982ffb38b7..165c6c919b6d56b952bd9e371a836a65e70d2bb5 100644
--- a/webrtc/video/receive_statistics_proxy.cc
+++ b/webrtc/video/receive_statistics_proxy.cc
@@ -20,7 +20,8 @@ ReceiveStatisticsProxy::ReceiveStatisticsProxy(uint32_t ssrc, Clock* clock)
: clock_(clock),
// 1000ms window, scale 1000 for ms to s.
decode_fps_estimator_(1000, 1000),
- renders_fps_estimator_(1000, 1000) {
+ renders_fps_estimator_(1000, 1000),
+ render_fps_tracker_(100u, 10u) {
stats_.ssrc = ssrc;
}
@@ -35,7 +36,7 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
fraction_lost);
}
- int render_fps = static_cast<int>(render_fps_tracker_total_.units_second());
+ int render_fps = static_cast<int>(render_fps_tracker_.ComputeTotalRate());
if (render_fps > 0)
RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.RenderFramesPerSecond", render_fps);
@@ -140,7 +141,7 @@ void ReceiveStatisticsProxy::OnRenderedFrame(int width, int height) {
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);
+ render_fps_tracker_.AddSamples(1);
}
void ReceiveStatisticsProxy::OnReceiveRatesUpdated(uint32_t bitRate,
« no previous file with comments | « webrtc/video/receive_statistics_proxy.h ('k') | webrtc/video/send_statistics_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698