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

Unified Diff: media/gpu/dxva_video_decode_accelerator_win.cc

Issue 2256933002: Don't attempt to use hardware video decoding if mf.dll doesn't exist. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698