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

Unified Diff: webrtc/test/fake_encoder.cc

Issue 1474533006: Fix bug in calculation of averge queue time in paced sender. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added a todo comment 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
Index: webrtc/test/fake_encoder.cc
diff --git a/webrtc/test/fake_encoder.cc b/webrtc/test/fake_encoder.cc
index 44fb1c5882c3fccd48f2a196a639bfa4be6c2cbf..f6e64ced5af9373c0886f613869de3652acfb70d 100644
--- a/webrtc/test/fake_encoder.cc
+++ b/webrtc/test/fake_encoder.cc
@@ -57,6 +57,11 @@ int32_t FakeEncoder::Encode(const VideoFrame& input_image,
// at the display time of the previous frame.
time_since_last_encode_ms = time_now_ms - last_encode_time_ms_;
}
+ if (time_since_last_encode_ms > 1000 / config_.maxFramerate) {
+ // Rudimentary check to make sure we don't widely overshoot bitrate target
+ // when resuming encoding after a suspension.
+ time_since_last_encode_ms = 3 * 1000 / config_.maxFramerate;
mflodman 2015/11/26 10:23:38 This can still add too much, why isn't this the sa
stefan-webrtc 2015/11/26 11:23:38 Very good question :) It should be 3x in the if s
sprang_webrtc 2015/11/26 13:04:22 Done.
+ }
size_t bits_available =
static_cast<size_t>(target_bitrate_kbps_ * time_since_last_encode_ms);
« webrtc/modules/pacing/paced_sender.cc ('K') | « webrtc/modules/pacing/paced_sender_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698