From 0f51bf739b34509a4bbd757e53a91fc494a0f96a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85sa=20Persson?= Date: Mon, 3 Oct 2022 09:10:55 +0200 Subject: [PATCH] QualityScalingTest: Use EncoderStreamFactory instead of test::DefaultVideoStreamFactory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For example, QualityScalingTest.NoAdaptDownForLowStartBitrateIfBitrateEnough_Vp9 would now catch issues as in e.g. webrtc:14499 Add additional test: NoAdaptDownForHighStartBitrate_Vp9 (HD singlecast, default QP thresholds). Bug: webrtc:14499 Change-Id: I0e6a447c34befb7cfc3116b1ee9d0ff44824b0c0 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/277640 Commit-Queue: Åsa Persson Reviewed-by: Rasmus Brandt Cr-Commit-Position: refs/heads/main@{#38271} --- video/quality_scaling_tests.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/video/quality_scaling_tests.cc b/video/quality_scaling_tests.cc index 499168b7ae..7eaf14831b 100644 --- a/video/quality_scaling_tests.cc +++ b/video/quality_scaling_tests.cc @@ -19,6 +19,7 @@ #include "test/call_test.h" #include "test/field_trial.h" #include "test/frame_generator_capturer.h" +#include "video/config/encoder_stream_factory.h" namespace webrtc { namespace { @@ -122,12 +123,17 @@ class ScalingObserver : public test::SendTest { VideoSendStream::Config* send_config, std::vector* receive_configs, VideoEncoderConfig* encoder_config) override { + VideoEncoder::EncoderInfo encoder_info; send_config->encoder_settings.encoder_factory = &encoder_factory_; send_config->rtp.payload_name = payload_name_; send_config->rtp.payload_type = test::CallTest::kVideoSendPayloadType; encoder_config->video_format.name = payload_name_; const VideoCodecType codec_type = PayloadStringToCodecType(payload_name_); encoder_config->codec_type = codec_type; + encoder_config->video_stream_factory = + rtc::make_ref_counted( + payload_name_, /*max_qp=*/0, /*is_screenshare=*/false, + /*conference_mode=*/false, encoder_info); encoder_config->max_bitrate_bps = std::max(start_bps_, encoder_config->max_bitrate_bps); if (payload_name_ == "VP9") { @@ -472,6 +478,15 @@ TEST_F(QualityScalingTest, AdaptsDownForLowStartBitrate_Vp9) { RunBaseTest(&test); } +TEST_F(QualityScalingTest, NoAdaptDownForHighStartBitrate_Vp9) { + DownscalingObserver test( + "VP9", {{.active = false}, {.active = false}, {.active = true}}, + kHighStartBps, + /*automatic_resize=*/true, + /*expect_downscale=*/false); + RunBaseTest(&test); +} + TEST_F(QualityScalingTest, NoAdaptDownForHighQp_LowestStreamActive_Vp9) { // qp_low:1, qp_high:1 -> kHighQp test::ScopedKeyValueConfig field_trials(field_trials_,