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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 } | 160 } |
161 | 161 |
162 void CompareFrameWithExpected(const scoped_refptr<VideoFrame>& frame) { | 162 void CompareFrameWithExpected(const scoped_refptr<VideoFrame>& frame) { |
163 ASSERT_LT(0u, expectations_.size()); | 163 ASSERT_LT(0u, expectations_.size()); |
164 auto& e = expectations_.front(); | 164 auto& e = expectations_.front(); |
165 expectations_.pop(); | 165 expectations_.pop(); |
166 EXPECT_LE(kVideoAcceptedPSNR, I420PSNR(e, frame)); | 166 EXPECT_LE(kVideoAcceptedPSNR, I420PSNR(e, frame)); |
167 ++count_frames_checked_; | 167 ++count_frames_checked_; |
168 } | 168 } |
169 | 169 |
170 void DecodeDone(VideoDecoder::Status status) { | 170 void DecodeDone(DecodeStatus status) { EXPECT_EQ(DecodeStatus::OK, status); } |
171 EXPECT_EQ(VideoDecoder::kOk, status); | |
172 } | |
173 | 171 |
174 int count_frames_checked() const { return count_frames_checked_; } | 172 int count_frames_checked() const { return count_frames_checked_; } |
175 | 173 |
176 private: | 174 private: |
177 friend class base::RefCountedThreadSafe<EndToEndFrameChecker>; | 175 friend class base::RefCountedThreadSafe<EndToEndFrameChecker>; |
178 virtual ~EndToEndFrameChecker() {} | 176 virtual ~EndToEndFrameChecker() {} |
179 | 177 |
180 FFmpegVideoDecoder decoder_; | 178 FFmpegVideoDecoder decoder_; |
181 std::queue<scoped_refptr<VideoFrame>> expectations_; | 179 std::queue<scoped_refptr<VideoFrame>> expectations_; |
182 int count_frames_checked_; | 180 int count_frames_checked_; |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 gfx::Size(kVideoWidth, kVideoHeight), base::TimeDelta())); | 409 gfx::Size(kVideoWidth, kVideoHeight), base::TimeDelta())); |
412 | 410 |
413 // After a power resume event, the factory should produce frames right away | 411 // After a power resume event, the factory should produce frames right away |
414 // because the encoder re-initializes on its own. | 412 // because the encoder re-initializes on its own. |
415 power_source_->GenerateResumeEvent(); | 413 power_source_->GenerateResumeEvent(); |
416 CreateFrameAndMemsetPlane(video_frame_factory.get()); | 414 CreateFrameAndMemsetPlane(video_frame_factory.get()); |
417 } | 415 } |
418 | 416 |
419 } // namespace cast | 417 } // namespace cast |
420 } // namespace media | 418 } // namespace media |
OLD | NEW |