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:
committed by
Commit Bot
parent
ee0550cc4e
commit
596ed251e1
@ -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
|
||||
|
||||
@ -507,6 +507,22 @@ TEST_F(SimulcastRateAllocatorTest, ThreeStreamsMiddleInactive) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(SimulcastRateAllocatorTest, NonConferenceModeScreenshare) {
|
||||
codec_.mode = VideoCodecMode::kScreensharing;
|
||||
SetupCodec3SL3TL({true, true, true});
|
||||
CreateAllocator();
|
||||
|
||||
// Make sure we have enough bitrate for all 3 simulcast layers
|
||||
const uint32_t bitrate = codec_.simulcastStream[0].maxBitrate +
|
||||
codec_.simulcastStream[1].maxBitrate +
|
||||
codec_.simulcastStream[2].maxBitrate;
|
||||
const VideoBitrateAllocation alloc = GetAllocation(bitrate);
|
||||
|
||||
EXPECT_EQ(alloc.GetTemporalLayerAllocation(0).size(), 3u);
|
||||
EXPECT_EQ(alloc.GetTemporalLayerAllocation(1).size(), 3u);
|
||||
EXPECT_EQ(alloc.GetTemporalLayerAllocation(2).size(), 3u);
|
||||
}
|
||||
|
||||
class ScreenshareRateAllocationTest : public SimulcastRateAllocatorTest {
|
||||
public:
|
||||
void SetupConferenceScreenshare(bool use_simulcast, bool active = true) {
|
||||
|
||||
Reference in New Issue
Block a user