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_,