Fix bug in vie_encoder.cc which caused channel parameters not to be updated at regular intervals, as it was intended.

That however exposes a bunch of failed test, so this CL also fixed a few other things:
* FakeEncoder should trust the configured FPS value rather than guesstimating itself based on the realtime clock, so as not to completely undershoot targets in offline mode. Also, compensate for key-frame overshoots when outputting delta frames.
* FrameDropper should not assuming incoming frame rate is 0 if no frames have been seen.
* Fix a bunch of test cases that started failing because they were relying on the fake encoder undershooting.
* Fix test

BUG=7664

Review-Url: https://codereview.webrtc.org/2883963002
Cr-Commit-Position: refs/heads/master@{#18473}
This commit is contained in:
sprang
2017-06-07 04:59:38 -07:00
committed by Commit Bot
parent 2038df452c
commit 6431e21da6
8 changed files with 375 additions and 258 deletions

View File

@ -118,7 +118,13 @@ uint32_t MediaOptimization::SetTargetRates(uint32_t target_bitrate) {
// Update encoding rates following protection settings.
float target_video_bitrate_kbps =
static_cast<float>(video_target_bitrate_) / 1000.0f;
frame_dropper_->SetRates(target_video_bitrate_kbps, incoming_frame_rate_);
float framerate = incoming_frame_rate_;
if (framerate == 0.0) {
// No framerate estimate available, use configured max framerate instead.
framerate = user_frame_rate_;
}
frame_dropper_->SetRates(target_video_bitrate_kbps, framerate);
return video_target_bitrate_;
}