Don't assume all simulcast screenshare have 2 temporal layers

The simulcast allocator would only set bitrates for the first 2 layers
in conference_screenshare_mode.
That would trigger an issue in the VP8 encoder initialization that expects
to have growing bitrates for the layers (3rd layer would have the same
bitrate as the 2nd one).

Bug: webrtc:8785
Change-Id: Ic6c940b78022387841b28074b373be6b2f45cb15
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145922
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28598}
This commit is contained in:
Florent Castelli
2019-07-17 21:16:05 +02:00
committed by Commit Bot
parent ee0550cc4e
commit 596ed251e1
2 changed files with 18 additions and 1 deletions

View File

@ -212,7 +212,8 @@ void SimulcastRateAllocator::DistributeAllocationToTemporalLayers(
const bool conference_screenshare_mode =
codec_.mode == VideoCodecMode::kScreensharing &&
((num_spatial_streams == 1 && num_temporal_streams == 2) || // Legacy.
(num_spatial_streams > 1 && simulcast_id == 0)); // Simulcast.
(num_spatial_streams > 1 && simulcast_id == 0 &&
num_temporal_streams == 2)); // Simulcast.
if (conference_screenshare_mode) {
// TODO(holmer): This is a "temporary" hack for screensharing, where we
// interpret the startBitrate as the encoder target bitrate. This is