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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 message_loop_.RunUntilIdle(); | 307 message_loop_.RunUntilIdle(); |
308 | 308 |
309 EXPECT_EQ(10, metadata_recorder->count_frames_delivered()); | 309 EXPECT_EQ(10, metadata_recorder->count_frames_delivered()); |
310 } | 310 } |
311 | 311 |
312 #if defined(USE_PROPRIETARY_CODECS) | 312 #if defined(USE_PROPRIETARY_CODECS) |
313 TEST_F(H264VideoToolboxEncoderTest, CheckFramesAreDecodable) { | 313 TEST_F(H264VideoToolboxEncoderTest, CheckFramesAreDecodable) { |
314 VideoDecoderConfig config(kCodecH264, H264PROFILE_MAIN, frame_->format(), | 314 VideoDecoderConfig config(kCodecH264, H264PROFILE_MAIN, frame_->format(), |
315 COLOR_SPACE_UNSPECIFIED, frame_->coded_size(), | 315 COLOR_SPACE_UNSPECIFIED, frame_->coded_size(), |
316 frame_->visible_rect(), frame_->natural_size(), | 316 frame_->visible_rect(), frame_->natural_size(), |
317 EmptyExtraData(), false); | 317 EmptyExtraData(), Unencrypted()); |
318 scoped_refptr<EndToEndFrameChecker> checker(new EndToEndFrameChecker(config)); | 318 scoped_refptr<EndToEndFrameChecker> checker(new EndToEndFrameChecker(config)); |
319 | 319 |
320 VideoEncoder::FrameEncodedCallback cb = | 320 VideoEncoder::FrameEncodedCallback cb = |
321 base::Bind(&EndToEndFrameChecker::EncodeDone, checker.get()); | 321 base::Bind(&EndToEndFrameChecker::EncodeDone, checker.get()); |
322 for (uint32_t frame_id = 0; frame_id < 6; ++frame_id) { | 322 for (uint32_t frame_id = 0; frame_id < 6; ++frame_id) { |
323 checker->PushExpectation(frame_); | 323 checker->PushExpectation(frame_); |
324 EXPECT_TRUE(encoder_->EncodeVideoFrame(frame_, clock_->NowTicks(), cb)); | 324 EXPECT_TRUE(encoder_->EncodeVideoFrame(frame_, clock_->NowTicks(), cb)); |
325 AdvanceClockAndVideoFrameTimestamp(); | 325 AdvanceClockAndVideoFrameTimestamp(); |
326 } | 326 } |
327 | 327 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 gfx::Size(kVideoWidth, kVideoHeight), base::TimeDelta())); | 411 gfx::Size(kVideoWidth, kVideoHeight), base::TimeDelta())); |
412 | 412 |
413 // After a power resume event, the factory should produce frames right away | 413 // After a power resume event, the factory should produce frames right away |
414 // because the encoder re-initializes on its own. | 414 // because the encoder re-initializes on its own. |
415 power_source_->GenerateResumeEvent(); | 415 power_source_->GenerateResumeEvent(); |
416 CreateFrameAndMemsetPlane(video_frame_factory.get()); | 416 CreateFrameAndMemsetPlane(video_frame_factory.get()); |
417 } | 417 } |
418 | 418 |
419 } // namespace cast | 419 } // namespace cast |
420 } // namespace media | 420 } // namespace media |
OLD | NEW |