diff options
author | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-01 23:17:28 +0000 |
---|---|---|
committer | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-01 23:17:28 +0000 |
commit | eb7f6abf44e7c88fb9c4470b003d608fee70016f (patch) | |
tree | fc81e75835c9a3176ada6acd0b5a787583d8f977 /remoting/host/host_plugin.cc | |
parent | d43d51fa9cfaaef0c64b87f209e2a0f626f87d54 (diff) | |
download | chromium_src-eb7f6abf44e7c88fb9c4470b003d608fee70016f.zip chromium_src-eb7f6abf44e7c88fb9c4470b003d608fee70016f.tar.gz chromium_src-eb7f6abf44e7c88fb9c4470b003d608fee70016f.tar.bz2 |
Revert 87534 - Statically link VPX into the Host Plugin.
BUG=
TEST=Host plugin loads and doesn't mysteriously crash trying to call into VPX when a connection is first made.
Review URL: http://codereview.chromium.org/7065026
TBR=wez@chromium.org
Review URL: http://codereview.chromium.org/7108002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87543 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/host_plugin.cc')
-rw-r--r-- | remoting/host/host_plugin.cc | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/remoting/host/host_plugin.cc b/remoting/host/host_plugin.cc index bc9bd41..11069d4 100644 --- a/remoting/host/host_plugin.cc +++ b/remoting/host/host_plugin.cc @@ -21,6 +21,10 @@ #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/base/auth_token_util.h" #include "remoting/host/chromoting_host.h" #include "remoting/host/chromoting_host_context.h" @@ -39,22 +43,6 @@ #define OSCALL __attribute__((visibility("default"))) #endif -#if defined(OS_WIN) -// TODO(wez): libvpx expects these 64-bit division functions to be provided -// by libgcc.a, which we aren't linked against. These implementations can -// be removed once we have native MSVC libvpx builds for Windows. -extern "C" { - -int64_t __cdecl __divdi3(int64_t a, int64_t b) { - return a / b; -} -uint64_t __cdecl __udivdi3(uint64_t a, uint64_t b) { - return a / b; -} - -} -#endif - /* Supported Javascript interface: readonly attribute string accessCode; @@ -413,6 +401,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; |