| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |