Chromium Code Reviews| Index: remoting/host/host_plugin.cc |
| diff --git a/remoting/host/host_plugin.cc b/remoting/host/host_plugin.cc |
| index 09550aed2ee37cd2c9463a0bfa9a865a5ca692f1..f480184aa34ccc91a911946a9035bdcd913c9765 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,27 @@ 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) |
| + media_path = base::mac::MainAppBundlePath(); |
|
dmac
2011/05/23 16:54:50
can you comment why this works? because it wasn't
|
| + 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; |