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

Side by Side Diff: content/common/gpu/media/video_encode_accelerator_unittest.cc

Issue 821453003: Update legacy Tuple-using code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 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
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 #include "base/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/files/memory_mapped_file.h" 9 #include "base/files/memory_mapped_file.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 // instantiated. 1169 // instantiated.
1170 // - If true, save output to file (provided an output filename was supplied). 1170 // - If true, save output to file (provided an output filename was supplied).
1171 // - Force a keyframe every n frames. 1171 // - Force a keyframe every n frames.
1172 // - Force bitrate; the actual required value is provided as a property 1172 // - Force bitrate; the actual required value is provided as a property
1173 // of the input stream, because it depends on stream type/resolution/etc. 1173 // of the input stream, because it depends on stream type/resolution/etc.
1174 // - If true, measure performance. 1174 // - If true, measure performance.
1175 // - If true, switch bitrate mid-stream. 1175 // - If true, switch bitrate mid-stream.
1176 // - If true, switch framerate mid-stream. 1176 // - If true, switch framerate mid-stream.
1177 class VideoEncodeAcceleratorTest 1177 class VideoEncodeAcceleratorTest
1178 : public ::testing::TestWithParam< 1178 : public ::testing::TestWithParam<
1179 Tuple7<int, bool, int, bool, bool, bool, bool> > {}; 1179 Tuple<int, bool, int, bool, bool, bool, bool>> {};
1180 1180
1181 TEST_P(VideoEncodeAcceleratorTest, TestSimpleEncode) { 1181 TEST_P(VideoEncodeAcceleratorTest, TestSimpleEncode) {
1182 size_t num_concurrent_encoders = GetParam().a; 1182 size_t num_concurrent_encoders = get<0>(GetParam());
1183 const bool save_to_file = GetParam().b; 1183 const bool save_to_file = get<1>(GetParam());
1184 const unsigned int keyframe_period = GetParam().c; 1184 const unsigned int keyframe_period = get<2>(GetParam());
1185 const bool force_bitrate = GetParam().d; 1185 const bool force_bitrate = get<3>(GetParam());
1186 const bool test_perf = GetParam().e; 1186 const bool test_perf = get<4>(GetParam());
1187 const bool mid_stream_bitrate_switch = GetParam().f; 1187 const bool mid_stream_bitrate_switch = get<5>(GetParam());
1188 const bool mid_stream_framerate_switch = GetParam().g; 1188 const bool mid_stream_framerate_switch = get<6>(GetParam());
1189 1189
1190 ScopedVector<ClientStateNotification<ClientState> > notes; 1190 ScopedVector<ClientStateNotification<ClientState> > notes;
1191 ScopedVector<VEAClient> clients; 1191 ScopedVector<VEAClient> clients;
1192 base::Thread encoder_thread("EncoderThread"); 1192 base::Thread encoder_thread("EncoderThread");
1193 ASSERT_TRUE(encoder_thread.Start()); 1193 ASSERT_TRUE(encoder_thread.Start());
1194 1194
1195 if (g_env->test_streams_.size() > 1) 1195 if (g_env->test_streams_.size() > 1)
1196 num_concurrent_encoders = g_env->test_streams_.size(); 1196 num_concurrent_encoders = g_env->test_streams_.size();
1197 1197
1198 // Create all encoders. 1198 // Create all encoders.
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 } 1329 }
1330 1330
1331 content::g_env = 1331 content::g_env =
1332 reinterpret_cast<content::VideoEncodeAcceleratorTestEnvironment*>( 1332 reinterpret_cast<content::VideoEncodeAcceleratorTestEnvironment*>(
1333 testing::AddGlobalTestEnvironment( 1333 testing::AddGlobalTestEnvironment(
1334 new content::VideoEncodeAcceleratorTestEnvironment( 1334 new content::VideoEncodeAcceleratorTestEnvironment(
1335 test_stream_data.Pass(), run_at_fps))); 1335 test_stream_data.Pass(), run_at_fps)));
1336 1336
1337 return RUN_ALL_TESTS(); 1337 return RUN_ALL_TESTS();
1338 } 1338 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698