Commit b046ba5c authored by David Staessens's avatar David Staessens Committed by Commit Bot

media/gpu/test: Improve video decoder tests usage documentation.

This CL adds additional documentation to the video_decode_accelerator_tests
command, describing supported parameters such as --vmodule and --metadata.

TEST=ran new VDA tests on nocturne

BUG=None

Change-Id: Ic5a54ca404a41a6f31a47d29640a4683f83ffa8b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1558735
Commit-Queue: David Staessens <dstaessens@chromium.org>
Reviewed-by: default avatarAlexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#649742}
parent 76a76332
...@@ -22,21 +22,27 @@ namespace { ...@@ -22,21 +22,27 @@ namespace {
// Video decoder tests usage message. // Video decoder tests usage message.
constexpr const char* usage_msg = constexpr const char* usage_msg =
"usage: video_decode_accelerator_tests\n" "usage: video_decode_accelerator_tests\n"
" [--help] [--disable_validator] [--output_frames]\n" " [-v=<level>] [--vmodule=<config>] [--disable_validator]\n"
" [--output_frames] [--gtest_help] [--help]\n"
" [<video path>] [<video metadata path>]\n"; " [<video path>] [<video metadata path>]\n";
// Video decoder tests help message. // Video decoder tests help message.
constexpr const char* help_msg = constexpr const char* help_msg =
"Run the video decode accelerator tests on the specified video. If no\n" "Run the video decode accelerator tests on the video specified by\n"
"video is specified the default \"test-25fps.h264\" video will be used.\n" "<video path>. If no <video path> is given the default\n"
"\nThe video metadata path should specify the location of a json file\n" "\"test-25fps.h264\" video will be used.\n"
"\nThe <video metadata path> should specify the location of a json file\n"
"containing the video's metadata, such as frame checksums. By default\n" "containing the video's metadata, such as frame checksums. By default\n"
"<video path>.json will be used.\n" "<video path>.json will be used.\n"
"\nThe following arguments are supported:\n" "\nThe following arguments are supported:\n"
" -v enable verbose mode, e.g. -v=2.\n"
" --vmodule enable verbose mode for the specified module,\n"
" e.g. --vmodule=*media/gpu*=2.\n"
" --disable_validator disable frame validation, useful on old\n" " --disable_validator disable frame validation, useful on old\n"
" platforms that don't support import mode.\n" " platforms that don't support import mode.\n"
" --output_frames write all decoded video frames to the\n" " --output_frames write all decoded video frames to the\n"
" \"video_frames\" folder.\n" " \"video_frames\" folder.\n"
" --gtest_help display the gtest help and exit.\n"
" --help display this help and exit.\n"; " --help display this help and exit.\n";
media::test::VideoPlayerTestEnvironment* g_env; media::test::VideoPlayerTestEnvironment* g_env;
...@@ -266,22 +272,19 @@ TEST_F(VideoDecoderTest, FlushAtEndOfStream_RenderThumbnails) { ...@@ -266,22 +272,19 @@ TEST_F(VideoDecoderTest, FlushAtEndOfStream_RenderThumbnails) {
} // namespace media } // namespace media
int main(int argc, char** argv) { int main(int argc, char** argv) {
base::CommandLine::Init(argc, argv); // Set the default test data path.
const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); media::test::Video::SetTestDataPath(media::GetTestDataPath());
// Print the help message if requested. This needs to be done before // Print the help message if requested. This needs to be done before
// initializing gtest, to overwrite the default gtest help message. // initializing gtest, to overwrite the default gtest help message.
base::CommandLine::Init(argc, argv);
const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
LOG_ASSERT(cmd_line); LOG_ASSERT(cmd_line);
if (cmd_line->HasSwitch("help")) { if (cmd_line->HasSwitch("help")) {
std::cout << media::test::usage_msg << "\n" << media::test::help_msg; std::cout << media::test::usage_msg << "\n" << media::test::help_msg;
return 0; return 0;
} }
testing::InitGoogleTest(&argc, argv);
// Set the default test data path.
media::test::Video::SetTestDataPath(media::GetTestDataPath());
// Check if a video was specified on the command line. // Check if a video was specified on the command line.
base::CommandLine::StringVector args = cmd_line->GetArgs(); base::CommandLine::StringVector args = cmd_line->GetArgs();
base::FilePath video_path = base::FilePath video_path =
...@@ -311,6 +314,8 @@ int main(int argc, char** argv) { ...@@ -311,6 +314,8 @@ int main(int argc, char** argv) {
} }
} }
testing::InitGoogleTest(&argc, argv);
// Set up our test environment. // Set up our test environment.
media::test::VideoPlayerTestEnvironment* test_environment = media::test::VideoPlayerTestEnvironment* test_environment =
media::test::VideoPlayerTestEnvironment::Create( media::test::VideoPlayerTestEnvironment::Create(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment