Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(683)

Unified Diff: remoting/host/host_plugin.cc

Issue 6961043: Temporarily add media library initialization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Describe the Mac OS X path fu. Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/host_plugin.cc
diff --git a/remoting/host/host_plugin.cc b/remoting/host/host_plugin.cc
index 09550aed2ee37cd2c9463a0bfa9a865a5ca692f1..371d91f7e7e71786dfa0946e9508679a386a1435 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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698