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

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

Issue 126843003: Revert of Cast:Adding cast_transport_config and cleaning up (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « media/cast/rtp_receiver/rtp_parser/rtp_parser.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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 }; 70 };
71 } // namespace 71 } // namespace
72 72
73 class EncodeDecodeTest : public ::testing::Test { 73 class EncodeDecodeTest : public ::testing::Test {
74 protected: 74 protected:
75 EncodeDecodeTest() 75 EncodeDecodeTest()
76 : task_runner_(new test::FakeTaskRunner(&testing_clock_)), 76 : task_runner_(new test::FakeTaskRunner(&testing_clock_)),
77 // CastEnvironment will only be used by the vp8 decoder; Enable only the 77 // CastEnvironment will only be used by the vp8 decoder; Enable only the
78 // video decoder and main threads. 78 // video decoder and main threads.
79 cast_environment_(new CastEnvironment(&testing_clock_, task_runner_, 79 cast_environment_(new CastEnvironment(&testing_clock_, task_runner_,
80 NULL, NULL, NULL, task_runner_, NULL, 80 NULL, NULL, NULL, task_runner_, GetDefaultCastLoggingConfig())),
81 GetDefaultCastLoggingConfig())),
82 test_callback_(new EncodeDecodeTestFrameCallback()) { 81 test_callback_(new EncodeDecodeTestFrameCallback()) {
83 testing_clock_.Advance( 82 testing_clock_.Advance(
84 base::TimeDelta::FromMilliseconds(kStartMillisecond)); 83 base::TimeDelta::FromMilliseconds(kStartMillisecond));
85 encoder_config_.max_number_of_video_buffers_used = 1; 84 encoder_config_.max_number_of_video_buffers_used = 1;
86 encoder_config_.number_of_cores = 1; 85 encoder_config_.number_of_cores = 1;
87 encoder_config_.width = kWidth; 86 encoder_config_.width = kWidth;
88 encoder_config_.height = kHeight; 87 encoder_config_.height = kHeight;
89 encoder_config_.start_bitrate = kStartbitrate; 88 encoder_config_.start_bitrate = kStartbitrate;
90 encoder_config_.min_qp = kMaxQp; 89 encoder_config_.min_qp = kMaxQp;
91 encoder_config_.min_qp = kMinQp; 90 encoder_config_.min_qp = kMinQp;
(...skipping 20 matching lines...) Expand all
112 scoped_ptr<Vp8Encoder> encoder_; 111 scoped_ptr<Vp8Encoder> encoder_;
113 scoped_ptr<Vp8Decoder> decoder_; 112 scoped_ptr<Vp8Decoder> decoder_;
114 scoped_refptr<media::VideoFrame> video_frame_; 113 scoped_refptr<media::VideoFrame> video_frame_;
115 base::SimpleTestTickClock testing_clock_; 114 base::SimpleTestTickClock testing_clock_;
116 scoped_refptr<test::FakeTaskRunner> task_runner_; 115 scoped_refptr<test::FakeTaskRunner> task_runner_;
117 scoped_refptr<CastEnvironment> cast_environment_; 116 scoped_refptr<CastEnvironment> cast_environment_;
118 scoped_refptr<EncodeDecodeTestFrameCallback> test_callback_; 117 scoped_refptr<EncodeDecodeTestFrameCallback> test_callback_;
119 }; 118 };
120 119
121 TEST_F(EncodeDecodeTest, BasicEncodeDecode) { 120 TEST_F(EncodeDecodeTest, BasicEncodeDecode) {
122 transport::EncodedVideoFrame encoded_frame; 121 EncodedVideoFrame encoded_frame;
123 // Encode frame. 122 // Encode frame.
124 encoder_->Encode(video_frame_, &encoded_frame); 123 encoder_->Encode(video_frame_, &encoded_frame);
125 EXPECT_GT(encoded_frame.data.size(), GG_UINT64_C(0)); 124 EXPECT_GT(encoded_frame.data.size(), GG_UINT64_C(0));
126 // Decode frame. 125 // Decode frame.
127 decoder_->Decode(&encoded_frame, base::TimeTicks(), base::Bind( 126 decoder_->Decode(&encoded_frame, base::TimeTicks(), base::Bind(
128 &EncodeDecodeTestFrameCallback::DecodeComplete, test_callback_)); 127 &EncodeDecodeTestFrameCallback::DecodeComplete, test_callback_));
129 task_runner_->RunTasks(); 128 task_runner_->RunTasks();
130 } 129 }
131 130
132 } // namespace cast 131 } // namespace cast
133 } // namespace media 132 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/rtp_receiver/rtp_parser/rtp_parser.h ('k') | media/cast/test/end2end_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698