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

Unified Diff: webrtc/media/engine/webrtcvideoengine2_unittest.cc

Issue 1840043005: Don't reconfigure the encoder if the video options aren't changing. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: removing whitespace Created 4 years, 9 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/media/engine/webrtcvideoengine2.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvideoengine2_unittest.cc
diff --git a/webrtc/media/engine/webrtcvideoengine2_unittest.cc b/webrtc/media/engine/webrtcvideoengine2_unittest.cc
index e8800ba66f3cc7e171b008765247b0b624a74365..81687da79cda87bd46f4ccb963ce3ba5893d1290 100644
--- a/webrtc/media/engine/webrtcvideoengine2_unittest.cc
+++ b/webrtc/media/engine/webrtcvideoengine2_unittest.cc
@@ -1811,6 +1811,30 @@ TEST_F(WebRtcVideoChannel2Test, VerifyVp8SpecificSettings) {
EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL));
}
+// Test that setting the same options doesn't result in the encoder being
+// reconfigured.
+TEST_F(WebRtcVideoChannel2Test, SetIdenticalOptionsDoesntReconfigureEncoder) {
+ VideoOptions options;
+ cricket::FakeVideoCapturer capturer;
+
+ FakeVideoSendStream* send_stream = AddSendStream();
+ EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer));
+ EXPECT_EQ(cricket::CS_RUNNING,
+ capturer.Start(capturer.GetSupportedFormats()->front()));
+ EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, &options));
+ EXPECT_TRUE(capturer.CaptureFrame());
+ // Expect 2 reconfigurations at this point, from the initial configuration
+ // and from the dimensions of the first frame.
+ EXPECT_EQ(2, send_stream->num_encoder_reconfigurations());
+
+ // Set the options one more time and expect no additional reconfigurations.
+ EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, &options));
+ EXPECT_TRUE(capturer.CaptureFrame());
+ EXPECT_EQ(2, send_stream->num_encoder_reconfigurations());
+
+ EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, nullptr));
+}
+
class Vp9SettingsTest : public WebRtcVideoChannel2Test {
public:
Vp9SettingsTest() : Vp9SettingsTest("") {}
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698