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

Unified Diff: webrtc/modules/video_coding/codec_timer.cc

Issue 2529063002: Templatize percentile_filter.h and move it to base/analytics. (Closed)
Patch Set: Only allow removing the oldest element from PercentileFilter. Created 4 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
Index: webrtc/modules/video_coding/codec_timer.cc
diff --git a/webrtc/modules/video_coding/codec_timer.cc b/webrtc/modules/video_coding/codec_timer.cc
index 0fdf1a692e438137c23fa69f3611936d7bb10848..b6fec0edbedae6f76a16316456a7b55369b0193e 100644
--- a/webrtc/modules/video_coding/codec_timer.cc
+++ b/webrtc/modules/video_coding/codec_timer.cc
@@ -34,13 +34,13 @@ void VCMCodecTimer::AddTiming(int64_t decode_time_ms, int64_t now_ms) {
}
// Insert new decode time value.
- filter_.Insert(decode_time_ms);
+ filter_.Push(decode_time_ms);
history_.emplace(decode_time_ms, now_ms);
// Pop old decode time values.
while (!history_.empty() &&
now_ms - history_.front().sample_time_ms > kTimeLimitMs) {
- filter_.Erase(history_.front().decode_time_ms);
+ filter_.Pop();
history_.pop();
}
}

Powered by Google App Engine
This is Rietveld 408576698