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

Side by Side Diff: media/cast/test/encode_decode_test.cc

Issue 82593005: Cast: Switching recevier to use media::VideoFrame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing includes Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « media/cast/cast_receiver.h ('k') | media/cast/test/end2end_unittest.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // Joint encoder and decoder testing. 5 // Joint encoder and decoder testing.
6 // These tests operate directly on the VP8 encoder and decoder, not the 6 // These tests operate directly on the VP8 encoder and decoder, not the
7 // transport layer, and are targeted at validating the bit stream. 7 // transport layer, and are targeted at validating the bit stream.
8 8
9 #include <gtest/gtest.h> 9 #include <gtest/gtest.h>
10 10
(...skipping 25 matching lines...) Expand all
36 : num_called_(0) { 36 : num_called_(0) {
37 gfx::Size size(kWidth, kHeight); 37 gfx::Size size(kWidth, kHeight);
38 original_frame_ = media::VideoFrame::CreateFrame( 38 original_frame_ = media::VideoFrame::CreateFrame(
39 VideoFrame::I420, size, gfx::Rect(size), size, base::TimeDelta()); 39 VideoFrame::I420, size, gfx::Rect(size), size, base::TimeDelta());
40 } 40 }
41 41
42 void SetFrameStartValue(int start_value) { 42 void SetFrameStartValue(int start_value) {
43 PopulateVideoFrame(original_frame_.get(), start_value); 43 PopulateVideoFrame(original_frame_.get(), start_value);
44 } 44 }
45 45
46 void DecodeComplete(scoped_ptr<I420VideoFrame> decoded_frame, 46 void DecodeComplete(const scoped_refptr<media::VideoFrame>& decoded_frame,
47 const base::TimeTicks& render_time) { 47 const base::TimeTicks& render_time) {
48 ++num_called_; 48 ++num_called_;
49 // Compare resolution. 49 // Compare resolution.
50 EXPECT_EQ(original_frame_->coded_size().width(), decoded_frame->width); 50 EXPECT_EQ(original_frame_->coded_size().width(),
51 EXPECT_EQ(original_frame_->coded_size().height(), decoded_frame->height); 51 decoded_frame->coded_size().width());
52 EXPECT_EQ(original_frame_->coded_size().height(),
53 decoded_frame->coded_size().height());
52 // Compare data. 54 // Compare data.
53 EXPECT_GT(I420PSNR(*(original_frame_.get()), *(decoded_frame.get())), 40.0); 55 EXPECT_GT(I420PSNR(original_frame_, decoded_frame), 40.0);
54 } 56 }
55 57
56 int num_called() const { 58 int num_called() const {
57 return num_called_; 59 return num_called_;
58 } 60 }
59 61
60 protected: 62 protected:
61 virtual ~EncodeDecodeTestFrameCallback() {} 63 virtual ~EncodeDecodeTestFrameCallback() {}
62 64
63 private: 65 private:
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 encoder_->Encode(video_frame_, &encoded_frame); 123 encoder_->Encode(video_frame_, &encoded_frame);
122 EXPECT_GT(encoded_frame.data.size(), GG_UINT64_C(0)); 124 EXPECT_GT(encoded_frame.data.size(), GG_UINT64_C(0));
123 // Decode frame. 125 // Decode frame.
124 decoder_->Decode(&encoded_frame, base::TimeTicks(), base::Bind( 126 decoder_->Decode(&encoded_frame, base::TimeTicks(), base::Bind(
125 &EncodeDecodeTestFrameCallback::DecodeComplete, test_callback_)); 127 &EncodeDecodeTestFrameCallback::DecodeComplete, test_callback_));
126 task_runner_->RunTasks(); 128 task_runner_->RunTasks();
127 } 129 }
128 130
129 } // namespace cast 131 } // namespace cast
130 } // namespace media 132 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/cast_receiver.h ('k') | media/cast/test/end2end_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698