Add details (where missing) for histograms and remove a few that are not worth provid...
[chromium-blink-merge.git] / media / base / media_win.cc
blob43bf6a7f45875571927c7272a87cf4a43831f269
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "media/base/media.h"
7 #include <windows.h>
8 #if defined(_WIN32_WINNT_WIN8)
9 // The Windows 8 SDK defines FACILITY_VISUALCPP in winerror.h.
10 #undef FACILITY_VISUALCPP
11 #endif
12 #include <delayimp.h>
14 #include "base/files/file_path.h"
16 #pragma comment(lib, "delayimp.lib")
18 namespace media {
19 namespace internal {
21 bool InitializeMediaLibraryInternal(const base::FilePath& module_dir) {
22 // LoadLibraryEx(..., LOAD_WITH_ALTERED_SEARCH_PATH) cannot handle
23 // relative path.
24 if (!module_dir.IsAbsolute())
25 return false;
27 // Use alternate DLL search path so we don't load dependencies from the
28 // system path. Refer to http://crbug.com/35857
29 static const char kFFmpegDLL[] = "ffmpegsumo.dll";
30 HMODULE lib = ::LoadLibraryEx(
31 module_dir.AppendASCII(kFFmpegDLL).value().c_str(), NULL,
32 LOAD_WITH_ALTERED_SEARCH_PATH);
34 // Check that we loaded the library successfully.
35 return lib != NULL;
38 } // namespace internal
39 } // namespace media