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

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: Comments. 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
« no previous file with comments | « media/base/video_decoder.h ('k') | media/filters/android/media_codec_audio_decoder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(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
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
OLDNEW
« no previous file with comments | « media/base/video_decoder.h ('k') | media/filters/android/media_codec_audio_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698