Update encoder settings periodically, not only on new bandwidth estimate

Also moved actual update call to encoder thread, and tweaked frame rate
estimate to be less noisy.

This is a re-upload of https://review.webrtc.org/47249004

BUG=chromium:476469
R=stefan@webrtc.org

Review URL: https://codereview.webrtc.org/1180623005.

Cr-Commit-Position: refs/heads/master@{#9417}
This commit is contained in:
Erik Språng
2015-06-11 14:20:07 +02:00
parent 78fb3b3f8f
commit 66a641a9c6
5 changed files with 67 additions and 18 deletions

View File

@ -631,8 +631,9 @@ void MediaOptimization::ProcessIncomingFrameRate(int64_t now) {
}
}
if (num > 1) {
const int64_t diff = now - incoming_frame_times_[num - 1];
incoming_frame_rate_ = 1.0;
const int64_t diff =
incoming_frame_times_[0] - incoming_frame_times_[num - 1];
incoming_frame_rate_ = 0.0; // No frame rate estimate available.
if (diff > 0) {
incoming_frame_rate_ = nr_of_frames * 1000.0f / static_cast<float>(diff);
}