summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-23 22:21:36 +0000
committerwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-23 22:21:36 +0000
commit991f605ee989bce9ab105eae22ca521b70d27818 (patch)
tree68a016e55d3beba4a02c0b69c1cd82795ab02f2f
parent6a654d45598c2631f0009101a553fd14b866b62f (diff)
downloadchromium_src-991f605ee989bce9ab105eae22ca521b70d27818.zip
chromium_src-991f605ee989bce9ab105eae22ca521b70d27818.tar.gz
chromium_src-991f605ee989bce9ab105eae22ca521b70d27818.tar.bz2
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
-rw-r--r--remoting/host/host_plugin.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/remoting/host/host_plugin.cc b/remoting/host/host_plugin.cc
index 09550ae..371d91f 100644
--- a/remoting/host/host_plugin.cc
+++ b/remoting/host/host_plugin.cc
@@ -9,15 +9,22 @@
#include <vector>
#include "base/at_exit.h"
+#include "base/base_paths.h"
#include "base/basictypes.h"
#include "base/bind.h"
+#include "base/file_path.h"
#include "base/logging.h"
#include "base/message_loop.h"
+#include "base/path_service.h"
#include "base/rand_util.h"
#include "base/stringize_macros.h"
#include "base/task.h"
#include "base/threading/platform_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_context.h"
#include "remoting/host/host_config.h"
@@ -387,6 +394,29 @@ bool HostNPScriptObject::Connect(const NPVariant* args,
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.
scoped_refptr<remoting::MutableHostConfig> host_config =
new remoting::InMemoryHostConfig;