Don't limit simulcast layers number for screenshare based on resolution

Bug: webrtc:10996
Change-Id: I72de00e615822e913e55d7fdd5bb0e736db31c6e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154523
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29362}
This commit is contained in:
Ilya Nikolaevskiy 2019-10-01 15:43:14 +02:00 committed by Commit Bot
parent 64672dce41
commit 9d7eb28f72
2 changed files with 17 additions and 5 deletions

View File

@ -233,15 +233,15 @@ std::vector<webrtc::VideoStream> GetSimulcastConfig(
bool temporal_layers_supported) {
RTC_DCHECK(max_layers > 1 || is_screenshare_with_conference_mode);
// Some applications rely on the old behavior limiting the simulcast layer
// count based on the resolution automatically, which they can get through
// the WebRTC-LegacySimulcastLayerLimit field trial until they update.
max_layers = LimitSimulcastLayerCount(width, height, max_layers);
if (is_screenshare_with_conference_mode) {
return GetScreenshareLayers(max_layers, width, height, bitrate_priority,
max_qp, temporal_layers_supported);
} else {
// Some applications rely on the old behavior limiting the simulcast layer
// count based on the resolution automatically, which they can get through
// the WebRTC-LegacySimulcastLayerLimit field trial until they update.
max_layers = LimitSimulcastLayerCount(width, height, max_layers);
return GetNormalSimulcastLayers(max_layers, width, height, bitrate_priority,
max_qp, temporal_layers_supported);
}

View File

@ -153,6 +153,18 @@ TEST(SimulcastTest, GetConfigWithLimitedMaxLayersForResolution) {
EXPECT_EQ(600u, streams[1].height);
}
TEST(SimulcastTest, GetConfigWithLowResolutionScreenshare) {
test::ScopedFieldTrials field_trials(
"WebRTC-LegacySimulcastLayerLimit/Enabled/");
const size_t kMaxLayers = 3;
std::vector<VideoStream> streams = cricket::GetSimulcastConfig(
kMaxLayers, 100, 100, kBitratePriority, kQpMax, kScreenshare);
// Simulcast streams number is never decreased for screenshare,
// even for very low resolution.
EXPECT_GT(streams.size(), 1u);
}
TEST(SimulcastTest, GetConfigWithNotLimitedMaxLayersForResolution) {
test::ScopedFieldTrials field_trials(
"WebRTC-LegacySimulcastLayerLimit/Disabled/");