OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <queue> | 5 #include <queue> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/power_monitor/power_monitor.h" | 10 #include "base/power_monitor/power_monitor.h" |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 | 299 |
300 encoder_.reset(); | 300 encoder_.reset(); |
301 message_loop_.RunUntilIdle(); | 301 message_loop_.RunUntilIdle(); |
302 | 302 |
303 EXPECT_EQ(10, metadata_recorder->count_frames_delivered()); | 303 EXPECT_EQ(10, metadata_recorder->count_frames_delivered()); |
304 } | 304 } |
305 | 305 |
306 #if defined(USE_PROPRIETARY_CODECS) | 306 #if defined(USE_PROPRIETARY_CODECS) |
307 TEST_F(H264VideoToolboxEncoderTest, CheckFramesAreDecodable) { | 307 TEST_F(H264VideoToolboxEncoderTest, CheckFramesAreDecodable) { |
308 VideoDecoderConfig config(kCodecH264, H264PROFILE_MAIN, frame_->format(), | 308 VideoDecoderConfig config(kCodecH264, H264PROFILE_MAIN, frame_->format(), |
309 frame_->coded_size(), frame_->visible_rect(), | 309 COLOR_SPACE_UNSPECIFIED, frame_->coded_size(), |
310 frame_->natural_size(), nullptr, 0, false); | 310 frame_->visible_rect(), frame_->natural_size(), |
| 311 nullptr, 0, false); |
311 scoped_refptr<EndToEndFrameChecker> checker(new EndToEndFrameChecker(config)); | 312 scoped_refptr<EndToEndFrameChecker> checker(new EndToEndFrameChecker(config)); |
312 | 313 |
313 VideoEncoder::FrameEncodedCallback cb = | 314 VideoEncoder::FrameEncodedCallback cb = |
314 base::Bind(&EndToEndFrameChecker::EncodeDone, checker.get()); | 315 base::Bind(&EndToEndFrameChecker::EncodeDone, checker.get()); |
315 for (uint32 frame_id = 0; frame_id < 6; ++frame_id) { | 316 for (uint32 frame_id = 0; frame_id < 6; ++frame_id) { |
316 checker->PushExpectation(frame_); | 317 checker->PushExpectation(frame_); |
317 EXPECT_TRUE(encoder_->EncodeVideoFrame(frame_, clock_->NowTicks(), cb)); | 318 EXPECT_TRUE(encoder_->EncodeVideoFrame(frame_, clock_->NowTicks(), cb)); |
318 AdvanceClockAndVideoFrameTimestamp(); | 319 AdvanceClockAndVideoFrameTimestamp(); |
319 } | 320 } |
320 | 321 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 gfx::Size(kVideoWidth, kVideoHeight), base::TimeDelta())); | 405 gfx::Size(kVideoWidth, kVideoHeight), base::TimeDelta())); |
405 | 406 |
406 // After a power resume event, the factory should produce frames right away | 407 // After a power resume event, the factory should produce frames right away |
407 // because the encoder re-initializes on its own. | 408 // because the encoder re-initializes on its own. |
408 power_source_->GenerateResumeEvent(); | 409 power_source_->GenerateResumeEvent(); |
409 CreateFrameAndMemsetPlane(video_frame_factory.get()); | 410 CreateFrameAndMemsetPlane(video_frame_factory.get()); |
410 } | 411 } |
411 | 412 |
412 } // namespace cast | 413 } // namespace cast |
413 } // namespace media | 414 } // namespace media |
OLD | NEW |