Bug 1766646 - Vendor libwebrtc from 483b31c231

Upstream commit: https://webrtc.googlesource.com/src/+/483b31c23117a9af54c9867e11942e81b90621c2
    Reland "Enable Video-QualityScaling experiment by default"

    This time exclude iOS from the default behaviour.

    Bug: webrtc:12401
    Change-Id: Ib1f77123b72c3365591b56455332b3d97b307b26
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205006
    Reviewed-by: Åsa Persson <asapersson@webrtc.org>
    Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
    Cr-Commit-Position: refs/heads/master@{#33173}
This commit is contained in:
Michael Froman 2022-05-02 15:21:32 -05:00 коммит произвёл Connor Sheehan
Родитель 27e1e2b6db
Коммит 10345841eb
6 изменённых файлов: 43 добавлений и 6 удалений

3
third_party/libwebrtc/README.moz-ff-commit поставляемый
Просмотреть файл

@ -3057,3 +3057,6 @@ b6d87ddd55
# MOZ_LIBWEBRTC_SRC=/home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src MOZ_LIBWEBRTC_COMMIT=mjfdev bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh
# base of lastest vendoring
aab91c7b3a
# MOZ_LIBWEBRTC_SRC=/home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src MOZ_LIBWEBRTC_COMMIT=mjfdev bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh
# base of lastest vendoring
483b31c231

2
third_party/libwebrtc/README.mozilla поставляемый
Просмотреть файл

@ -2040,3 +2040,5 @@ libwebrtc updated from /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwe
libwebrtc updated from /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src commit mjfdev on 2022-05-02T20:19:49.519819.
# python3 vendor-libwebrtc.py --from-local /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src --commit mjfdev libwebrtc
libwebrtc updated from /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src commit mjfdev on 2022-05-02T20:20:38.714946.
# python3 vendor-libwebrtc.py --from-local /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src --commit mjfdev libwebrtc
libwebrtc updated from /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src commit mjfdev on 2022-05-02T20:21:27.662847.

Просмотреть файл

@ -116,7 +116,7 @@ INSTANTIATE_TEST_SUITE_P(
QualityScalerTest,
::testing::Values(
"WebRTC-Video-QualityScaling/Enabled-1,2,3,4,5,6,7,8,0.9,0.99,1/",
""));
"WebRTC-Video-QualityScaling/Disabled/"));
TEST_P(QualityScalerTest, DownscalesAfterContinuousFramedrop) {
task_queue_.SendTask([this] { TriggerScale(kScaleDown); }, RTC_FROM_HERE);
@ -171,7 +171,8 @@ TEST_P(QualityScalerTest, DoesNotDownscaleAfterHalfFramedrop) {
}
TEST_P(QualityScalerTest, DownscalesAfterTwoThirdsIfFieldTrialEnabled) {
const bool kDownScaleExpected = !GetParam().empty();
const bool kDownScaleExpected =
GetParam().find("Enabled") != std::string::npos;
task_queue_.SendTask(
[this] {
for (int i = 0; i < kFramerate * 5; ++i) {

Просмотреть файл

@ -25,6 +25,11 @@ constexpr int kMaxVp9Qp = 255;
constexpr int kMaxH264Qp = 51;
constexpr int kMaxGenericQp = 255;
#if !defined(WEBRTC_IOS)
constexpr char kDefaultQualityScalingSetttings[] =
"Enabled-29,95,149,205,24,37,26,36,0.9995,0.9999,1";
#endif
absl::optional<VideoEncoder::QpThresholds> GetThresholds(int low,
int high,
int max) {
@ -38,15 +43,22 @@ absl::optional<VideoEncoder::QpThresholds> GetThresholds(int low,
} // namespace
bool QualityScalingExperiment::Enabled() {
#if defined(WEBRTC_IOS)
return webrtc::field_trial::IsEnabled(kFieldTrial);
#else
return !webrtc::field_trial::IsDisabled(kFieldTrial);
#endif
}
absl::optional<QualityScalingExperiment::Settings>
QualityScalingExperiment::ParseSettings() {
const std::string group = webrtc::field_trial::FindFullName(kFieldTrial);
std::string group = webrtc::field_trial::FindFullName(kFieldTrial);
// TODO(http://crbug.com/webrtc/12401): Completely remove the experiment code
// after few releases.
#if !defined(WEBRTC_IOS)
if (group.empty())
return absl::nullopt;
group = kDefaultQualityScalingSetttings;
#endif
Settings s;
if (sscanf(group.c_str(), "Enabled-%d,%d,%d,%d,%d,%d,%d,%d,%f,%f,%d",
&s.vp8_low, &s.vp8_high, &s.vp9_low, &s.vp9_high, &s.h264_low,

Просмотреть файл

@ -38,10 +38,18 @@ void ExpectEqualConfig(QualityScalingExperiment::Config a,
}
} // namespace
TEST(QualityScalingExperimentTest, DisabledWithoutFieldTrial) {
#if !defined(WEBRTC_IOS)
// TODO(bugs.webrtc.org/12401): investigate why QualityScaler kicks in on iOS.
TEST(QualityScalingExperimentTest, DefaultEnabledWithoutFieldTrial) {
webrtc::test::ScopedFieldTrials field_trials("");
EXPECT_TRUE(QualityScalingExperiment::Enabled());
}
#else
TEST(QualityScalingExperimentTest, DefaultDisabledWithoutFieldTrialIOS) {
webrtc::test::ScopedFieldTrials field_trials("");
EXPECT_FALSE(QualityScalingExperiment::Enabled());
}
#endif
TEST(QualityScalingExperimentTest, EnabledWithFieldTrial) {
webrtc::test::ScopedFieldTrials field_trials(
@ -59,10 +67,19 @@ TEST(QualityScalingExperimentTest, ParseSettings) {
ExpectEqualSettings(kExpected, *settings);
}
#if !defined(WEBRTC_IOS)
// TODO(bugs.webrtc.org/12401): investigate why QualityScaler kicks in on iOS.
TEST(QualityScalingExperimentTest, ParseSettingsUsesDefaultsWithoutFieldTrial) {
webrtc::test::ScopedFieldTrials field_trials("");
// Uses some default hard coded values.
EXPECT_TRUE(QualityScalingExperiment::ParseSettings());
}
#else
TEST(QualityScalingExperimentTest, ParseSettingsFailsWithoutFieldTrial) {
webrtc::test::ScopedFieldTrials field_trials("");
EXPECT_FALSE(QualityScalingExperiment::ParseSettings());
}
#endif
TEST(QualityScalingExperimentTest, ParseSettingsFailsWithInvalidFieldTrial) {
webrtc::test::ScopedFieldTrials field_trials(

Просмотреть файл

@ -5691,6 +5691,8 @@ TEST_F(VideoStreamEncoderTest, RampsUpInQualityWhenBwIsHigh) {
TEST_F(VideoStreamEncoderTest,
QualityScalerAdaptationsRemovedWhenQualityScalingDisabled) {
webrtc::test::ScopedFieldTrials field_trials(
"WebRTC-Video-QualityScaling/Disabled/");
AdaptingFrameForwarder source(&time_controller_);
source.set_adaptation_enabled(true);
video_stream_encoder_->SetSource(&source,