| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 // Add the more specific FFmpeg library name. | 86 // Add the more specific FFmpeg library name. |
| 87 FilePath path = module_dir.Append(GetDSOName(module)); | 87 FilePath path = module_dir.Append(GetDSOName(module)); |
| 88 paths[module].push_back(path.value()); | 88 paths[module].push_back(path.value()); |
| 89 } | 89 } |
| 90 | 90 |
| 91 g_media_library_is_initialized = tp_ffmpeg::InitializeStubs(paths); | 91 g_media_library_is_initialized = tp_ffmpeg::InitializeStubs(paths); |
| 92 return g_media_library_is_initialized; | 92 return g_media_library_is_initialized; |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool InitializeMediaLibraryForTesting() { |
| 96 FilePath file_path; |
| 97 if (!PathService::Get(base::DIR_SOURCE_ROOT, &file_path)) |
| 98 return false; |
| 99 return InitializeMediaLibrary(file_path); |
| 100 } |
| 101 |
| 95 bool IsMediaLibraryInitialized() { | 102 bool IsMediaLibraryInitialized() { |
| 96 return g_media_library_is_initialized; | 103 return g_media_library_is_initialized; |
| 97 } | 104 } |
| 98 | 105 |
| 99 #if defined(OS_LINUX) | 106 #if defined(OS_LINUX) |
| 100 namespace tp_openmax = third_party_openmax; | 107 namespace tp_openmax = third_party_openmax; |
| 101 bool InitializeOpenMaxLibrary(const FilePath& module_dir) { | 108 bool InitializeOpenMaxLibrary(const FilePath& module_dir) { |
| 102 // TODO(ajwong): We need error resolution. | 109 // TODO(ajwong): We need error resolution. |
| 103 tp_openmax::StubPathMap paths; | 110 tp_openmax::StubPathMap paths; |
| 104 for (int i = 0; i < static_cast<int>(tp_openmax::kNumStubModules); ++i) { | 111 for (int i = 0; i < static_cast<int>(tp_openmax::kNumStubModules); ++i) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 116 return result; | 123 return result; |
| 117 } | 124 } |
| 118 #else | 125 #else |
| 119 bool InitializeOpenMaxLibrary(const FilePath& module_dir) { | 126 bool InitializeOpenMaxLibrary(const FilePath& module_dir) { |
| 120 NOTIMPLEMENTED() << "OpenMAX is only used in Linux."; | 127 NOTIMPLEMENTED() << "OpenMAX is only used in Linux."; |
| 121 return false; | 128 return false; |
| 122 } | 129 } |
| 123 #endif | 130 #endif |
| 124 | 131 |
| 125 } // namespace media | 132 } // namespace media |
| OLD | NEW |