Fix framerate based bitrate adjuster.

Fixes target bitrate calculation for framerate based adjuster. Adds new
API to bitrate adjuster - getCodecConfigFramerate() - that returns the
FPS that should be passed to MediaCodec on initialization.

Bug: b/73741487, cl/186656928
Change-Id: Ia4a5e99d302de67fbee0c132ab8e9392bc205b44
Reviewed-on: https://webrtc-review.googlesource.com/65162
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22716}
This commit is contained in:
Sami Kalliomäki
2018-03-28 16:31:26 +02:00
committed by Commit Bot
parent 8730135f26
commit 0bdb5dd0a9
5 changed files with 17 additions and 9 deletions

View File

@ -86,10 +86,13 @@ class DynamicBitrateAdjuster extends BaseBitrateAdjuster {
timeSinceLastAdjustmentMs = 0;
}
private double getBitrateAdjustmentScale() {
return Math.pow(BITRATE_ADJUSTMENT_MAX_SCALE,
(double) bitrateAdjustmentScaleExp / BITRATE_ADJUSTMENT_STEPS);
}
@Override
public int getAdjustedBitrateBps() {
return (int) (targetBitrateBps
* Math.pow(BITRATE_ADJUSTMENT_MAX_SCALE,
(double) bitrateAdjustmentScaleExp / BITRATE_ADJUSTMENT_STEPS));
return (int) (targetBitrateBps * getBitrateAdjustmentScale());
}
}