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 void InitializeMediaLibraryForTesting() { |
| 96 FilePath file_path; |
| 97 CHECK(PathService::Get(base::DIR_SOURCE_ROOT, &file_path)); |
| 98 CHECK(InitializeMediaLibrary(file_path)); |
| 99 } |
| 100 |
95 bool IsMediaLibraryInitialized() { | 101 bool IsMediaLibraryInitialized() { |
96 return g_media_library_is_initialized; | 102 return g_media_library_is_initialized; |
97 } | 103 } |
98 | 104 |
99 #if defined(OS_LINUX) | 105 #if defined(OS_LINUX) |
100 namespace tp_openmax = third_party_openmax; | 106 namespace tp_openmax = third_party_openmax; |
101 bool InitializeOpenMaxLibrary(const FilePath& module_dir) { | 107 bool InitializeOpenMaxLibrary(const FilePath& module_dir) { |
102 // TODO(ajwong): We need error resolution. | 108 // TODO(ajwong): We need error resolution. |
103 tp_openmax::StubPathMap paths; | 109 tp_openmax::StubPathMap paths; |
104 for (int i = 0; i < static_cast<int>(tp_openmax::kNumStubModules); ++i) { | 110 for (int i = 0; i < static_cast<int>(tp_openmax::kNumStubModules); ++i) { |
(...skipping 11 matching lines...) Expand all Loading... |
116 return result; | 122 return result; |
117 } | 123 } |
118 #else | 124 #else |
119 bool InitializeOpenMaxLibrary(const FilePath& module_dir) { | 125 bool InitializeOpenMaxLibrary(const FilePath& module_dir) { |
120 NOTIMPLEMENTED() << "OpenMAX is only used in Linux."; | 126 NOTIMPLEMENTED() << "OpenMAX is only used in Linux."; |
121 return false; | 127 return false; |
122 } | 128 } |
123 #endif | 129 #endif |
124 | 130 |
125 } // namespace media | 131 } // namespace media |
OLD | NEW |