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

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

Issue 2457203002: Revert of Reland Change ViEEncoder to not reconfigure the encoder until the video resolution is known. (Closed)
Patch Set: Created 4 years, 2 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/call/call_perf_tests.cc ('k') | webrtc/video/video_send_stream_tests.cc » ('j') | 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 4d86e6c6f44993266b9cb0880cf5a8c26a3c25af..868ff42b7cde1f0edc88600abd8decc1a90ab5ec 100644
--- a/webrtc/media/engine/webrtcvideoengine2_unittest.cc
+++ b/webrtc/media/engine/webrtcvideoengine2_unittest.cc
@@ -344,20 +344,24 @@
EXPECT_TRUE(
channel->AddSendStream(cricket::StreamParams::CreateLegacy(kSsrc)));
- EXPECT_EQ(0, encoder_factory.GetNumCreatedEncoders());
+ ASSERT_TRUE(encoder_factory.WaitForCreatedVideoEncoders(1));
+ ASSERT_EQ(1u, encoder_factory.encoders().size());
EXPECT_TRUE(channel->SetSend(true));
+
cricket::FakeVideoCapturer capturer;
EXPECT_TRUE(channel->SetVideoSend(kSsrc, true, nullptr, &capturer));
EXPECT_EQ(cricket::CS_RUNNING,
capturer.Start(capturer.GetSupportedFormats()->front()));
EXPECT_TRUE(capturer.CaptureFrame());
- // Sending one frame will have allocate the encoder.
- ASSERT_TRUE(encoder_factory.WaitForCreatedVideoEncoders(1));
+ // Sending one frame will have reallocated the encoder since input size
+ // changes from a small default to the actual frame width/height. Wait for
+ // that to happen then for the frame to be sent.
+ ASSERT_TRUE(encoder_factory.WaitForCreatedVideoEncoders(2));
EXPECT_TRUE_WAIT(encoder_factory.encoders()[0]->GetNumEncodedFrames() > 0,
kTimeout);
int num_created_encoders = encoder_factory.GetNumCreatedEncoders();
- EXPECT_EQ(num_created_encoders, 1);
+ EXPECT_EQ(num_created_encoders, 2);
// Setting codecs of the same type should not reallocate any encoders
// (expecting a no-op).
@@ -665,14 +669,6 @@
EXPECT_TRUE(
channel->AddSendStream(cricket::StreamParams::CreateLegacy(kSsrc)));
ASSERT_EQ(1u, encoder_factory.encoders().size());
-
- // Send a frame of 720p. This should trigger a "real" encoder initialization.
- cricket::VideoFormat format(
- 1280, 720, cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420);
- cricket::FakeVideoCapturer capturer;
- EXPECT_TRUE(channel->SetVideoSend(kSsrc, true, nullptr, &capturer));
- EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(format));
- EXPECT_TRUE(capturer.CaptureFrame());
ASSERT_TRUE(encoder_factory.encoders()[0]->WaitForInitEncode());
EXPECT_EQ(webrtc::kVideoCodecH264,
encoder_factory.encoders()[0]->GetCodecSettings().codecType);
« no previous file with comments | « webrtc/call/call_perf_tests.cc ('k') | webrtc/video/video_send_stream_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698