| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 DISALLOW_COPY_AND_ASSIGN(MetadataRecorder); | 133 DISALLOW_COPY_AND_ASSIGN(MetadataRecorder); |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 class EndToEndFrameChecker | 136 class EndToEndFrameChecker |
| 137 : public base::RefCountedThreadSafe<EndToEndFrameChecker> { | 137 : public base::RefCountedThreadSafe<EndToEndFrameChecker> { |
| 138 public: | 138 public: |
| 139 explicit EndToEndFrameChecker(const VideoDecoderConfig& config) | 139 explicit EndToEndFrameChecker(const VideoDecoderConfig& config) |
| 140 : decoder_(), count_frames_checked_(0) { | 140 : decoder_(), count_frames_checked_(0) { |
| 141 bool decoder_init_result; | 141 bool decoder_init_result; |
| 142 decoder_.Initialize( | 142 decoder_.Initialize( |
| 143 config, false, media::SetCdmReadyCB(), | 143 config, false, nullptr, |
| 144 base::Bind(&SaveDecoderInitResult, &decoder_init_result), | 144 base::Bind(&SaveDecoderInitResult, &decoder_init_result), |
| 145 base::Bind(&EndToEndFrameChecker::CompareFrameWithExpected, | 145 base::Bind(&EndToEndFrameChecker::CompareFrameWithExpected, |
| 146 base::Unretained(this))); | 146 base::Unretained(this))); |
| 147 base::MessageLoop::current()->RunUntilIdle(); | 147 base::MessageLoop::current()->RunUntilIdle(); |
| 148 EXPECT_TRUE(decoder_init_result); | 148 EXPECT_TRUE(decoder_init_result); |
| 149 } | 149 } |
| 150 | 150 |
| 151 void PushExpectation(const scoped_refptr<VideoFrame>& frame) { | 151 void PushExpectation(const scoped_refptr<VideoFrame>& frame) { |
| 152 expectations_.push(frame); | 152 expectations_.push(frame); |
| 153 } | 153 } |
| (...skipping 257 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 |