summaryrefslogtreecommitdiffstats
path: root/media/base/media_posix.cc
diff options
context:
space:
mode:
authorajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-15 08:50:25 +0000
committerajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-15 08:50:25 +0000
commit1ac2c899c14cae7b0e87864980697751e7531a39 (patch)
tree7f6e3e9941be1274820b311e381723645e49a2d4 /media/base/media_posix.cc
parent919ddc8c4928d69c3db02c68c0dbf573ebc54899 (diff)
downloadchromium_src-1ac2c899c14cae7b0e87864980697751e7531a39.zip
chromium_src-1ac2c899c14cae7b0e87864980697751e7531a39.tar.gz
chromium_src-1ac2c899c14cae7b0e87864980697751e7531a39.tar.bz2
Add in macro to abstract the differences in library naming conventions between mac and linux.
TEST=none BUG=16736 Review URL: http://codereview.chromium.org/149632 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20720 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/media_posix.cc')
-rw-r--r--media/base/media_posix.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/media/base/media_posix.cc b/media/base/media_posix.cc
index 51efbca..b6d53a7 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 "Do not know how to construct DSO name for this 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("");