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

Unified Diff: content/common/gpu/media/dxva_video_decode_accelerator.cc

Issue 1149203002: Extract re-usable InitializeMediaFoundation() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix linkage of InitializeMediaFoundation() in GN builds Created 5 years, 7 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 | media/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/dxva_video_decode_accelerator.cc
diff --git a/content/common/gpu/media/dxva_video_decode_accelerator.cc b/content/common/gpu/media/dxva_video_decode_accelerator.cc
index 628bccd0f45ed8d26dc149e1728fa8ebcdf8cc26..568b128e1d1bdea5e0d98bed04fda5db6b54b733 100644
--- a/content/common/gpu/media/dxva_video_decode_accelerator.cc
+++ b/content/common/gpu/media/dxva_video_decode_accelerator.cc
@@ -29,6 +29,7 @@
#include "base/path_service.h"
#include "base/trace_event/trace_event.h"
#include "base/win/windows_version.h"
+#include "media/base/win/mf_initializer.h"
#include "media/video/video_decode_accelerator.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_context.h"
@@ -598,9 +599,7 @@ bool DXVAVideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile,
RETURN_AND_NOTIFY_ON_FAILURE((state == kUninitialized),
"Initialize: invalid state: " << state, ILLEGAL_STATE, false);
- HRESULT hr = MFStartup(MF_VERSION, MFSTARTUP_FULL);
- RETURN_AND_NOTIFY_ON_HR_FAILURE(hr, "MFStartup failed.", PLATFORM_FAILURE,
- false);
+ media::InitializeMediaFoundation();
RETURN_AND_NOTIFY_ON_FAILURE(InitDecoder(profile),
"Failed to initialize decoder", PLATFORM_FAILURE, false);
@@ -1447,7 +1446,6 @@ void DXVAVideoDecodeAccelerator::Invalidate() {
query_.Release();
}
- MFShutdown();
SetState(kUninitialized);
}
« no previous file with comments | « no previous file | media/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698