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

Side by Side Diff: media/cast/receiver/video_decoder_unittest.cc

Issue 1143363005: Revert of [Cast] Compute utilization metrics and add performance overlay. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/cast/net/cast_transport_config.h ('k') | media/cast/sender/external_video_encoder.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 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 <cstdlib> 5 #include <cstdlib>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/synchronization/condition_variable.h" 10 #include "base/synchronization/condition_variable.h"
11 #include "base/synchronization/lock.h" 11 #include "base/synchronization/lock.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "media/cast/cast_config.h" 13 #include "media/cast/cast_config.h"
14 #include "media/cast/receiver/video_decoder.h" 14 #include "media/cast/receiver/video_decoder.h"
15 #include "media/cast/sender/sender_encoded_frame.h"
16 #include "media/cast/sender/vp8_encoder.h" 15 #include "media/cast/sender/vp8_encoder.h"
17 #include "media/cast/test/utility/default_config.h" 16 #include "media/cast/test/utility/default_config.h"
18 #include "media/cast/test/utility/standalone_cast_environment.h" 17 #include "media/cast/test/utility/standalone_cast_environment.h"
19 #include "media/cast/test/utility/video_utility.h" 18 #include "media/cast/test/utility/video_utility.h"
20 #include "testing/gtest/include/gtest/gtest.h" 19 #include "testing/gtest/include/gtest/gtest.h"
21 20
22 namespace media { 21 namespace media {
23 namespace cast { 22 namespace cast {
24 23
25 namespace { 24 namespace {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 next_frame_size_, 77 next_frame_size_,
79 gfx::Rect(next_frame_size_), 78 gfx::Rect(next_frame_size_),
80 next_frame_size_, 79 next_frame_size_,
81 next_frame_timestamp_); 80 next_frame_timestamp_);
82 const base::TimeTicks reference_time = 81 const base::TimeTicks reference_time =
83 base::TimeTicks::UnixEpoch() + next_frame_timestamp_; 82 base::TimeTicks::UnixEpoch() + next_frame_timestamp_;
84 next_frame_timestamp_ += base::TimeDelta::FromSeconds(1) / kFrameRate; 83 next_frame_timestamp_ += base::TimeDelta::FromSeconds(1) / kFrameRate;
85 PopulateVideoFrame(video_frame.get(), 0); 84 PopulateVideoFrame(video_frame.get(), 0);
86 85
87 // Encode |frame| into |encoded_frame->data|. 86 // Encode |frame| into |encoded_frame->data|.
88 scoped_ptr<SenderEncodedFrame> encoded_frame(new SenderEncodedFrame()); 87 scoped_ptr<EncodedFrame> encoded_frame(new EncodedFrame());
89 // Test only supports VP8, currently. 88 // Test only supports VP8, currently.
90 CHECK_EQ(CODEC_VIDEO_VP8, GetParam()); 89 CHECK_EQ(CODEC_VIDEO_VP8, GetParam());
91 vp8_encoder_.Encode(video_frame, reference_time, encoded_frame.get()); 90 vp8_encoder_.Encode(video_frame, reference_time, encoded_frame.get());
92 // Rewrite frame IDs for testing purposes. 91 // Rewrite frame IDs for testing purposes.
93 encoded_frame->frame_id = last_frame_id_ + 1 + num_dropped_frames; 92 encoded_frame->frame_id = last_frame_id_ + 1 + num_dropped_frames;
94 if (encoded_frame->dependency == EncodedFrame::KEY) 93 if (encoded_frame->dependency == EncodedFrame::KEY)
95 encoded_frame->referenced_frame_id = encoded_frame->frame_id; 94 encoded_frame->referenced_frame_id = encoded_frame->frame_id;
96 else 95 else
97 encoded_frame->referenced_frame_id = encoded_frame->frame_id - 1; 96 encoded_frame->referenced_frame_id = encoded_frame->frame_id - 1;
98 last_frame_id_ = encoded_frame->frame_id; 97 last_frame_id_ = encoded_frame->frame_id;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 222
224 WaitForAllVideoToBeDecoded(); 223 WaitForAllVideoToBeDecoded();
225 } 224 }
226 225
227 INSTANTIATE_TEST_CASE_P(, 226 INSTANTIATE_TEST_CASE_P(,
228 VideoDecoderTest, 227 VideoDecoderTest,
229 ::testing::Values(CODEC_VIDEO_VP8)); 228 ::testing::Values(CODEC_VIDEO_VP8));
230 229
231 } // namespace cast 230 } // namespace cast
232 } // namespace media 231 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/net/cast_transport_config.h ('k') | media/cast/sender/external_video_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698