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

Unified Diff: webrtc/video/receive_statistics_proxy.cc

Issue 2029593002: Update RateStatistics to handle too-little-data case. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 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
Index: webrtc/video/receive_statistics_proxy.cc
diff --git a/webrtc/video/receive_statistics_proxy.cc b/webrtc/video/receive_statistics_proxy.cc
index 4757efa81b6cf3435212fea2f3e4dbb53d283734..8648fb62fbd7651366c515be0f3037a1ed007013 100644
--- a/webrtc/video/receive_statistics_proxy.cc
+++ b/webrtc/video/receive_statistics_proxy.cc
@@ -247,7 +247,7 @@ void ReceiveStatisticsProxy::OnDecodedFrame() {
rtc::CritScope lock(&crit_);
decode_fps_estimator_.Update(1, now);
- stats_.decode_frame_rate = decode_fps_estimator_.Rate(now);
+ stats_.decode_frame_rate = decode_fps_estimator_.Rate(now).value_or(1);
stefan-webrtc 2016/06/02 07:16:42 I'm not convinced this is correct. What if there a
sprang_webrtc 2016/06/02 08:09:32 Yeah, you're right. I'll change it to default zero
stefan-webrtc 2016/06/02 08:14:39 So, will we now ever be able to measure 1 fps? :)
sprang 2016/06/02 09:00:51 Not if the actual rate is <= 1 fps. But slightly m
stefan-webrtc 2016/06/02 09:05:51 Not sure. I'm mostly thinking whether it would mak
sprang_webrtc 2016/06/02 12:23:50 Done. PTAL
}
void ReceiveStatisticsProxy::OnRenderedFrame(int width, int height) {
@@ -257,7 +257,7 @@ void ReceiveStatisticsProxy::OnRenderedFrame(int width, int height) {
rtc::CritScope lock(&crit_);
renders_fps_estimator_.Update(1, now);
- stats_.render_frame_rate = renders_fps_estimator_.Rate(now);
+ stats_.render_frame_rate = renders_fps_estimator_.Rate(now).value_or(1);
render_width_counter_.Add(width);
render_height_counter_.Add(height);
render_fps_tracker_.AddSamples(1);

Powered by Google App Engine
This is Rietveld 408576698