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

Unified Diff: webrtc/base/rate_statistics.cc

Issue 2061423003: Refactor NACK bitrate allocation (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Moved rate limiter and addressed comments Created 4 years, 6 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/base/rate_statistics.cc
diff --git a/webrtc/base/rate_statistics.cc b/webrtc/base/rate_statistics.cc
index 1fd63cc6d2a071251edb0a9f4f3744fd700571f2..7382619b400c8183ae52596bdbdf78d4353f7da8 100644
--- a/webrtc/base/rate_statistics.cc
+++ b/webrtc/base/rate_statistics.cc
@@ -77,6 +77,12 @@ rtc::Optional<uint32_t> RateStatistics::Rate(int64_t now_ms) {
static_cast<uint32_t>(accumulated_count_ * scale + 0.5f));
}
+rtc::Optional<uint32_t> RateStatistics::Rate(int64_t now_ms) const {
danilchap 2016/06/28 14:26:17 May be it would be slightly cleaner if only one Ra
sprang_webrtc 2016/07/04 09:33:03 Done.
+ // Yes, this is ugly, but it's preferable to declaring all internal state
+ // mutable...
+ return const_cast<RateStatistics*>(this)->Rate(now_ms);
+}
+
void RateStatistics::EraseOld(int64_t now_ms) {
if (!IsInitialized())
return;

Powered by Google App Engine
This is Rietveld 408576698