| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/base/media.h" | 5 #include "media/base/media.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include <dlfcn.h> | 9 #include <dlfcn.h> |
| 10 | 10 |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/native_library.h" | 13 #include "base/native_library.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/stringize_macros.h" |
| 15 #include "media/ffmpeg/ffmpeg_common.h" | 16 #include "media/ffmpeg/ffmpeg_common.h" |
| 16 #include "third_party/ffmpeg/ffmpeg_stubs.h" | 17 #include "third_party/ffmpeg/ffmpeg_stubs.h" |
| 17 #if defined(OS_LINUX) | 18 #if defined(OS_LINUX) |
| 18 // OpenMAX IL stub is generated only on Linux. | 19 // OpenMAX IL stub is generated only on Linux. |
| 19 #include "third_party/openmax/il_stubs.h" | 20 #include "third_party/openmax/il_stubs.h" |
| 20 #endif | 21 #endif |
| 21 | 22 |
| 22 namespace tp_ffmpeg = third_party_ffmpeg; | 23 namespace tp_ffmpeg = third_party_ffmpeg; |
| 23 | 24 |
| 24 namespace media { | 25 namespace media { |
| 25 | 26 |
| 26 namespace { | 27 namespace { |
| 27 | 28 |
| 28 // Handy to prevent shooting ourselves in the foot with macro wizardry. | 29 // Handy to prevent shooting ourselves in the foot with macro wizardry. |
| 29 #if !defined(LIBAVCODEC_VERSION_MAJOR) || \ | 30 #if !defined(LIBAVCODEC_VERSION_MAJOR) || \ |
| 30 !defined(LIBAVFORMAT_VERSION_MAJOR) || \ | 31 !defined(LIBAVFORMAT_VERSION_MAJOR) || \ |
| 31 !defined(LIBAVUTIL_VERSION_MAJOR) | 32 !defined(LIBAVUTIL_VERSION_MAJOR) |
| 32 #error FFmpeg headers not included! | 33 #error FFmpeg headers not included! |
| 33 #endif | 34 #endif |
| 34 | 35 |
| 35 #define STRINGIZE(x) #x | 36 #define AVCODEC_VERSION STRINGIZE(LIBAVCODEC_VERSION_MAJOR) |
| 36 #define STRINGIZE_MACRO(x) STRINGIZE(x) | 37 #define AVFORMAT_VERSION STRINGIZE(LIBAVFORMAT_VERSION_MAJOR) |
| 37 | 38 #define AVUTIL_VERSION STRINGIZE(LIBAVUTIL_VERSION_MAJOR) |
| 38 #define AVCODEC_VERSION STRINGIZE_MACRO(LIBAVCODEC_VERSION_MAJOR) | |
| 39 #define AVFORMAT_VERSION STRINGIZE_MACRO(LIBAVFORMAT_VERSION_MAJOR) | |
| 40 #define AVUTIL_VERSION STRINGIZE_MACRO(LIBAVUTIL_VERSION_MAJOR) | |
| 41 | 39 |
| 42 #if defined(OS_MACOSX) | 40 #if defined(OS_MACOSX) |
| 43 #define DSO_NAME(MODULE, VERSION) ("lib" MODULE "." VERSION ".dylib") | 41 #define DSO_NAME(MODULE, VERSION) ("lib" MODULE "." VERSION ".dylib") |
| 44 const FilePath::CharType sumo_name[] = | 42 const FilePath::CharType sumo_name[] = |
| 45 FILE_PATH_LITERAL("libffmpegsumo.dylib"); | 43 FILE_PATH_LITERAL("libffmpegsumo.dylib"); |
| 46 #elif defined(OS_POSIX) | 44 #elif defined(OS_POSIX) |
| 47 #define DSO_NAME(MODULE, VERSION) ("lib" MODULE ".so." VERSION) | 45 #define DSO_NAME(MODULE, VERSION) ("lib" MODULE ".so." VERSION) |
| 48 const FilePath::CharType sumo_name[] = FILE_PATH_LITERAL("libffmpegsumo.so"); | 46 const FilePath::CharType sumo_name[] = FILE_PATH_LITERAL("libffmpegsumo.so"); |
| 49 #else | 47 #else |
| 50 #error "Do not know how to construct DSO name for this OS." | 48 #error "Do not know how to construct DSO name for this OS." |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 134 |
| 137 void* GetVp8CxAlgoAddress() { | 135 void* GetVp8CxAlgoAddress() { |
| 138 return vp8_cx_algo_address; | 136 return vp8_cx_algo_address; |
| 139 } | 137 } |
| 140 | 138 |
| 141 void* GetVp8DxAlgoAddress() { | 139 void* GetVp8DxAlgoAddress() { |
| 142 return vp8_dx_algo_address; | 140 return vp8_dx_algo_address; |
| 143 } | 141 } |
| 144 | 142 |
| 145 } // namespace media | 143 } // namespace media |
| OLD | NEW |