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

Side by Side Diff: media/cast/sender/h264_vt_encoder_unittest.cc

Issue 1834303005: Refactor audio and video decoder status into common file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix cast. Created 4 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 unified diff | Download patch
OLDNEW
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
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(DecoderStatus status) {
171 EXPECT_EQ(VideoDecoder::kOk, status); 171 EXPECT_EQ(DecoderStatus::OK, status);
172 } 172 }
173 173
174 int count_frames_checked() const { return count_frames_checked_; } 174 int count_frames_checked() const { return count_frames_checked_; }
175 175
176 private: 176 private:
177 friend class base::RefCountedThreadSafe<EndToEndFrameChecker>; 177 friend class base::RefCountedThreadSafe<EndToEndFrameChecker>;
178 virtual ~EndToEndFrameChecker() {} 178 virtual ~EndToEndFrameChecker() {}
179 179
180 FFmpegVideoDecoder decoder_; 180 FFmpegVideoDecoder decoder_;
181 std::queue<scoped_refptr<VideoFrame>> expectations_; 181 std::queue<scoped_refptr<VideoFrame>> expectations_;
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698