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

Unified Diff: media/base/media_posix.cc

Issue 149632: Add in macro to abstract the differences in library naming conventions between mac and linux. (Closed)
Patch Set: Created 11 years, 5 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: media/base/media_posix.cc
diff --git a/media/base/media_posix.cc b/media/base/media_posix.cc
index 51efbca3bc4576a7a37baa479341588e7d38d412..5d529a8e05325592602834b622a384c55306f9f2 100644
--- a/media/base/media_posix.cc
+++ b/media/base/media_posix.cc
@@ -19,18 +19,23 @@ namespace media {
namespace {
+#if defined(OS_MACOSX)
+#define DSO_NAME(MODULE, VERSION) ("lib" MODULE "." #VERSION ".dylib")
+#elif defined(OS_LINUX)
+#define DSO_NAME(MODULE, VERSION) ("lib" MODULE ".so." #VERSION)
+#else
+#error Unsupported OS.
+#endif
+
// Retrieves the DSOName for the given key.
std::string GetDSOName(tp_ffmpeg::StubModules stub_key) {
- // TODO(ajwong): Do we want to lock to a specific ffmpeg version?
- // TODO(port): These library names are incorrect for mac. We need .dynlib
- // suffixes.
switch (stub_key) {
case tp_ffmpeg::kModuleAvcodec52:
- return FILE_PATH_LITERAL("libavcodec.so.52");
+ return FILE_PATH_LITERAL(DSO_NAME("avcodec", 52));
case tp_ffmpeg::kModuleAvformat52:
- return FILE_PATH_LITERAL("libavformat.so.52");
+ return FILE_PATH_LITERAL(DSO_NAME("avformat", 52));
case tp_ffmpeg::kModuleAvutil50:
- return FILE_PATH_LITERAL("libavutil.so.50");
+ return FILE_PATH_LITERAL(DSO_NAME("avutil", 50));
default:
LOG(DFATAL) << "Invalid stub module requested: " << stub_key;
return FILE_PATH_LITERAL("");
« 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