Bug 1350912: Set min and start bandwidth according to b=TIAS, instead of only max r=drno

MozReview-Commit-ID: DH1rFn53sNN
This commit is contained in:
Randell Jesup 2017-03-28 06:54:12 -04:00
parent 41c4f44c15
commit 340f43be8a

View File

@ -1409,6 +1409,15 @@ WebrtcVideoConduit::SelectBitrates(
out_max = std::max(static_cast<int>(out_max * ((10 - (framerate / 2)) / 30)), cap);
}
// Note: mNegotiatedMaxBitrate is the max transport bitrate - it applies to
// a single codec encoding, but should also apply to the sum of all
// simulcast layers in this encoding! So sum(layers.maxBitrate) <=
// mNegotiatedMaxBitrate
// Note that out_max already has had mPrefMaxBitrate applied to it
out_max = MinIgnoreZero((int)mNegotiatedMaxBitrate, out_max);
out_min = std::min(out_min, out_max);
out_start = std::min(out_start, out_max);
if (mMinBitrate && mMinBitrate > out_min) {
out_min = mMinBitrate;
}
@ -1419,13 +1428,6 @@ WebrtcVideoConduit::SelectBitrates(
}
out_start = std::max(out_start, out_min);
// Note: mNegotiatedMaxBitrate is the max transport bitrate - it applies to
// a single codec encoding, but should also apply to the sum of all
// simulcast layers in this encoding! So sum(layers.maxBitrate) <=
// mNegotiatedMaxBitrate
// Note that out_max already has had mPrefMaxBitrate applied to it
out_max = MinIgnoreZero((int)mNegotiatedMaxBitrate, out_max);
MOZ_ASSERT(mPrefMaxBitrate == 0 || out_max <= mPrefMaxBitrate);
}