Commit 991f605e authored by wez@chromium.org's avatar wez@chromium.org

Temporarily add media library initialization.

BUG=
TEST=Host plugin doesn't crash when started.

Review URL: http://codereview.chromium.org/6961043

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86353 0039d316-1c4b-4281-b951-d872f2087c98
parent 6a654d45
...@@ -9,15 +9,22 @@ ...@@ -9,15 +9,22 @@
#include <vector> #include <vector>
#include "base/at_exit.h" #include "base/at_exit.h"
#include "base/base_paths.h"
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/file_path.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/message_loop.h" #include "base/message_loop.h"
#include "base/path_service.h"
#include "base/rand_util.h" #include "base/rand_util.h"
#include "base/stringize_macros.h" #include "base/stringize_macros.h"
#include "base/task.h" #include "base/task.h"
#include "base/threading/platform_thread.h" #include "base/threading/platform_thread.h"
#include "base/threading/thread.h" #include "base/threading/thread.h"
#if defined(OS_MACOSX)
#include "base/mac/foundation_util.h"
#endif
#include "media/base/media.h"
#include "remoting/host/chromoting_host.h" #include "remoting/host/chromoting_host.h"
#include "remoting/host/chromoting_host_context.h" #include "remoting/host/chromoting_host_context.h"
#include "remoting/host/host_config.h" #include "remoting/host/host_config.h"
...@@ -387,6 +394,29 @@ bool HostNPScriptObject::Connect(const NPVariant* args, ...@@ -387,6 +394,29 @@ bool HostNPScriptObject::Connect(const NPVariant* args,
return false; return false;
} }
// TODO(wez): Load the media libraries to get the VP8 encoder.
// This won't be needed once we link libvpx in statically.
FilePath media_path;
#if defined(OS_MACOSX)
// MainAppBundlePath returns the Chromium Helper bundle, which in dev builds
// sits alongside the Framework bundle, which contains the Libraries we need.
media_path = base::mac::MainAppBundlePath();
media_path = media_path.DirName();
media_path =
media_path.Append(FILE_PATH_LITERAL("Chromium Framework.framework"));
media_path =
media_path.Append(FILE_PATH_LITERAL("Libraries"));
#else
if (!PathService::Get(base::DIR_EXE, &media_path)) {
SetException("Failed to find media path");
return false;
}
#endif
if (!media::InitializeMediaLibrary(media_path)) {
SetException("Failed to load media library");
return false;
}
// Store the supplied user ID and token to the Host configuration. // Store the supplied user ID and token to the Host configuration.
scoped_refptr<remoting::MutableHostConfig> host_config = scoped_refptr<remoting::MutableHostConfig> host_config =
new remoting::InMemoryHostConfig; new remoting::InMemoryHostConfig;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment