Commit 78d7ad31 authored by David Staessens's avatar David Staessens Committed by Commit Bot

media/gpu/test: Change logic to disable frame validation in video decoder tests.

This CL changes the logic used to disable frame validation when running the
video_decode_accelerator_tests binary. Currently when '--disable_validator' is
specified the frame validator will be disabled and the thumbnail test will be
run.

This CL changes this logic to automatically switch to the thumnail test when
support for import mode is not detected. The '--disable_validator' parameter is
now used to both disable the video frame validator (on platforms supporting
import mode) and the thumbnail test (on platforms only supporting allocate
mode).

TEST=./video_decode_accelerator_tests on nyan_big

BUG=None

Change-Id: Ia79acd8557ad102ac6ab4c97a5d1502818a14a83
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1688493
Commit-Queue: David Staessens <dstaessens@chromium.org>
Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676238}
parent 19fe0f76
......@@ -63,8 +63,7 @@ Multiple command line arguments can be given to the command:
-v enable verbose mode, e.g. -v=2.
--vmodule enable verbose mode for the specified module,
e.g. --vmodule=*media/gpu*=2.
--disable_validator disable frame validation, useful on old
platforms that don't support import mode.
--disable_validator disable frame validation.
--output_frames write all decoded video frames to the
"<testname>" folder.
--output_folder overwrite the default output folder used when
......
......@@ -39,8 +39,7 @@ constexpr const char* help_msg =
" -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"
" platforms that don't support import mode.\n"
" --disable_validator disable frame validation.\n"
" --output_frames write all decoded video frames to the\n"
" \"<testname>\" folder.\n"
" --output_folder overwrite the default output folder used when\n"
......@@ -63,8 +62,9 @@ class VideoDecoderTest : public ::testing::Test {
LOG_ASSERT(video);
std::vector<std::unique_ptr<VideoFrameProcessor>> frame_processors;
// Validate decoded video frames.
if (g_env->IsValidatorEnabled()) {
// Use the video frame validator to validate decoded video frames if import
// mode is supported.
if (g_env->IsValidatorEnabled() && g_env->ImportSupported()) {
frame_processors.push_back(
media::test::VideoFrameValidator::Create(video->FrameChecksums()));
}
......@@ -257,12 +257,11 @@ TEST_F(VideoDecoderTest, FlushAtEndOfStream_MultipleConcurrentDecodes) {
// Play a video from start to finish. Thumbnails of the decoded frames will be
// rendered into a image, whose checksum is compared to a golden value. This
// test is only needed on older platforms that don't support the video frame
// validator, which requires direct access to the video frame's memory. This
// test is only ran when --disable_validator is specified, and will be
// deprecated in the future.
// test is only run on older platforms that don't support the video frame
// validator, which requires import mode. This test will be deprecated once all
// devices support import mode.
TEST_F(VideoDecoderTest, FlushAtEndOfStream_RenderThumbnails) {
if (g_env->IsValidatorEnabled())
if (!g_env->IsValidatorEnabled() || g_env->ImportSupported())
GTEST_SKIP();
base::FilePath output_folder =
......
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