diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-20 20:55:06 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-20 20:55:06 +0000 |
commit | 51ce34eab4a225db84827701a42ccad0850edcd4 (patch) | |
tree | ee4d4ceee9c7e8cdd3b788b68d427a427c6b6e88 | |
parent | 1045d07f06e346e7513a50a96d115446c3943bb8 (diff) | |
download | chromium_src-51ce34eab4a225db84827701a42ccad0850edcd4.zip chromium_src-51ce34eab4a225db84827701a42ccad0850edcd4.tar.gz chromium_src-51ce34eab4a225db84827701a42ccad0850edcd4.tar.bz2 |
Remove GetVp8CxAlgoAddress hack
libvpx has introduced vpx_codec_vp8_cx() and vpx_codec_vp8_dx() use them
instead.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/5831006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69745 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | DEPS | 2 | ||||
-rw-r--r-- | media/base/media.h | 12 | ||||
-rw-r--r-- | media/base/media_posix.cc | 26 | ||||
-rw-r--r-- | media/base/media_win.cc | 26 | ||||
-rw-r--r-- | remoting/base/decoder_vp8.cc | 9 | ||||
-rw-r--r-- | remoting/base/encoder_vp8.cc | 10 |
6 files changed, 9 insertions, 76 deletions
@@ -11,7 +11,7 @@ vars = { "nacl_revision": "4007", "libjingle_revision": "50", "libvpx_revision": "65287", - "ffmpeg_revision": "67548", + "ffmpeg_revision": "69487", } deps = { diff --git a/media/base/media.h b/media/base/media.h index 21dc6c2..3d1a83a 100644 --- a/media/base/media.h +++ b/media/base/media.h @@ -25,18 +25,6 @@ bool InitializeMediaLibrary(const FilePath& module_dir); // Returns true if OpenMAX was successfully initialized and loaded. bool InitializeOpenMaxLibrary(const FilePath& module_dir); -// This is temporary to get the address of vpx_codec_vp8_cx_algo in FFmpeg. -// This method should only be called after media library is loaded. -// TODO(hclam): Remove this after we have a getter function for the same -// purpose in libvpx. -void* GetVp8CxAlgoAddress(); - -// This is temporary to get the address of vpx_codec_vp8_dx_algo in FFmpeg. -// This method should only be called after media library is loaded. -// TODO(hclam): Remove this after we have a getter function for the same -// purpose in libvpx. -void* GetVp8DxAlgoAddress(); - } // namespace media #endif // MEDIA_BASE_MEDIA_H_ diff --git a/media/base/media_posix.cc b/media/base/media_posix.cc index 272e9e6..438155a 100644 --- a/media/base/media_posix.cc +++ b/media/base/media_posix.cc @@ -68,12 +68,6 @@ std::string GetDSOName(tp_ffmpeg::StubModules stub_key) { } // namespace -// Address of vpx_codec_vp8_cx_algo. -static void* vp8_cx_algo_address = NULL; - -// Address of vpx_codec_vp8_dx_algo. -static void* vp8_dx_algo_address = NULL; - // Attempts to initialize the media library (loading DSOs, etc.). // Returns true if everything was successfully initialized, false otherwise. bool InitializeMediaLibrary(const FilePath& module_dir) { @@ -91,18 +85,6 @@ bool InitializeMediaLibrary(const FilePath& module_dir) { } bool ret = tp_ffmpeg::InitializeStubs(paths); - - // TODO(hclam): This is temporary to obtain address of - // vpx_codec_vp8_cx_algo. This should be removed once libvpx has a - // getter method for it. - base::NativeLibrary sumo_lib = - base::LoadNativeLibrary(module_dir.Append(sumo_name)); - if (sumo_lib) { - vp8_cx_algo_address = base::GetFunctionPointerFromNativeLibrary( - sumo_lib, "vpx_codec_vp8_cx_algo"); - vp8_dx_algo_address = base::GetFunctionPointerFromNativeLibrary( - sumo_lib, "vpx_codec_vp8_dx_algo"); - } return ret; } @@ -132,12 +114,4 @@ bool InitializeOpenMaxLibrary(const FilePath& module_dir) { } #endif -void* GetVp8CxAlgoAddress() { - return vp8_cx_algo_address; -} - -void* GetVp8DxAlgoAddress() { - return vp8_dx_algo_address; -} - } // namespace media diff --git a/media/base/media_win.cc b/media/base/media_win.cc index 75c8d29..87a9aa3 100644 --- a/media/base/media_win.cc +++ b/media/base/media_win.cc @@ -48,12 +48,6 @@ FilePath::CharType* GetDLLName(FFmpegDLLKeys dll_key) { } // namespace -// Address of vpx_codec_vp8_cx_algo. -static void* vp8_cx_algo_address = NULL; - -// Address of vpx_codec_vp8_dx_algo. -static void* vp8_dx_algo_address = NULL; - // Attempts to initialize the media library (loading DLLs, DSOs, etc.). // Returns true if everything was successfully initialized, false otherwise. bool InitializeMediaLibrary(const FilePath& base_path) { @@ -85,18 +79,6 @@ bool InitializeMediaLibrary(const FilePath& base_path) { #endif } - // TODO(hclam): This is temporary to obtain address of - // vpx_codec_vp8_cx_algo. This should be removed once libvpx has a - // getter method for it. - base::NativeLibrary avcodec_lib = - base::LoadNativeLibrary(FilePath(GetDLLName(media::FILE_LIBAVCODEC))); - if (avcodec_lib) { - vp8_cx_algo_address = base::GetFunctionPointerFromNativeLibrary( - avcodec_lib, "vpx_codec_vp8_cx_algo"); - vp8_dx_algo_address = base::GetFunctionPointerFromNativeLibrary( - avcodec_lib, "vpx_codec_vp8_dx_algo"); - } - // Check that we loaded all libraries successfully. We only need to check the // last array element because the loop above will break without initializing // it on any prior error. @@ -116,12 +98,4 @@ bool InitializeOpenMaxLibrary(const FilePath& module_dir) { return false; } -void* GetVp8CxAlgoAddress() { - return vp8_cx_algo_address; -} - -void* GetVp8DxAlgoAddress() { - return vp8_dx_algo_address; -} - } // namespace media diff --git a/remoting/base/decoder_vp8.cc b/remoting/base/decoder_vp8.cc index fc89503..b150c4b 100644 --- a/remoting/base/decoder_vp8.cc +++ b/remoting/base/decoder_vp8.cc @@ -10,9 +10,9 @@ extern "C" { #define VPX_CODEC_DISABLE_COMPAT 1 -#include "third_party/libvpx/include/vpx/vpx_codec.h" -#include "third_party/libvpx/include/vpx/vpx_decoder.h" -#include "third_party/libvpx/include/vpx/vp8dx.h" +#include "third_party/libvpx/source/libvpx/vpx/vpx_codec.h" +#include "third_party/libvpx/source/libvpx/vpx/vpx_decoder.h" +#include "third_party/libvpx/source/libvpx/vpx/vp8dx.h" } namespace remoting { @@ -52,8 +52,7 @@ Decoder::DecodeResult DecoderVp8::DecodePacket(const VideoPacket* packet) { codec_ = new vpx_codec_ctx_t(); vpx_codec_err_t ret = vpx_codec_dec_init( - codec_, - (const vpx_codec_iface_t*)media::GetVp8DxAlgoAddress(), NULL, 0); + codec_, vpx_codec_vp8_dx(), NULL, 0); if (ret != VPX_CODEC_OK) { LOG(INFO) << "Cannot initialize codec."; delete codec_; diff --git a/remoting/base/encoder_vp8.cc b/remoting/base/encoder_vp8.cc index 6d07e54..24d6ba4 100644 --- a/remoting/base/encoder_vp8.cc +++ b/remoting/base/encoder_vp8.cc @@ -6,15 +6,14 @@ #include "base/logging.h" #include "media/base/callback.h" -#include "media/base/media.h" #include "remoting/base/capture_data.h" #include "remoting/proto/video.pb.h" extern "C" { #define VPX_CODEC_DISABLE_COMPAT 1 -#include "third_party/libvpx/include/vpx/vpx_codec.h" -#include "third_party/libvpx/include/vpx/vpx_encoder.h" -#include "third_party/libvpx/include/vpx/vp8cx.h" +#include "third_party/libvpx/source/libvpx/vpx/vpx_codec.h" +#include "third_party/libvpx/source/libvpx/vpx/vpx_encoder.h" +#include "third_party/libvpx/source/libvpx/vpx/vp8cx.h" } namespace remoting { @@ -47,8 +46,7 @@ bool EncoderVp8::Init(int width, int height) { image_->h = height; vpx_codec_enc_cfg_t config; - const vpx_codec_iface_t* algo = - (const vpx_codec_iface_t*)media::GetVp8CxAlgoAddress(); + const vpx_codec_iface_t* algo = vpx_codec_vp8_cx(); CHECK(algo); vpx_codec_err_t ret = vpx_codec_enc_config_default(algo, &config, 0); if (ret != VPX_CODEC_OK) |