diff options
author | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-18 00:36:22 +0000 |
---|---|---|
committer | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-18 00:36:22 +0000 |
commit | 10000d66052ed5a1c42f5173bd93ea0af8a6d19b (patch) | |
tree | 272e718e2858efd87e71af38fcffd897fd4c6e94 /chrome/renderer | |
parent | 359cadcdcebadd6d9d87ee92d3dace00ad0a0736 (diff) | |
download | chromium_src-10000d66052ed5a1c42f5173bd93ea0af8a6d19b.zip chromium_src-10000d66052ed5a1c42f5173bd93ea0af8a6d19b.tar.gz chromium_src-10000d66052ed5a1c42f5173bd93ea0af8a6d19b.tar.bz2 |
Move the ffmpeg loading function into media library.
This will allow us to hide the platform specific library loading code from the main chrome code.
Review URL: http://codereview.chromium.org/69027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13991 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/render_process.cc | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/chrome/renderer/render_process.cc b/chrome/renderer/render_process.cc index 52043db..6cd9b68 100644 --- a/chrome/renderer/render_process.cc +++ b/chrome/renderer/render_process.cc @@ -28,43 +28,9 @@ #include "chrome/common/render_messages.h" #include "chrome/common/transport_dib.h" #include "chrome/renderer/render_view.h" +#include "media/base/media.h" #include "webkit/glue/webkit_glue.h" -// Attempts to load FFmpeg before engaging the sandbox. Returns true if all -// libraries were loaded successfully, false otherwise. -static bool LoadFFmpeg() { -#if defined(OS_WIN) - int path_keys[] = { - chrome::FILE_LIBAVCODEC, - chrome::FILE_LIBAVFORMAT, - chrome::FILE_LIBAVUTIL - }; - HMODULE libs[arraysize(path_keys)] = {NULL}; - for (size_t i = 0; i < arraysize(path_keys); ++i) { - std::wstring path; - if (!PathService::Get(path_keys[i], &path)) - break; - libs[i] = LoadLibrary(path.c_str()); - if (!libs[i]) - break; - } - - // Check that we loaded all libraries successfully. - if (libs[arraysize(libs)-1]) - return true; - - // Free any loaded libraries if we weren't successful. - for (size_t i = 0; i < arraysize(libs) && libs[i] != NULL; ++i) { - FreeLibrary(libs[i]); - } - return false; -#else - // TODO(port): Need to handle loading FFmpeg on non-Windows platforms. - NOTIMPLEMENTED(); - return false; -#endif -} - //----------------------------------------------------------------------------- RenderProcess::RenderProcess() @@ -140,8 +106,11 @@ void RenderProcess::Init() { StatisticsRecorder::set_dump_on_exit(true); } - if (LoadFFmpeg()) { - webkit_glue::SetMediaPlayerAvailable(true); + FilePath module_path; + if (PathService::Get(base::DIR_MODULE, &module_path)) { + if (media::InitializeMediaLibrary(module_path)) { + webkit_glue::SetMediaPlayerAvailable(true); + } } } |