Index: media/video/capture/win/video_capture_device_factory_win.cc |
diff --git a/media/video/capture/win/video_capture_device_factory_win.cc b/media/video/capture/win/video_capture_device_factory_win.cc |
index 7f0d665e4ab9e23fbc499200bd6b744b45ece1a9..8b018fb19e0e1df2d0cb7867c799bc7aaea27e6d 100644 |
--- a/media/video/capture/win/video_capture_device_factory_win.cc |
+++ b/media/video/capture/win/video_capture_device_factory_win.cc |
@@ -8,7 +8,6 @@ |
#include <mferror.h> |
#include "base/command_line.h" |
-#include "base/lazy_instance.h" |
#include "base/metrics/histogram.h" |
#include "base/strings/string_util.h" |
#include "base/strings/sys_string_conversions.h" |
@@ -17,6 +16,7 @@ |
#include "base/win/scoped_variant.h" |
#include "base/win/windows_version.h" |
#include "media/base/media_switches.h" |
+#include "media/base/win/mf_initializer.h" |
#include "media/video/capture/win/video_capture_device_mf_win.h" |
#include "media/video/capture/win/video_capture_device_win.h" |
@@ -39,16 +39,6 @@ enum BlacklistedCameraNames { |
BLACKLISTED_CAMERA_MAX = BLACKLISTED_CAMERA_CYBERLINK_WEBCAM_SPLITTER |
}; |
-// Lazy Instance to initialize the MediaFoundation Library. |
-class MFInitializerSingleton { |
- public: |
- MFInitializerSingleton() { MFStartup(MF_VERSION, MFSTARTUP_LITE); } |
- ~MFInitializerSingleton() { MFShutdown(); } |
-}; |
- |
-static base::LazyInstance<MFInitializerSingleton> g_mf_initialize = |
- LAZY_INSTANCE_INITIALIZER; |
- |
// Blacklisted devices are identified by a characteristic prefix of the name. |
// This prefix is used case-insensitively. This list must be kept in sync with |
// |BlacklistedCameraNames|. |
@@ -60,10 +50,6 @@ static const char* const kBlacklistedCameraNames[] = { |
"CyberLink Webcam Splitter", |
}; |
-static void EnsureMediaFoundationInit() { |
- g_mf_initialize.Get(); |
-} |
- |
static bool LoadMediaFoundationDlls() { |
static const wchar_t* const kMfDLLs[] = { |
L"%WINDIR%\\system32\\mf.dll", |
@@ -83,7 +69,7 @@ static bool LoadMediaFoundationDlls() { |
static bool PrepareVideoCaptureAttributesMediaFoundation( |
IMFAttributes** attributes, |
int count) { |
- EnsureMediaFoundationInit(); |
+ InitializeMediaFoundation(); |
if (FAILED(MFCreateAttributes(attributes, count))) |
return false; |