Add field trial to allow always using max layers.

Bug: none
Change-Id: Ic579defebc4c75c740156e5fa8053a1f1e4c7a31
Reviewed-on: https://webrtc-review.googlesource.com/100520
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24785}
This commit is contained in:
Åsa Persson
2018-09-14 16:42:58 +02:00
committed by Commit Bot
parent 637b0b5d38
commit 645512ba59
2 changed files with 32 additions and 0 deletions

View File

@ -225,6 +225,9 @@ std::vector<webrtc::VideoStream> GetNormalSimulcastLayers(
// layers. Consider changing this so that the application can have more
// control over exactly how many simulcast layers are used.
size_t num_simulcast_layers = FindSimulcastMaxLayers(width, height);
if (webrtc::field_trial::IsEnabled("WebRTC-SimulcastMaxLayers")) {
num_simulcast_layers = max_layers;
}
if (num_simulcast_layers > max_layers) {
// TODO(bugs.webrtc.org/8486): This scales down the resolution if the
// number of simulcast layers created by the application isn't sufficient

View File

@ -121,6 +121,35 @@ TEST(SimulcastTest, GetConfigWithLimitedMaxLayers) {
EXPECT_EQ(360u, streams[1].height);
}
TEST(SimulcastTest, GetConfigWithLimitedMaxLayersForResolution) {
const size_t kMaxLayers = 3;
std::vector<VideoStream> streams = cricket::GetSimulcastConfig(
kMaxLayers, 800, 600, kMaxBitrateBps, kBitratePriority, kQpMax, kMaxFps,
!kScreenshare);
EXPECT_EQ(2u, streams.size());
EXPECT_EQ(400u, streams[0].width);
EXPECT_EQ(300u, streams[0].height);
EXPECT_EQ(800u, streams[1].width);
EXPECT_EQ(600u, streams[1].height);
}
TEST(SimulcastTest, GetConfigWithNotLimitedMaxLayersForResolution) {
test::ScopedFieldTrials field_trials("WebRTC-SimulcastMaxLayers/Enabled/");
const size_t kMaxLayers = 3;
std::vector<VideoStream> streams = cricket::GetSimulcastConfig(
kMaxLayers, 800, 600, kMaxBitrateBps, kBitratePriority, kQpMax, kMaxFps,
!kScreenshare);
EXPECT_EQ(kMaxLayers, streams.size());
EXPECT_EQ(200u, streams[0].width);
EXPECT_EQ(150u, streams[0].height);
EXPECT_EQ(400u, streams[1].width);
EXPECT_EQ(300u, streams[1].height);
EXPECT_EQ(800u, streams[2].width);
EXPECT_EQ(600u, streams[2].height);
}
TEST(SimulcastTest, GetConfigWithNormalizedResolution) {
const size_t kMaxLayers = 2;
std::vector<VideoStream> streams = cricket::GetSimulcastConfig(