Don't do legacy conference mode temporal layer allocation on non-screenshare

Some libraries hooking into WebRTC still manage to have the conference mode
flag enabled on non screenshare sources resulting in a bad rate allocation.

Bug: webrtc:11310
Change-Id: Id5205affb562511eda40c460e380c105d8589c51
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/182003
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31965}
This commit is contained in:
Florent Castelli
2020-08-19 14:27:59 +02:00
committed by Commit Bot
parent eeedb6ea33
commit 253fdc3056

View File

@ -229,7 +229,8 @@ void SimulcastRateAllocator::DistributeAllocationToTemporalLayers(
uint32_t max_bitrate_kbps;
// Legacy temporal-layered only screenshare, or simulcast screenshare
// with legacy mode for simulcast stream 0.
if (legacy_conference_mode_ && simulcast_id == 0) {
if (codec_.mode == VideoCodecMode::kScreensharing &&
legacy_conference_mode_ && simulcast_id == 0) {
// TODO(holmer): This is a "temporary" hack for screensharing, where we
// interpret the startBitrate as the encoder target bitrate. This is
// to allow for a different max bitrate, so if the codec can't meet
@ -249,7 +250,8 @@ void SimulcastRateAllocator::DistributeAllocationToTemporalLayers(
if (num_temporal_streams == 1) {
tl_allocation.push_back(target_bitrate_kbps);
} else {
if (legacy_conference_mode_ && simulcast_id == 0) {
if (codec_.mode == VideoCodecMode::kScreensharing &&
legacy_conference_mode_ && simulcast_id == 0) {
tl_allocation = ScreenshareTemporalLayerAllocation(
target_bitrate_kbps, max_bitrate_kbps, simulcast_id);
} else {