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 102337dbd28725536c59f4d4c7d1df8417490350..81442cd6cb211091da35a15a326e162d693b9333 100644 |
--- a/media/gpu/dxva_video_decode_accelerator_win.cc |
+++ b/media/gpu/dxva_video_decode_accelerator_win.cc |
@@ -155,6 +155,10 @@ static const DWORD g_IntelLegacyGPUList[] = { |
0x102, 0x106, 0x116, 0x126, |
}; |
+constexpr const wchar_t* const kMediaFoundationVideoDecoderDLLs[] = { |
sandersd (OOO until July 31)
2016/08/18 00:05:59
This looks rather redundant. Does constexpr not im
|
+ L"mf.dll", L"mfplat.dll", L"msmpeg2vdec.dll", |
+}; |
+ |
} // namespace |
namespace media { |
@@ -1040,6 +1044,15 @@ DXVAVideoDecodeAccelerator::GetSupportedProfiles( |
// TODO(henryhsu): Need to ensure the profiles are actually supported. |
SupportedProfiles profiles; |
+ |
+ for (const wchar_t* mfdll : kMediaFoundationVideoDecoderDLLs) { |
+ if (!::GetModuleHandle(mfdll)) { |
+ // Windows N is missing the media foundation DLLs unless the media |
+ // feature pack is installed. |
+ DVLOG(ERROR) << mfdll << " is required for hardware video decoding"; |
+ return profiles; |
+ } |
+ } |
for (const auto& supported_profile : kSupportedProfiles) { |
if (!preferences.enable_accelerated_vpx_decode && |
(supported_profile >= VP8PROFILE_MIN) && |
@@ -1060,9 +1073,8 @@ DXVAVideoDecodeAccelerator::GetSupportedProfiles( |
// static |
void DXVAVideoDecodeAccelerator::PreSandboxInitialization() { |
- ::LoadLibrary(L"MFPlat.dll"); |
- ::LoadLibrary(L"msmpeg2vdec.dll"); |
- ::LoadLibrary(L"mf.dll"); |
+ for (const wchar_t* mfdll : kMediaFoundationVideoDecoderDLLs) |
+ ::LoadLibrary(mfdll); |
::LoadLibrary(L"dxva2.dll"); |
if (base::win::GetVersion() > base::win::VERSION_WIN7) { |