Skip to content

Commit

Permalink
Don't mark VP9 as supported for hardware decoding if it's blacklisted
Browse files Browse the repository at this point in the history
This should avoid a renderer roundtrip when decoding videos on some
systems where hardware video decoding isn't supported.

BUG=631841

Review-Url: https://codereview.chromium.org/2187673003
Cr-Commit-Position: refs/heads/master@{#408059}
  • Loading branch information
jbauman2 authored and Commit bot committed Jul 27, 2016
1 parent 3f69feb commit 3d65007
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion media/gpu/dxva_video_decode_accelerator_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1065,13 +1065,19 @@ GLenum DXVAVideoDecodeAccelerator::GetSurfaceInternalFormat() const {

// static
VideoDecodeAccelerator::SupportedProfiles
DXVAVideoDecodeAccelerator::GetSupportedProfiles() {
DXVAVideoDecodeAccelerator::GetSupportedProfiles(
const gpu::GpuPreferences& preferences) {
TRACE_EVENT0("gpu,startup",
"DXVAVideoDecodeAccelerator::GetSupportedProfiles");

// TODO(henryhsu): Need to ensure the profiles are actually supported.
SupportedProfiles profiles;
for (const auto& supported_profile : kSupportedProfiles) {
if (!preferences.enable_accelerated_vpx_decode &&
(supported_profile >= VP8PROFILE_MIN) &&
(supported_profile <= VP9PROFILE_MAX)) {
continue;
}
std::pair<int, int> min_resolution = GetMinResolution(supported_profile);
std::pair<int, int> max_resolution = GetMaxResolution(supported_profile);

Expand Down
3 changes: 2 additions & 1 deletion media/gpu/dxva_video_decode_accelerator_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ class MEDIA_GPU_EXPORT DXVAVideoDecodeAccelerator
override;
GLenum GetSurfaceInternalFormat() const override;

static VideoDecodeAccelerator::SupportedProfiles GetSupportedProfiles();
static VideoDecodeAccelerator::SupportedProfiles GetSupportedProfiles(
const gpu::GpuPreferences& gpu_preferences);

// Preload dlls required for decoding.
static void PreSandboxInitialization();
Expand Down
2 changes: 1 addition & 1 deletion media/gpu/gpu_video_decode_accelerator_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ GpuVideoDecodeAcceleratorFactory::GetDecoderCapabilities(
// resolutions and other supported profile parameters.
#if defined(OS_WIN)
capabilities.supported_profiles =
DXVAVideoDecodeAccelerator::GetSupportedProfiles();
DXVAVideoDecodeAccelerator::GetSupportedProfiles(gpu_preferences);
#elif defined(OS_CHROMEOS)
VideoDecodeAccelerator::SupportedProfiles vda_profiles;
#if defined(USE_V4L2_CODEC)
Expand Down

0 comments on commit 3d65007

Please sign in to comment.