Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Side by Side Diff: media/base/media_posix.cc

Issue 7658017: Revert 96974 - Remove mock_ffmpeg and update media unittests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/base/media.h ('k') | media/base/media_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/base/media.h ('k') | media/base/media_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698