mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 22:35:43 +00:00
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:
parent
0a2efa2106
commit
4e10dcb863
@ -294,6 +294,8 @@ JsepTrack::CreateEncodings(
|
||||
encoding->mConstraints = jsConstraints.constraints;
|
||||
}
|
||||
}
|
||||
|
||||
encoding->UpdateMaxBitrate(remote);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user