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

Unified Diff: webrtc/video/send_statistics_proxy.cc

Issue 1410533004: Round Rate computations from RateTracker. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Correct first-bucket rounding. Created 5 years, 1 month 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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/send_statistics_proxy.cc
diff --git a/webrtc/video/send_statistics_proxy.cc b/webrtc/video/send_statistics_proxy.cc
index 916ffb3baa4bfbdd9745ea90c90933bb4405b5ea..57189f3175b338e8168ad9006982026fab3726d7 100644
--- a/webrtc/video/send_statistics_proxy.cc
+++ b/webrtc/video/send_statistics_proxy.cc
@@ -11,6 +11,7 @@
#include "webrtc/video/send_statistics_proxy.h"
#include <algorithm>
+#include <cmath>
#include <map>
#include "webrtc/base/checks.h"
@@ -70,11 +71,11 @@ SendStatisticsProxy::~SendStatisticsProxy() {
void SendStatisticsProxy::UpdateHistograms() {
int input_fps =
- static_cast<int>(input_frame_rate_tracker_.ComputeTotalRate());
+ round(input_frame_rate_tracker_.ComputeTotalRate());
if (input_fps > 0)
RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.InputFramesPerSecond", input_fps);
int sent_fps =
- static_cast<int>(sent_frame_rate_tracker_.ComputeTotalRate());
+ round(sent_frame_rate_tracker_.ComputeTotalRate());
if (sent_fps > 0)
RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.SentFramesPerSecond", sent_fps);
@@ -155,7 +156,7 @@ VideoSendStream::Stats SendStatisticsProxy::GetStats() {
rtc::CritScope lock(&crit_);
PurgeOldStats();
stats_.input_frame_rate =
- static_cast<int>(input_frame_rate_tracker_.ComputeRate());
+ round(input_frame_rate_tracker_.ComputeRate());
return stats_;
}
« no previous file with comments | « webrtc/video/receive_statistics_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698