In SimulcastTest pass field trials explicitly, bypassing global field trials
Bug: webrtc:10335 Change-Id: I0593002acb23cd8d9577eec640b3d64a116b067b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/347520 Reviewed-by: Philip Eliasson <philipel@webrtc.org> Auto-Submit: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Philip Eliasson <philipel@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42065}
This commit is contained in:
parent
50c1b66df6
commit
9a55e898ee
@ -77,10 +77,9 @@ if (rtc_include_tests) {
|
||||
]
|
||||
deps = [
|
||||
":streams_config",
|
||||
"../../api/transport:field_trial_based_config",
|
||||
"../../call/adaptation:resource_adaptation",
|
||||
"../../media:media_constants",
|
||||
"../../test:field_trial",
|
||||
"../../test:explicit_key_value_config",
|
||||
"../../test:test_support",
|
||||
]
|
||||
absl_deps = [
|
||||
|
||||
@ -10,13 +10,15 @@
|
||||
|
||||
#include "video/config/simulcast.h"
|
||||
|
||||
#include "api/transport/field_trial_based_config.h"
|
||||
#include "media/base/media_constants.h"
|
||||
#include "test/field_trial.h"
|
||||
#include "test/explicit_key_value_config.h"
|
||||
#include "test/gtest.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace {
|
||||
|
||||
using test::ExplicitKeyValueConfig;
|
||||
|
||||
constexpr int kQpMax = 55;
|
||||
constexpr double kBitratePriority = 2.0;
|
||||
constexpr bool kScreenshare = true;
|
||||
@ -79,8 +81,9 @@ TEST(SimulcastTest, BandwidthAboveTotalMaxBitrateGivenToHighestStream) {
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, GetConfig) {
|
||||
const ExplicitKeyValueConfig trials("");
|
||||
|
||||
const std::vector<VideoStream> kExpected = GetSimulcastBitrates720p();
|
||||
const FieldTrialBasedConfig trials;
|
||||
|
||||
const size_t kMinLayers = 1;
|
||||
const size_t kMaxLayers = 3;
|
||||
@ -112,9 +115,8 @@ TEST(SimulcastTest, GetConfig) {
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, GetConfigWithBaseHeavyVP8TL3RateAllocation) {
|
||||
test::ScopedFieldTrials field_trials(
|
||||
ExplicitKeyValueConfig trials(
|
||||
"WebRTC-UseBaseHeavyVP8TL3RateAllocation/Enabled/");
|
||||
FieldTrialBasedConfig trials;
|
||||
|
||||
const std::vector<VideoStream> kExpected = GetSimulcastBitrates720p();
|
||||
|
||||
@ -137,9 +139,10 @@ TEST(SimulcastTest, GetConfigWithBaseHeavyVP8TL3RateAllocation) {
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, GetConfigWithLimitedMaxLayers) {
|
||||
ExplicitKeyValueConfig trials("");
|
||||
|
||||
const size_t kMinLayers = 1;
|
||||
const size_t kMaxLayers = 2;
|
||||
FieldTrialBasedConfig trials;
|
||||
std::vector<VideoStream> streams = cricket::GetSimulcastConfig(
|
||||
kMinLayers, kMaxLayers, 1280, 720, kBitratePriority, kQpMax,
|
||||
!kScreenshare, true, trials, webrtc::kVideoCodecVP8);
|
||||
@ -152,9 +155,9 @@ TEST(SimulcastTest, GetConfigWithLimitedMaxLayers) {
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, GetConfigWithLimitedMaxLayersForResolution) {
|
||||
test::ScopedFieldTrials field_trials(
|
||||
ExplicitKeyValueConfig trials(
|
||||
"WebRTC-LegacySimulcastLayerLimit/Enabled/");
|
||||
FieldTrialBasedConfig trials;
|
||||
|
||||
const size_t kMinLayers = 1;
|
||||
const size_t kMaxLayers = 3;
|
||||
std::vector<VideoStream> streams = cricket::GetSimulcastConfig(
|
||||
@ -169,9 +172,9 @@ TEST(SimulcastTest, GetConfigWithLimitedMaxLayersForResolution) {
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, GetConfigWithLowResolutionScreenshare) {
|
||||
test::ScopedFieldTrials field_trials(
|
||||
ExplicitKeyValueConfig trials(
|
||||
"WebRTC-LegacySimulcastLayerLimit/Enabled/");
|
||||
FieldTrialBasedConfig trials;
|
||||
|
||||
const size_t kMinLayers = 1;
|
||||
const size_t kMaxLayers = 3;
|
||||
std::vector<VideoStream> streams = cricket::GetSimulcastConfig(
|
||||
@ -184,9 +187,9 @@ TEST(SimulcastTest, GetConfigWithLowResolutionScreenshare) {
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, GetConfigWithNotLimitedMaxLayersForResolution) {
|
||||
test::ScopedFieldTrials field_trials(
|
||||
ExplicitKeyValueConfig trials(
|
||||
"WebRTC-LegacySimulcastLayerLimit/Disabled/");
|
||||
FieldTrialBasedConfig trials;
|
||||
|
||||
const size_t kMinLayers = 1;
|
||||
const size_t kMaxLayers = 3;
|
||||
std::vector<VideoStream> streams = cricket::GetSimulcastConfig(
|
||||
@ -203,7 +206,8 @@ TEST(SimulcastTest, GetConfigWithNotLimitedMaxLayersForResolution) {
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, GetConfigWithNormalizedResolution) {
|
||||
FieldTrialBasedConfig trials;
|
||||
ExplicitKeyValueConfig trials("");
|
||||
|
||||
const size_t kMinLayers = 1;
|
||||
const size_t kMaxLayers = 2;
|
||||
std::vector<VideoStream> streams = cricket::GetSimulcastConfig(
|
||||
@ -219,9 +223,8 @@ TEST(SimulcastTest, GetConfigWithNormalizedResolution) {
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, GetConfigWithNormalizedResolutionDivisibleBy4) {
|
||||
test::ScopedFieldTrials field_trials(
|
||||
ExplicitKeyValueConfig trials(
|
||||
"WebRTC-NormalizeSimulcastResolution/Enabled-2/");
|
||||
FieldTrialBasedConfig trials;
|
||||
|
||||
const size_t kMinLayers = 1;
|
||||
const size_t kMaxLayers = 2;
|
||||
@ -238,9 +241,8 @@ TEST(SimulcastTest, GetConfigWithNormalizedResolutionDivisibleBy4) {
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, GetConfigWithNormalizedResolutionDivisibleBy8) {
|
||||
test::ScopedFieldTrials field_trials(
|
||||
ExplicitKeyValueConfig trials(
|
||||
"WebRTC-NormalizeSimulcastResolution/Enabled-3/");
|
||||
FieldTrialBasedConfig trials;
|
||||
|
||||
const size_t kMinLayers = 1;
|
||||
const size_t kMaxLayers = 2;
|
||||
@ -257,9 +259,8 @@ TEST(SimulcastTest, GetConfigWithNormalizedResolutionDivisibleBy8) {
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, GetConfigForLegacyLayerLimit) {
|
||||
test::ScopedFieldTrials field_trials(
|
||||
ExplicitKeyValueConfig trials(
|
||||
"WebRTC-LegacySimulcastLayerLimit/Enabled/");
|
||||
FieldTrialBasedConfig trials;
|
||||
|
||||
const size_t kMinLayers = 1;
|
||||
const int kMaxLayers = 3;
|
||||
@ -280,9 +281,8 @@ TEST(SimulcastTest, GetConfigForLegacyLayerLimit) {
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, GetConfigForLegacyLayerLimitWithRequiredHD) {
|
||||
test::ScopedFieldTrials field_trials(
|
||||
ExplicitKeyValueConfig trials(
|
||||
"WebRTC-LegacySimulcastLayerLimit/Enabled/");
|
||||
FieldTrialBasedConfig trials;
|
||||
|
||||
const size_t kMinLayers = 3; // "HD" layer must be present!
|
||||
const int kMaxLayers = 3;
|
||||
@ -303,7 +303,7 @@ TEST(SimulcastTest, GetConfigForLegacyLayerLimitWithRequiredHD) {
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, GetConfigForScreenshareSimulcast) {
|
||||
FieldTrialBasedConfig trials;
|
||||
ExplicitKeyValueConfig trials("");
|
||||
const size_t kMinLayers = 1;
|
||||
const size_t kMaxLayers = 3;
|
||||
std::vector<VideoStream> streams = cricket::GetSimulcastConfig(
|
||||
@ -325,7 +325,7 @@ TEST(SimulcastTest, GetConfigForScreenshareSimulcast) {
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, GetConfigForScreenshareSimulcastWithLimitedMaxLayers) {
|
||||
FieldTrialBasedConfig trials;
|
||||
ExplicitKeyValueConfig trials("");
|
||||
const size_t kMinLayers = 1;
|
||||
const size_t kMaxLayers = 1;
|
||||
std::vector<VideoStream> streams = cricket::GetSimulcastConfig(
|
||||
@ -336,7 +336,7 @@ TEST(SimulcastTest, GetConfigForScreenshareSimulcastWithLimitedMaxLayers) {
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, AveragesBitratesForNonStandardResolution) {
|
||||
FieldTrialBasedConfig trials;
|
||||
ExplicitKeyValueConfig trials("");
|
||||
const size_t kMinLayers = 1;
|
||||
const size_t kMaxLayers = 3;
|
||||
std::vector<VideoStream> streams = cricket::GetSimulcastConfig(
|
||||
@ -352,13 +352,14 @@ TEST(SimulcastTest, AveragesBitratesForNonStandardResolution) {
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, BitratesForCloseToStandardResolution) {
|
||||
ExplicitKeyValueConfig trials("");
|
||||
|
||||
const size_t kMinLayers = 1;
|
||||
const size_t kMaxLayers = 3;
|
||||
// Resolution very close to 720p in number of pixels
|
||||
const size_t kWidth = 1280;
|
||||
const size_t kHeight = 716;
|
||||
const std::vector<VideoStream> kExpectedNear = GetSimulcastBitrates720p();
|
||||
FieldTrialBasedConfig trials;
|
||||
|
||||
std::vector<VideoStream> streams = cricket::GetSimulcastConfig(
|
||||
kMinLayers, kMaxLayers, kWidth, kHeight, kBitratePriority, kQpMax,
|
||||
@ -378,9 +379,9 @@ TEST(SimulcastTest, BitratesForCloseToStandardResolution) {
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, MaxLayersWithRoundUpDisabled) {
|
||||
test::ScopedFieldTrials field_trials(
|
||||
ExplicitKeyValueConfig trials(
|
||||
"WebRTC-SimulcastLayerLimitRoundUp/max_ratio:0.0/");
|
||||
FieldTrialBasedConfig trials;
|
||||
|
||||
const size_t kMinLayers = 1;
|
||||
const int kMaxLayers = 3;
|
||||
|
||||
@ -407,7 +408,7 @@ TEST(SimulcastTest, MaxLayersWithRoundUpDisabled) {
|
||||
|
||||
TEST(SimulcastTest, MaxLayersWithDefaultRoundUpRatio) {
|
||||
// Default: "WebRTC-SimulcastLayerLimitRoundUp/max_ratio:0.1/"
|
||||
FieldTrialBasedConfig trials;
|
||||
ExplicitKeyValueConfig trials("");
|
||||
const size_t kMinLayers = 1;
|
||||
const int kMaxLayers = 3;
|
||||
|
||||
@ -441,9 +442,9 @@ TEST(SimulcastTest, MaxLayersWithDefaultRoundUpRatio) {
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, MaxLayersWithRoundUpRatio) {
|
||||
test::ScopedFieldTrials field_trials(
|
||||
ExplicitKeyValueConfig trials(
|
||||
"WebRTC-SimulcastLayerLimitRoundUp/max_ratio:0.13/");
|
||||
FieldTrialBasedConfig trials;
|
||||
|
||||
const size_t kMinLayers = 1;
|
||||
const int kMaxLayers = 3;
|
||||
|
||||
@ -465,12 +466,10 @@ TEST(SimulcastTest, MaxLayersWithRoundUpRatio) {
|
||||
|
||||
TEST(SimulcastTest, BitratesInterpolatedForResBelow180p) {
|
||||
// TODO(webrtc:12415): Remove when feature launches.
|
||||
test::ScopedFieldTrials field_trials(
|
||||
ExplicitKeyValueConfig trials(
|
||||
"WebRTC-LowresSimulcastBitrateInterpolation/Enabled/");
|
||||
|
||||
const size_t kMaxLayers = 3;
|
||||
FieldTrialBasedConfig trials;
|
||||
|
||||
std::vector<VideoStream> streams = cricket::GetSimulcastConfig(
|
||||
/* min_layers = */ 1, kMaxLayers, /* width = */ 960, /* height = */ 540,
|
||||
kBitratePriority, kQpMax, !kScreenshare, true, trials,
|
||||
@ -486,11 +485,9 @@ TEST(SimulcastTest, BitratesInterpolatedForResBelow180p) {
|
||||
|
||||
TEST(SimulcastTest, BitratesConsistentForVerySmallRes) {
|
||||
// TODO(webrtc:12415): Remove when feature launches.
|
||||
test::ScopedFieldTrials field_trials(
|
||||
ExplicitKeyValueConfig trials(
|
||||
"WebRTC-LowresSimulcastBitrateInterpolation/Enabled/");
|
||||
|
||||
FieldTrialBasedConfig trials;
|
||||
|
||||
std::vector<VideoStream> streams = cricket::GetSimulcastConfig(
|
||||
/* min_layers = */ 1, /* max_layers = */ 3, /* width = */ 1,
|
||||
/* height = */ 1, kBitratePriority, kQpMax, !kScreenshare, true, trials,
|
||||
@ -506,12 +503,10 @@ TEST(SimulcastTest, BitratesConsistentForVerySmallRes) {
|
||||
|
||||
TEST(SimulcastTest,
|
||||
BitratesNotInterpolatedForResBelow180pWhenDisabledTrialSet) {
|
||||
test::ScopedFieldTrials field_trials(
|
||||
ExplicitKeyValueConfig trials(
|
||||
"WebRTC-LowresSimulcastBitrateInterpolation/Disabled/");
|
||||
|
||||
const size_t kMaxLayers = 3;
|
||||
FieldTrialBasedConfig trials;
|
||||
|
||||
std::vector<VideoStream> streams = cricket::GetSimulcastConfig(
|
||||
/* min_layers = */ 1, kMaxLayers, /* width = */ 960, /* height = */ 540,
|
||||
kBitratePriority, kQpMax, !kScreenshare, true, trials,
|
||||
@ -526,9 +521,9 @@ TEST(SimulcastTest,
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, BitratesBasedOnCodec) {
|
||||
const size_t kMaxLayers = 3;
|
||||
FieldTrialBasedConfig trials;
|
||||
ExplicitKeyValueConfig trials("");
|
||||
|
||||
const size_t kMaxLayers = 3;
|
||||
std::vector<VideoStream> streams_vp8 = cricket::GetSimulcastConfig(
|
||||
/* min_layers = */ 1, /* max_layers = */ 3, /* width = */ 1280,
|
||||
/* height = */ 720, kBitratePriority, kQpMax, !kScreenshare, true, trials,
|
||||
@ -561,8 +556,9 @@ TEST(SimulcastTest, BitratesBasedOnCodec) {
|
||||
}
|
||||
|
||||
TEST(SimulcastTest, BitratesForVP9) {
|
||||
ExplicitKeyValueConfig trials("");
|
||||
|
||||
const size_t kMaxLayers = 3;
|
||||
FieldTrialBasedConfig trials;
|
||||
|
||||
std::vector<VideoStream> streams = cricket::GetSimulcastConfig(
|
||||
/* min_layers = */ 1, kMaxLayers, /* width = */ 1280, /* height = */ 720,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user