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

Unified Diff: media/cast/sender/h264_vt_encoder_unittest.cc

Issue 1100643002: [cast] Handle frame size changes directly in the VideoToolbox encoder (v2). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Video frame factory rejects empty frame sizes. Created 5 years, 8 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
Index: media/cast/sender/h264_vt_encoder_unittest.cc
diff --git a/media/cast/sender/h264_vt_encoder_unittest.cc b/media/cast/sender/h264_vt_encoder_unittest.cc
index 04f3d629da95b23a9d9f8786347b5eb691ddacfd..4be1b93c7606b9d309b22957c961c6a484e0404b 100644
--- a/media/cast/sender/h264_vt_encoder_unittest.cc
+++ b/media/cast/sender/h264_vt_encoder_unittest.cc
@@ -208,8 +208,6 @@ class H264VideoToolboxEncoderTest : public ::testing::Test {
encoder_.reset(new H264VideoToolboxEncoder(
cast_environment_,
video_sender_config_,
- gfx::Size(kVideoWidth, kVideoHeight),
- 0u,
base::Bind(&SaveOperationalStatus, &operational_status_)));
message_loop_.RunUntilIdle();
EXPECT_EQ(STATUS_INITIALIZED, operational_status_);
@@ -306,10 +304,12 @@ TEST_F(H264VideoToolboxEncoderTest, CheckFramesAreDecodable) {
TEST_F(H264VideoToolboxEncoderTest, CheckVideoFrameFactory) {
auto video_frame_factory = encoder_->CreateVideoFrameFactory();
ASSERT_TRUE(video_frame_factory.get());
- CreateFrameAndMemsetPlane(video_frame_factory.get());
- // TODO(jfroy): Need to test that the encoder can encode VideoFrames provided
- // by the VideoFrameFactory.
- encoder_.reset();
+ // The first call to |MaybeCreateFrame| will return null but post a task to
+ // the encoder to initialize for the specified frame size. We then drain the
+ // message loop. After that, the encoder should have initialized and we
+ // request a frame again.
+ ASSERT_FALSE(video_frame_factory->MaybeCreateFrame(
+ gfx::Size(kVideoWidth, kVideoHeight), base::TimeDelta()));
message_loop_.RunUntilIdle();
CreateFrameAndMemsetPlane(video_frame_factory.get());
}

Powered by Google App Engine
This is Rietveld 408576698