Commit 448e3a2a authored by Hirokazu Honda's avatar Hirokazu Honda Committed by Commit Bot

media/gpu/vaapi: Add Feature for VA-API HW AV1 decoder

This CL adds media Feature of controlling the availability of the
VAAPI HW AV1 decoder. The feature is enabled by default. Thanks
to this, we can disable the HW AV1 decoder by finch.

Bug: 1029212
Test: None
Change-Id: Ib9b6abb1322262ddaa489647c7dae0bcb1f9d515
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2399939
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Reviewed-by: default avatarAndres Calderon Jaramillo <andrescj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826622}
parent 9f4dc13e
...@@ -433,6 +433,10 @@ const base::Feature kUseR16Texture{"use-r16-texture", ...@@ -433,6 +433,10 @@ const base::Feature kUseR16Texture{"use-r16-texture",
const base::Feature kUnifiedAutoplay{"UnifiedAutoplay", const base::Feature kUnifiedAutoplay{"UnifiedAutoplay",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
// Enable VA-API hardware decode acceleration for AV1.
const base::Feature kVaapiAV1Decoder{"VaapiAV1Decoder",
base::FEATURE_DISABLED_BY_DEFAULT};
// Enable VA-API hardware low power encoder for all codecs on intel Gen9x gpu. // Enable VA-API hardware low power encoder for all codecs on intel Gen9x gpu.
const base::Feature kVaapiLowPowerEncoderGen9x{ const base::Feature kVaapiLowPowerEncoderGen9x{
"VaapiLowPowerEncoderGen9x", base::FEATURE_DISABLED_BY_DEFAULT}; "VaapiLowPowerEncoderGen9x", base::FEATURE_DISABLED_BY_DEFAULT};
......
...@@ -173,6 +173,7 @@ MEDIA_EXPORT extern const base::Feature kUseFakeDeviceForMediaStream; ...@@ -173,6 +173,7 @@ MEDIA_EXPORT extern const base::Feature kUseFakeDeviceForMediaStream;
MEDIA_EXPORT extern const base::Feature kUseMediaHistoryStore; MEDIA_EXPORT extern const base::Feature kUseMediaHistoryStore;
MEDIA_EXPORT extern const base::Feature kUseR16Texture; MEDIA_EXPORT extern const base::Feature kUseR16Texture;
MEDIA_EXPORT extern const base::Feature kUseSodaForLiveCaption; MEDIA_EXPORT extern const base::Feature kUseSodaForLiveCaption;
MEDIA_EXPORT extern const base::Feature kVaapiAV1Decoder;
MEDIA_EXPORT extern const base::Feature kVaapiLowPowerEncoderGen9x; MEDIA_EXPORT extern const base::Feature kVaapiLowPowerEncoderGen9x;
MEDIA_EXPORT extern const base::Feature kVaapiVP8Encoder; MEDIA_EXPORT extern const base::Feature kVaapiVP8Encoder;
MEDIA_EXPORT extern const base::Feature kVaapiVP9Encoder; MEDIA_EXPORT extern const base::Feature kVaapiVP9Encoder;
......
...@@ -8,7 +8,9 @@ ...@@ -8,7 +8,9 @@
#include "base/system/sys_info.h" #include "base/system/sys_info.h"
#include "build/chromeos_buildflags.h" #include "build/chromeos_buildflags.h"
#include "media/base/media_switches.h"
#include "media/base/video_types.h" #include "media/base/video_types.h"
#include "media/gpu/buildflags.h"
#include "media/gpu/test/video.h" #include "media/gpu/test/video.h"
#include "media/gpu/test/video_player/video_decoder_client.h" #include "media/gpu/test/video_player/video_decoder_client.h"
...@@ -46,13 +48,23 @@ VideoPlayerTestEnvironment::VideoPlayerTestEnvironment( ...@@ -46,13 +48,23 @@ VideoPlayerTestEnvironment::VideoPlayerTestEnvironment(
const DecoderImplementation implementation, const DecoderImplementation implementation,
const base::FilePath& output_folder, const base::FilePath& output_folder,
const FrameOutputConfig& frame_output_config) const FrameOutputConfig& frame_output_config)
: video_(std::move(video)), : VideoTestEnvironment(
/*enabled_features=*/
{
#if BUILDFLAG(USE_VAAPI)
// TODO(b/172217032): remove once enabled by default.
media::kVaapiAV1Decoder,
#endif
},
/*disabled_featureas=*/{}),
video_(std::move(video)),
enable_validator_(enable_validator), enable_validator_(enable_validator),
implementation_(implementation), implementation_(implementation),
frame_output_config_(frame_output_config), frame_output_config_(frame_output_config),
output_folder_(output_folder), output_folder_(output_folder),
gpu_memory_buffer_factory_( gpu_memory_buffer_factory_(
gpu::GpuMemoryBufferFactory::CreateNativeType(nullptr)) {} gpu::GpuMemoryBufferFactory::CreateNativeType(nullptr)) {
}
VideoPlayerTestEnvironment::~VideoPlayerTestEnvironment() = default; VideoPlayerTestEnvironment::~VideoPlayerTestEnvironment() = default;
......
...@@ -359,7 +359,7 @@ const ProfileCodecMap& GetProfileCodecMap() { ...@@ -359,7 +359,7 @@ const ProfileCodecMap& GetProfileCodecMap() {
// to 2.9.0 or newer. // to 2.9.0 or newer.
// https://source.chromium.org/chromium/chromium/src/+/master:build/linux/sysroot_scripts/generated_package_lists/sid.amd64 // https://source.chromium.org/chromium/chromium/src/+/master:build/linux/sysroot_scripts/generated_package_lists/sid.amd64
{AV1PROFILE_PROFILE_MAIN, VAProfileAV1Profile0}, {AV1PROFILE_PROFILE_MAIN, VAProfileAV1Profile0},
#endif // defined (OS_CHROMEOS) #endif // BUILDFLAG(IS_ASH)
// VaapiWrapper does not support AV1 Profile 1. // VaapiWrapper does not support AV1 Profile 1.
// {AV1PROFILE_PROFILE_HIGH, VAProfileAV1Profile1}, // {AV1PROFILE_PROFILE_HIGH, VAProfileAV1Profile1},
}); });
...@@ -387,8 +387,15 @@ bool IsVAProfileSupported(VAProfile va_profile) { ...@@ -387,8 +387,15 @@ bool IsVAProfileSupported(VAProfile va_profile) {
} }
bool IsBlockedDriver(VaapiWrapper::CodecMode mode, VAProfile va_profile) { bool IsBlockedDriver(VaapiWrapper::CodecMode mode, VAProfile va_profile) {
if (!IsModeEncoding(mode)) if (!IsModeEncoding(mode)) {
#if BUILDFLAG(IS_ASH)
if (va_profile == VAProfileAV1Profile0 &&
!base::FeatureList::IsEnabled(kVaapiAV1Decoder)) {
return true;
}
#endif // BUILDFLAG(IS_ASH)
return false; return false;
}
// TODO(posciak): Remove once VP8 encoding is to be enabled by default. // TODO(posciak): Remove once VP8 encoding is to be enabled by default.
if (va_profile == VAProfileVP8Version0_3 && if (va_profile == VAProfileVP8Version0_3 &&
......
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