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

Side by Side Diff: media/filters/ffmpeg_glue.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/filters/ffmpeg_glue.h ('k') | media/filters/ffmpeg_glue_unittest.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/filters/ffmpeg_glue.h" 5 #include "media/filters/ffmpeg_glue.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "media/base/filters.h" 9 #include "media/base/filters.h"
10 #include "media/ffmpeg/ffmpeg_common.h" 10 #include "media/ffmpeg/ffmpeg_common.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 FFmpegGlue::~FFmpegGlue() { 140 FFmpegGlue::~FFmpegGlue() {
141 av_lockmgr_register(NULL); 141 av_lockmgr_register(NULL);
142 } 142 }
143 143
144 // static 144 // static
145 FFmpegGlue* FFmpegGlue::GetInstance() { 145 FFmpegGlue* FFmpegGlue::GetInstance() {
146 return Singleton<FFmpegGlue>::get(); 146 return Singleton<FFmpegGlue>::get();
147 } 147 }
148 148
149 // static
150 URLProtocol* FFmpegGlue::url_protocol() {
151 return &kFFmpegURLProtocol;
152 }
153
154 std::string FFmpegGlue::AddProtocol(FFmpegURLProtocol* protocol) { 149 std::string FFmpegGlue::AddProtocol(FFmpegURLProtocol* protocol) {
155 base::AutoLock auto_lock(lock_); 150 base::AutoLock auto_lock(lock_);
156 std::string key = GetProtocolKey(protocol); 151 std::string key = GetProtocolKey(protocol);
157 if (protocols_.find(key) == protocols_.end()) { 152 if (protocols_.find(key) == protocols_.end()) {
158 protocols_[key] = protocol; 153 protocols_[key] = protocol;
159 } 154 }
160 return key; 155 return key;
161 } 156 }
162 157
163 void FFmpegGlue::RemoveProtocol(FFmpegURLProtocol* protocol) { 158 void FFmpegGlue::RemoveProtocol(FFmpegURLProtocol* protocol) {
(...skipping 20 matching lines...) Expand all
184 } 179 }
185 180
186 std::string FFmpegGlue::GetProtocolKey(FFmpegURLProtocol* protocol) { 181 std::string FFmpegGlue::GetProtocolKey(FFmpegURLProtocol* protocol) {
187 // Use the FFmpegURLProtocol's memory address to generate the unique string. 182 // Use the FFmpegURLProtocol's memory address to generate the unique string.
188 // This also has the nice property that adding the same FFmpegURLProtocol 183 // This also has the nice property that adding the same FFmpegURLProtocol
189 // reference will not generate duplicate entries. 184 // reference will not generate duplicate entries.
190 return base::StringPrintf("%s://%p", kProtocol, static_cast<void*>(protocol)); 185 return base::StringPrintf("%s://%p", kProtocol, static_cast<void*>(protocol));
191 } 186 }
192 187
193 } // namespace media 188 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/ffmpeg_glue.h ('k') | media/filters/ffmpeg_glue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698