Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(894)

Unified Diff: media/gpu/dxva_video_decode_accelerator_win.cc

Issue 2105693003: Vp9 decoder mft support for AMD apu/gpu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change enum to follow chromium style enum naming, remove unecessary media:: scope Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..1cd9c8a4720bab11b409c522026e809f50e071a9 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,7 +1409,7 @@ 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_ &&
+ } else if (enable_accelerated_vpx_decode_ != 0 &&
DaleCurtis 2016/07/07 20:30:16 != unnecessary?
(profile == VP8PROFILE_ANY || profile == VP9PROFILE_PROFILE0 ||
profile == VP9PROFILE_PROFILE1 ||
profile == VP9PROFILE_PROFILE2 ||
@@ -1399,24 +1420,44 @@ bool DXVAVideoDecodeAccelerator::InitDecoder(VideoCodecProfile profile) {
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::VPX_VENDOR_INTEL) {
+ base::FilePath dll_path;
+ if (PathService::Get(program_files_key, &dll_path)) {
+ dll_path = dll_path.Append(kVPXDecoderDLLPath);
+ if (profile == 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 &&
DaleCurtis 2016/07/07 20:30:16 !decoder_dll
+ enable_accelerated_vpx_decode_ & gpu::GpuPreferences::VPX_VENDOR_AMD &&
+ profile == 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) {
DaleCurtis 2016/07/07 20:30:16 !decoder_dll
RETURN_ON_FAILURE(false, "Unsupported codec.", false);
}
« content/public/browser/gpu_utils.cc ('K') | « media/gpu/dxva_video_decode_accelerator_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698