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

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

Issue 1148233002: [Cast] Compute utilization metrics and add performance overlay. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed hubbe's comments. 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"
15 #include "media/cast/sender/vp8_encoder.h" 16 #include "media/cast/sender/vp8_encoder.h"
16 #include "media/cast/test/utility/default_config.h" 17 #include "media/cast/test/utility/default_config.h"
17 #include "media/cast/test/utility/standalone_cast_environment.h" 18 #include "media/cast/test/utility/standalone_cast_environment.h"
18 #include "media/cast/test/utility/video_utility.h" 19 #include "media/cast/test/utility/video_utility.h"
19 #include "testing/gtest/include/gtest/gtest.h" 20 #include "testing/gtest/include/gtest/gtest.h"
20 21
21 namespace media { 22 namespace media {
22 namespace cast { 23 namespace cast {
23 24
24 namespace { 25 namespace {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 next_frame_size_, 78 next_frame_size_,
78 gfx::Rect(next_frame_size_), 79 gfx::Rect(next_frame_size_),
79 next_frame_size_, 80 next_frame_size_,
80 next_frame_timestamp_); 81 next_frame_timestamp_);
81 const base::TimeTicks reference_time = 82 const base::TimeTicks reference_time =
82 base::TimeTicks::UnixEpoch() + next_frame_timestamp_; 83 base::TimeTicks::UnixEpoch() + next_frame_timestamp_;
83 next_frame_timestamp_ += base::TimeDelta::FromSeconds(1) / kFrameRate; 84 next_frame_timestamp_ += base::TimeDelta::FromSeconds(1) / kFrameRate;
84 PopulateVideoFrame(video_frame.get(), 0); 85 PopulateVideoFrame(video_frame.get(), 0);
85 86
86 // Encode |frame| into |encoded_frame->data|. 87 // Encode |frame| into |encoded_frame->data|.
87 scoped_ptr<EncodedFrame> encoded_frame(new EncodedFrame()); 88 scoped_ptr<SenderEncodedFrame> encoded_frame(new SenderEncodedFrame());
88 // Test only supports VP8, currently. 89 // Test only supports VP8, currently.
89 CHECK_EQ(CODEC_VIDEO_VP8, GetParam()); 90 CHECK_EQ(CODEC_VIDEO_VP8, GetParam());
90 vp8_encoder_.Encode(video_frame, reference_time, encoded_frame.get()); 91 vp8_encoder_.Encode(video_frame, reference_time, encoded_frame.get());
91 // Rewrite frame IDs for testing purposes. 92 // Rewrite frame IDs for testing purposes.
92 encoded_frame->frame_id = last_frame_id_ + 1 + num_dropped_frames; 93 encoded_frame->frame_id = last_frame_id_ + 1 + num_dropped_frames;
93 if (encoded_frame->dependency == EncodedFrame::KEY) 94 if (encoded_frame->dependency == EncodedFrame::KEY)
94 encoded_frame->referenced_frame_id = encoded_frame->frame_id; 95 encoded_frame->referenced_frame_id = encoded_frame->frame_id;
95 else 96 else
96 encoded_frame->referenced_frame_id = encoded_frame->frame_id - 1; 97 encoded_frame->referenced_frame_id = encoded_frame->frame_id - 1;
97 last_frame_id_ = encoded_frame->frame_id; 98 last_frame_id_ = encoded_frame->frame_id;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 223
223 WaitForAllVideoToBeDecoded(); 224 WaitForAllVideoToBeDecoded();
224 } 225 }
225 226
226 INSTANTIATE_TEST_CASE_P(, 227 INSTANTIATE_TEST_CASE_P(,
227 VideoDecoderTest, 228 VideoDecoderTest,
228 ::testing::Values(CODEC_VIDEO_VP8)); 229 ::testing::Values(CODEC_VIDEO_VP8));
229 230
230 } // namespace cast 231 } // namespace cast
231 } // namespace media 232 } // 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