Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1077)

Unified Diff: webrtc/video/vie_encoder_unittest.cc

Issue 2684683004: Make sure initial framedrop is off where quality scaling is off. (Closed)
Patch Set: Add test for initial framedrop off where quality scaling off Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video/vie_encoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « webrtc/video/vie_encoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698