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

media/gpu/test: Fix video decoder tests build when no decoder type is set.

When the video_decode_accelerator_(perf_)tests are build for ChromeOS the video
test code expects at least the 'use_v4l2_codec' or 'use_vaapi' flag to be set.
This CL ensures the build works if none of these flags are set. The test won't
work, but the build will not be broken.

BUG=993467

TEST=Built for ChromeOS without 'use_v4l2_codec' or 'use_vaapi' set

Change-Id: Ic7b543907ed1b37bcac2b9f2bc3dc006109a8166
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1752268Reviewed-by: default avatarManu Cornet <manucornet@chromium.org>
Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Reviewed-by: default avatarChih-Yu Huang <akahuang@chromium.org>
Commit-Queue: David Staessens <dstaessens@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686677}
parent 0dbf925f
...@@ -13,15 +13,19 @@ ...@@ -13,15 +13,19 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "media/base/bind_to_current_loop.h" #include "media/base/bind_to_current_loop.h"
#include "media/base/waiting.h" #include "media/base/waiting.h"
#include "media/gpu/buildflags.h"
#include "media/gpu/macros.h" #include "media/gpu/macros.h"
#include "media/gpu/test/video_decode_accelerator_unittest_helpers.h" #include "media/gpu/test/video_decode_accelerator_unittest_helpers.h"
#include "media/gpu/test/video_player/frame_renderer.h" #include "media/gpu/test/video_player/frame_renderer.h"
#include "media/gpu/test/video_player/test_vda_video_decoder.h" #include "media/gpu/test/video_player/test_vda_video_decoder.h"
#include "media/gpu/test/video_player/video.h" #include "media/gpu/test/video_player/video.h"
#if BUILDFLAG(USE_VAAPI) || BUILDFLAG(USE_V4L2_CODEC)
#include "media/gpu/linux/platform_video_frame_pool.h"
#endif // BUILDFLAG(USE_VAAPI) || BUILDFLAG(USE_V4L2_CODEC)
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
#include "media/gpu/chromeos/chromeos_video_decoder_factory.h" #include "media/gpu/chromeos/chromeos_video_decoder_factory.h"
#include "media/gpu/linux/platform_video_frame_pool.h"
#include "media/gpu/video_frame_converter.h" #include "media/gpu/video_frame_converter.h"
#endif // defined(OS_CHROMEOS) #endif // defined(OS_CHROMEOS)
...@@ -159,7 +163,7 @@ void VideoDecoderClient::CreateDecoderTask(bool* success, ...@@ -159,7 +163,7 @@ void VideoDecoderClient::CreateDecoderTask(bool* success,
LOG_ASSERT(!decoder_) << "Can't create decoder: already created"; LOG_ASSERT(!decoder_) << "Can't create decoder: already created";
if (decoder_client_config_.use_vd) { if (decoder_client_config_.use_vd) {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS) && (BUILDFLAG(USE_VAAPI) || BUILDFLAG(USE_V4L2_CODEC))
decoder_ = ChromeosVideoDecoderFactory::Create( decoder_ = ChromeosVideoDecoderFactory::Create(
base::ThreadTaskRunnerHandle::Get(), base::ThreadTaskRunnerHandle::Get(),
std::make_unique<PlatformVideoFramePool>(), std::make_unique<PlatformVideoFramePool>(),
......
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