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
Родитель 41c4f44c15
Коммит 340f43be8a
1 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -1409,6 +1409,15 @@ WebrtcVideoConduit::SelectBitrates(
out_max = std::max(static_cast<int>(out_max * ((10 - (framerate / 2)) / 30)), cap); 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) { if (mMinBitrate && mMinBitrate > out_min) {
out_min = mMinBitrate; out_min = mMinBitrate;
} }
@ -1419,13 +1428,6 @@ WebrtcVideoConduit::SelectBitrates(
} }
out_start = std::max(out_start, out_min); 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); MOZ_ASSERT(mPrefMaxBitrate == 0 || out_max <= mPrefMaxBitrate);
} }