| Index: media/gpu/dxva_video_decode_accelerator_win.cc
|
| diff --git a/media/gpu/dxva_video_decode_accelerator_win.cc b/media/gpu/dxva_video_decode_accelerator_win.cc
|
| index ae97a7eb977ecd25e56e0e7f8fe0975ac0032c6f..926d91abd5620a24ae33438fe7430bdea2268b74 100644
|
| --- a/media/gpu/dxva_video_decode_accelerator_win.cc
|
| +++ b/media/gpu/dxva_video_decode_accelerator_win.cc
|
| @@ -50,6 +50,27 @@
|
|
|
| namespace {
|
|
|
| +// AMD
|
| +// Path is appended on to the PROGRAM_FILES base path.
|
| +const wchar_t kAMDVPXDecoderDLLPath[] =
|
| + L"Common Files\\ATI Technologies\\Multimedia\\";
|
| +
|
| +const wchar_t kAMDVP9DecoderDLLName[] =
|
| +#if defined(ARCH_CPU_X86)
|
| + L"amf-mft-decvp9-decoder32.dll";
|
| +#elif defined(ARCH_CPU_X86_64)
|
| + L"amf-mft-decvp9-decoder64.dll";
|
| +#else
|
| +#error Unsupported Windows CPU Architecture
|
| +#endif
|
| +
|
| +const CLSID CLSID_AMDWebmMfVp9Dec = {
|
| + 0x2d2d728a,
|
| + 0x67d6,
|
| + 0x48ab,
|
| + {0x89, 0xfb, 0xa6, 0xec, 0x65, 0x55, 0x49, 0x70}};
|
| +
|
| +// Intel
|
| // Path is appended on to the PROGRAM_FILES base path.
|
| const wchar_t kVPXDecoderDLLPath[] = L"Intel\\Media SDK\\";
|
|
|
| @@ -1388,35 +1409,55 @@ bool DXVAVideoDecodeAccelerator::InitDecoder(VideoCodecProfile profile) {
|
| "blacklisted version of msmpeg2vdec.dll 6.1.7140", false);
|
| codec_ = kCodecH264;
|
| clsid = __uuidof(CMSH264DecoderMFT);
|
| - } else if (enable_accelerated_vpx_decode_ &&
|
| - (profile == VP8PROFILE_ANY || profile == VP9PROFILE_PROFILE0 ||
|
| - profile == VP9PROFILE_PROFILE1 ||
|
| - profile == VP9PROFILE_PROFILE2 ||
|
| - profile == VP9PROFILE_PROFILE3)) {
|
| + } else if (enable_accelerated_vpx_decode_ != 0 &&
|
| + (profile == media::VP8PROFILE_ANY ||
|
| + profile == media::VP9PROFILE_PROFILE0 ||
|
| + profile == media::VP9PROFILE_PROFILE1 ||
|
| + profile == media::VP9PROFILE_PROFILE2 ||
|
| + profile == media::VP9PROFILE_PROFILE3)) {
|
| int program_files_key = base::DIR_PROGRAM_FILES;
|
| if (base::win::OSInfo::GetInstance()->wow64_status() ==
|
| base::win::OSInfo::WOW64_ENABLED) {
|
| program_files_key = base::DIR_PROGRAM_FILES6432;
|
| }
|
|
|
| - base::FilePath dll_path;
|
| - RETURN_ON_FAILURE(PathService::Get(program_files_key, &dll_path),
|
| - "failed to get path for Program Files", false);
|
| -
|
| - dll_path = dll_path.Append(kVPXDecoderDLLPath);
|
| - if (profile == VP8PROFILE_ANY) {
|
| - codec_ = kCodecVP8;
|
| - dll_path = dll_path.Append(kVP8DecoderDLLName);
|
| - clsid = CLSID_WebmMfVp8Dec;
|
| - } else {
|
| - codec_ = kCodecVP9;
|
| - dll_path = dll_path.Append(kVP9DecoderDLLName);
|
| - clsid = CLSID_WebmMfVp9Dec;
|
| + // Intel
|
| + if (enable_accelerated_vpx_decode_ & gpu::GpuPreferences::kVpxVendorIntel) {
|
| + base::FilePath dll_path;
|
| + if (PathService::Get(program_files_key, &dll_path)) {
|
| + dll_path = dll_path.Append(kVPXDecoderDLLPath);
|
| + if (profile == media::VP8PROFILE_ANY) {
|
| + codec_ = media::kCodecVP8;
|
| + dll_path = dll_path.Append(kVP8DecoderDLLName);
|
| + clsid = CLSID_WebmMfVp8Dec;
|
| + } else {
|
| + codec_ = media::kCodecVP9;
|
| + dll_path = dll_path.Append(kVP9DecoderDLLName);
|
| + clsid = CLSID_WebmMfVp9Dec;
|
| + }
|
| + decoder_dll = ::LoadLibraryEx(dll_path.value().data(), NULL,
|
| + LOAD_WITH_ALTERED_SEARCH_PATH);
|
| + }
|
| }
|
| - decoder_dll = ::LoadLibraryEx(dll_path.value().data(), NULL,
|
| - LOAD_WITH_ALTERED_SEARCH_PATH);
|
| - RETURN_ON_FAILURE(decoder_dll, "vpx decoder dll is not loaded", false);
|
| - } else {
|
| + // AMD
|
| + if (decoder_dll == NULL &&
|
| + enable_accelerated_vpx_decode_ & gpu::GpuPreferences::kVpxVendorAmd &&
|
| + profile == media::VP9PROFILE_PROFILE0) {
|
| + base::FilePath dll_path;
|
| + if (PathService::Get(program_files_key, &dll_path)) {
|
| + codec_ = media::kCodecVP9;
|
| + dll_path = dll_path.Append(kAMDVPXDecoderDLLPath);
|
| + dll_path = dll_path.Append(kAMDVP9DecoderDLLName);
|
| + clsid = CLSID_AMDWebmMfVp9Dec;
|
| + decoder_dll = ::LoadLibraryEx(dll_path.value().data(), NULL,
|
| + LOAD_WITH_ALTERED_SEARCH_PATH);
|
| + }
|
| + }
|
| + }
|
| +
|
| + // if nothing selected at this point, or dlls failed to load,
|
| + // there is no support for this codec.
|
| + if (decoder_dll == NULL) {
|
| RETURN_ON_FAILURE(false, "Unsupported codec.", false);
|
| }
|
|
|
|
|