Changing the bitrate clamping in BitrateControllerImpl

This CL implements an alternative to the bitrate clamping that is done
in BitrateControllerImpl. The default behavior is unchanged, but if
the new algorithm is enabled the behavior is as follows:
When the new bitrate is lower than the sum of min bitrates, the
algorithm will give each observer up to its min bitrate, one
observer at a time, until the bitrate budget is depleted. Thus,
with this change, some observers may get less than their min bitrate,
or even zero.

Unit tests are implemented.

Also fixing two old lint warnings in the affected files.

This change is related to the auto-muter feature.

BUG=2436
R=stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/2439005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5007 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrik.lundin@webrtc.org
2013-10-21 14:00:01 +00:00
parent 0d19ed9a06
commit 29dd0de5b3
5 changed files with 156 additions and 21 deletions

View File

@ -43,7 +43,12 @@ class BitrateController {
* BitrateObservers.
*/
public:
static BitrateController* CreateBitrateController();
// The argument |enforce_min_bitrate| controls the behavior when the available
// bitrate is lower than the minimum bitrate, or the sum of minimum bitrates.
// When true, the bitrate will never be set lower than the minimum bitrate(s).
// When false, the bitrate observers will be allocated rates up to their
// respective minimum bitrate, satisfying one observer after the other.
static BitrateController* CreateBitrateController(bool enforce_min_bitrate);
virtual ~BitrateController() {}
virtual RtcpBandwidthObserver* CreateRtcpBandwidthObserver() = 0;