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

Unified Diff: media/base/media_win.cc

Issue 3005036: Implement VP8 encoder for chromoting (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: just uploading Created 10 years, 3 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 | « media/base/media_posix.cc ('k') | remoting/base/codec_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/media_win.cc
diff --git a/media/base/media_win.cc b/media/base/media_win.cc
index 6f9e0f827eaf35647f2201b0b2aa88b6e221b988..f31ab5b2019ca1e9030499a25c84bb16bf7e9f58 100644
--- a/media/base/media_win.cc
+++ b/media/base/media_win.cc
@@ -8,6 +8,7 @@
#include "base/file_path.h"
#include "base/logging.h"
+#include "base/native_library.h"
#include "base/path_service.h"
#include "base/scoped_ptr.h"
@@ -47,6 +48,9 @@ FilePath::CharType* GetDLLName(FFmpegDLLKeys dll_key) {
} // namespace
+// Address of vpx_codec_vp8_cx_algo.
+static void* vp8_cx_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) {
@@ -78,6 +82,16 @@ 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");
+ }
+
// 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.
@@ -97,4 +111,8 @@ bool InitializeOpenMaxLibrary(const FilePath& module_dir) {
return false;
}
+void* GetVp8CxAlgoAddress() {
+ return vp8_cx_algo_address;
+}
+
} // namespace media
« no previous file with comments | « media/base/media_posix.cc ('k') | remoting/base/codec_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698