OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/string_util.h" | 5 #include "base/string_util.h" |
6 #include "media/base/filters.h" | 6 #include "media/base/filters.h" |
7 #include "media/ffmpeg/ffmpeg_common.h" | 7 #include "media/ffmpeg/ffmpeg_common.h" |
8 #include "media/filters/ffmpeg_glue.h" | 8 #include "media/filters/ffmpeg_glue.h" |
9 | 9 |
10 namespace { | 10 namespace { |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 &SeekContext, | 127 &SeekContext, |
128 &CloseContext, | 128 &CloseContext, |
129 }; | 129 }; |
130 | 130 |
131 FFmpegGlue::FFmpegGlue() { | 131 FFmpegGlue::FFmpegGlue() { |
132 // Before doing anything disable logging as it interferes with layout tests. | 132 // Before doing anything disable logging as it interferes with layout tests. |
133 av_log_set_level(AV_LOG_QUIET); | 133 av_log_set_level(AV_LOG_QUIET); |
134 | 134 |
135 // Register our protocol glue code with FFmpeg. | 135 // Register our protocol glue code with FFmpeg. |
136 avcodec_init(); | 136 avcodec_init(); |
137 av_register_protocol(&kFFmpegURLProtocol); | 137 av_register_protocol2(&kFFmpegURLProtocol, sizeof(kFFmpegURLProtocol)); |
138 av_lockmgr_register(&LockManagerOperation); | 138 av_lockmgr_register(&LockManagerOperation); |
139 | 139 |
140 // Now register the rest of FFmpeg. | 140 // Now register the rest of FFmpeg. |
141 av_register_all(); | 141 av_register_all(); |
142 } | 142 } |
143 | 143 |
144 FFmpegGlue::~FFmpegGlue() { | 144 FFmpegGlue::~FFmpegGlue() { |
145 av_lockmgr_register(NULL); | 145 av_lockmgr_register(NULL); |
146 } | 146 } |
147 | 147 |
(...skipping 30 matching lines...) Expand all Loading... |
178 } | 178 } |
179 | 179 |
180 std::string FFmpegGlue::GetProtocolKey(FFmpegURLProtocol* protocol) { | 180 std::string FFmpegGlue::GetProtocolKey(FFmpegURLProtocol* protocol) { |
181 // Use the FFmpegURLProtocol's memory address to generate the unique string. | 181 // Use the FFmpegURLProtocol's memory address to generate the unique string. |
182 // This also has the nice property that adding the same FFmpegURLProtocol | 182 // This also has the nice property that adding the same FFmpegURLProtocol |
183 // reference will not generate duplicate entries. | 183 // reference will not generate duplicate entries. |
184 return StringPrintf("%s://%p", kProtocol, static_cast<void*>(protocol)); | 184 return StringPrintf("%s://%p", kProtocol, static_cast<void*>(protocol)); |
185 } | 185 } |
186 | 186 |
187 } // namespace media | 187 } // namespace media |
OLD | NEW |