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