Bug 1276368: use b=TIAS for maxBitrate encoding constraints. r=jesup

MozReview-Commit-ID: C6kGt9pfhko

--HG--
extra : rebase_source : 575513fb65af7033edbba400f0bee8e69a45d266
This commit is contained in:
Nils Ohlmeier [:drno] 2016-05-18 18:16:59 -07:00
parent 0a2efa2106
commit 4e10dcb863
3 changed files with 14 additions and 2 deletions

View File

@ -294,6 +294,8 @@ JsepTrack::CreateEncodings(
encoding->mConstraints = jsConstraints.constraints;
}
}
encoding->UpdateMaxBitrate(remote);
}
}

View File

@ -39,6 +39,16 @@ public:
return false;
}
void UpdateMaxBitrate(const SdpMediaSection& remote)
{
uint32_t tias = remote.GetBandwidth("TIAS");
// select minimum of the two which is not zero
mConstraints.maxBr = std::min(tias ? tias : mConstraints.maxBr,
mConstraints.maxBr ? mConstraints.maxBr :
tias);
// TODO add support for b=AS if TIAS is not set (bug 976521)
}
EncodingConstraints mConstraints;
std::string mRid;

View File

@ -1049,13 +1049,13 @@ WebrtcVideoConduit::SelectBitrates(unsigned short width,
if (framerate >= 10) {
out_min = out_min * (framerate/30);
out_start = out_start * (framerate/30);
out_max = out_max * (framerate/30);
out_max = std::max((unsigned int)(out_max * (framerate/30)), cap);
} else {
// At low framerates, don't reduce bandwidth as much - cut slope to 1/2.
// Mostly this would be ultra-low-light situations/mobile or screensharing.
out_min = out_min * ((10-(framerate/2))/30);
out_start = out_start * ((10-(framerate/2))/30);
out_max = out_max * ((10-(framerate/2))/30);
out_max = std::max((unsigned int)(out_max * ((10-(framerate/2))/30)), cap);
}
if (mMinBitrate && mMinBitrate > out_min) {