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

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

Issue 583503002: rendering_helper - Warm up the rendering. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase and nit Created 6 years, 2 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 | « content/common/gpu/media/rendering_helper.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // The bulk of this file is support code; sorry about that. Here's an overview 5 // The bulk of this file is support code; sorry about that. Here's an overview
6 // to hopefully help readers of this code: 6 // to hopefully help readers of this code:
7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or 7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or
8 // Win/EGL. 8 // Win/EGL.
9 // - ClientState is an enum for the state of the decode client used by the test. 9 // - ClientState is an enum for the state of the decode client used by the test.
10 // - ClientStateNotification is a barrier abstraction that allows the test code 10 // - ClientStateNotification is a barrier abstraction that allows the test code
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 FILE_PATH_LITERAL("test-25fps.h264:320:240:250:258:50:175:1"); 94 FILE_PATH_LITERAL("test-25fps.h264:320:240:250:258:50:175:1");
95 95
96 // The file path of the test output log. This is used to communicate the test 96 // The file path of the test output log. This is used to communicate the test
97 // results to CrOS autotests. We can enable the log and specify the filename by 97 // results to CrOS autotests. We can enable the log and specify the filename by
98 // the "--output_log" switch. 98 // the "--output_log" switch.
99 const base::FilePath::CharType* g_output_log = NULL; 99 const base::FilePath::CharType* g_output_log = NULL;
100 100
101 // The value is set by the switch "--rendering_fps". 101 // The value is set by the switch "--rendering_fps".
102 double g_rendering_fps = 60; 102 double g_rendering_fps = 60;
103 103
104 // The value is set by the switch "--rendering_warm_up".
105 int g_rendering_warm_up = 0;
106
104 // Magic constants for differentiating the reasons for NotifyResetDone being 107 // Magic constants for differentiating the reasons for NotifyResetDone being
105 // called. 108 // called.
106 enum ResetPoint { 109 enum ResetPoint {
107 // Reset() just after calling Decode() with a fragment containing config info. 110 // Reset() just after calling Decode() with a fragment containing config info.
108 RESET_AFTER_FIRST_CONFIG_INFO = -4, 111 RESET_AFTER_FIRST_CONFIG_INFO = -4,
109 START_OF_STREAM_RESET = -3, 112 START_OF_STREAM_RESET = -3,
110 MID_STREAM_RESET = -2, 113 MID_STREAM_RESET = -2,
111 END_OF_STREAM_RESET = -1 114 END_OF_STREAM_RESET = -1
112 }; 115 };
113 116
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
1063 1066
1064 // Suppress GL rendering for all tests when the "--rendering_fps" is 0. 1067 // Suppress GL rendering for all tests when the "--rendering_fps" is 0.
1065 const bool suppress_rendering = g_rendering_fps == 0; 1068 const bool suppress_rendering = g_rendering_fps == 0;
1066 1069
1067 std::vector<ClientStateNotification<ClientState>*> 1070 std::vector<ClientStateNotification<ClientState>*>
1068 notes(num_concurrent_decoders, NULL); 1071 notes(num_concurrent_decoders, NULL);
1069 std::vector<GLRenderingVDAClient*> clients(num_concurrent_decoders, NULL); 1072 std::vector<GLRenderingVDAClient*> clients(num_concurrent_decoders, NULL);
1070 1073
1071 RenderingHelperParams helper_params; 1074 RenderingHelperParams helper_params;
1072 helper_params.rendering_fps = g_rendering_fps; 1075 helper_params.rendering_fps = g_rendering_fps;
1076 helper_params.warm_up_iterations = g_rendering_warm_up;
1073 helper_params.render_as_thumbnails = render_as_thumbnails; 1077 helper_params.render_as_thumbnails = render_as_thumbnails;
1074 if (render_as_thumbnails) { 1078 if (render_as_thumbnails) {
1075 // Only one decoder is supported with thumbnail rendering 1079 // Only one decoder is supported with thumbnail rendering
1076 CHECK_EQ(num_concurrent_decoders, 1U); 1080 CHECK_EQ(num_concurrent_decoders, 1U);
1077 helper_params.thumbnails_page_size = kThumbnailsPageSize; 1081 helper_params.thumbnails_page_size = kThumbnailsPageSize;
1078 helper_params.thumbnail_size = kThumbnailSize; 1082 helper_params.thumbnail_size = kThumbnailSize;
1079 } 1083 }
1080 1084
1081 // First kick off all the decoders. 1085 // First kick off all the decoders.
1082 for (size_t index = 0; index < num_concurrent_decoders; ++index) { 1086 for (size_t index = 0; index < num_concurrent_decoders; ++index) {
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 ::testing::Values( 1338 ::testing::Values(
1335 MakeTuple(1, 1, 1, END_OF_STREAM_RESET, CS_RESET, false, true))); 1339 MakeTuple(1, 1, 1, END_OF_STREAM_RESET, CS_RESET, false, true)));
1336 1340
1337 // Measure the median of the decode time when VDA::Decode is called 30 times per 1341 // Measure the median of the decode time when VDA::Decode is called 30 times per
1338 // second. 1342 // second.
1339 TEST_F(VideoDecodeAcceleratorTest, TestDecodeTimeMedian) { 1343 TEST_F(VideoDecodeAcceleratorTest, TestDecodeTimeMedian) {
1340 RenderingHelperParams helper_params; 1344 RenderingHelperParams helper_params;
1341 1345
1342 // Disable rendering by setting the rendering_fps = 0. 1346 // Disable rendering by setting the rendering_fps = 0.
1343 helper_params.rendering_fps = 0; 1347 helper_params.rendering_fps = 0;
1348 helper_params.warm_up_iterations = 0;
1344 helper_params.render_as_thumbnails = false; 1349 helper_params.render_as_thumbnails = false;
1345 1350
1346 ClientStateNotification<ClientState>* note = 1351 ClientStateNotification<ClientState>* note =
1347 new ClientStateNotification<ClientState>(); 1352 new ClientStateNotification<ClientState>();
1348 GLRenderingVDAClient* client = 1353 GLRenderingVDAClient* client =
1349 new GLRenderingVDAClient(0, 1354 new GLRenderingVDAClient(0,
1350 &rendering_helper_, 1355 &rendering_helper_,
1351 note, 1356 note,
1352 test_video_files_[0]->data_str, 1357 test_video_files_[0]->data_str,
1353 1, 1358 1,
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 content::g_output_log = it->second.c_str(); 1419 content::g_output_log = it->second.c_str();
1415 continue; 1420 continue;
1416 } 1421 }
1417 if (it->first == "rendering_fps") { 1422 if (it->first == "rendering_fps") {
1418 // On Windows, CommandLine::StringType is wstring. We need to convert 1423 // On Windows, CommandLine::StringType is wstring. We need to convert
1419 // it to std::string first 1424 // it to std::string first
1420 std::string input(it->second.begin(), it->second.end()); 1425 std::string input(it->second.begin(), it->second.end());
1421 CHECK(base::StringToDouble(input, &content::g_rendering_fps)); 1426 CHECK(base::StringToDouble(input, &content::g_rendering_fps));
1422 continue; 1427 continue;
1423 } 1428 }
1429 if (it->first == "rendering_warm_up") {
1430 std::string input(it->second.begin(), it->second.end());
1431 CHECK(base::StringToInt(input, &content::g_rendering_warm_up));
1432 continue;
1433 }
1424 // TODO(owenlin): Remove this flag once it is not used in autotest. 1434 // TODO(owenlin): Remove this flag once it is not used in autotest.
1425 if (it->first == "disable_rendering") { 1435 if (it->first == "disable_rendering") {
1426 content::g_rendering_fps = 0; 1436 content::g_rendering_fps = 0;
1427 continue; 1437 continue;
1428 } 1438 }
1429 if (it->first == "v" || it->first == "vmodule") 1439 if (it->first == "v" || it->first == "vmodule")
1430 continue; 1440 continue;
1431 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; 1441 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second;
1432 } 1442 }
1433 1443
1434 base::ShadowingAtExitManager at_exit_manager; 1444 base::ShadowingAtExitManager at_exit_manager;
1435 content::RenderingHelper::InitializeOneOff(); 1445 content::RenderingHelper::InitializeOneOff();
1436 1446
1437 return RUN_ALL_TESTS(); 1447 return RUN_ALL_TESTS();
1438 } 1448 }
OLDNEW
« no previous file with comments | « content/common/gpu/media/rendering_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698