Index: webrtc/video/vie_encoder_unittest.cc |
diff --git a/webrtc/video/vie_encoder_unittest.cc b/webrtc/video/vie_encoder_unittest.cc |
index 09d9a97d8c5d1d44ceb0fa432835fae6ebfb69a0..33b7ab3c003dc167dcad325151a2a296f6ce0c37 100644 |
--- a/webrtc/video/vie_encoder_unittest.cc |
+++ b/webrtc/video/vie_encoder_unittest.cc |
@@ -251,7 +251,9 @@ class ViEEncoderTest : public ::testing::Test { |
} |
VideoEncoder::ScalingSettings GetScalingSettings() const override { |
- return VideoEncoder::ScalingSettings(true, 1, 2); |
+ if (quality_scaling_) |
+ return VideoEncoder::ScalingSettings(true, 1, 2); |
+ return VideoEncoder::ScalingSettings(false); |
} |
void ContinueEncode() { continue_encode_event_.Set(); } |
@@ -263,6 +265,8 @@ class ViEEncoderTest : public ::testing::Test { |
EXPECT_EQ(ntp_time_ms_, ntp_time_ms); |
} |
+ void SetQualityScaling(bool b) { quality_scaling_ = b; } |
+ |
private: |
int32_t Encode(const VideoFrame& input_image, |
const CodecSpecificInfo* codec_specific_info, |
@@ -295,6 +299,7 @@ class ViEEncoderTest : public ::testing::Test { |
int64_t ntp_time_ms_ = 0; |
int last_input_width_ = 0; |
int last_input_height_ = 0; |
+ bool quality_scaling_ = true; |
}; |
class TestSink : public ViEEncoder::EncoderSink { |
@@ -1166,6 +1171,21 @@ TEST_F(ViEEncoderTest, InitialFrameDropOffWithMaintainResolutionPreference) { |
vie_encoder_->Stop(); |
} |
+TEST_F(ViEEncoderTest, InitialFrameDropOffWhenEncoderDisabledScaling) { |
+ int frame_width = 640; |
+ int frame_height = 360; |
+ fake_encoder_.SetQualityScaling(false); |
+ vie_encoder_->OnBitrateUpdated(kLowTargetBitrateBps, 0, 0); |
+ |
+ video_source_.IncomingCapturedFrame( |
+ CreateFrame(1, frame_width, frame_height)); |
+ // Frame should not be dropped, even if it's too large. |
+ sink_.WaitForEncodedFrame(1); |
+ |
+ vie_encoder_->Stop(); |
+ fake_encoder_.SetQualityScaling(true); |
+} |
+ |
// TODO(sprang): Extend this with fps throttling and any "balanced" extensions. |
TEST_F(ViEEncoderTest, AdaptsResolutionOnOveruse) { |
vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |