| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/filters/ffmpeg_common.h" | 7 #include "media/filters/ffmpeg_common.h" |
| 8 #include "media/filters/ffmpeg_glue.h" | 8 #include "media/filters/ffmpeg_glue.h" |
| 9 | 9 |
| 10 namespace { | 10 namespace { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 &OpenContext, | 98 &OpenContext, |
| 99 &ReadContext, | 99 &ReadContext, |
| 100 &WriteContext, | 100 &WriteContext, |
| 101 &SeekContext, | 101 &SeekContext, |
| 102 &CloseContext, | 102 &CloseContext, |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 FFmpegGlue::FFmpegGlue() { | 105 FFmpegGlue::FFmpegGlue() { |
| 106 // Register our protocol glue code with FFmpeg. | 106 // Register our protocol glue code with FFmpeg. |
| 107 avcodec_init(); | 107 avcodec_init(); |
| 108 register_protocol(&kFFmpegProtocol); | 108 av_register_protocol(&kFFmpegProtocol); |
| 109 | 109 |
| 110 // Now register the rest of FFmpeg. | 110 // Now register the rest of FFmpeg. |
| 111 av_register_all(); | 111 av_register_all(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 FFmpegGlue::~FFmpegGlue() { | 114 FFmpegGlue::~FFmpegGlue() { |
| 115 } | 115 } |
| 116 | 116 |
| 117 std::string FFmpegGlue::AddDataSource(DataSource* data_source) { | 117 std::string FFmpegGlue::AddDataSource(DataSource* data_source) { |
| 118 AutoLock auto_lock(lock_); | 118 AutoLock auto_lock(lock_); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 147 } | 147 } |
| 148 | 148 |
| 149 std::string FFmpegGlue::GetDataSourceKey(DataSource* data_source) { | 149 std::string FFmpegGlue::GetDataSourceKey(DataSource* data_source) { |
| 150 // Use the DataSource's memory address to generate the unique string. This | 150 // Use the DataSource's memory address to generate the unique string. This |
| 151 // also has the nice property that adding the same DataSource reference will | 151 // also has the nice property that adding the same DataSource reference will |
| 152 // not generate duplicate entries. | 152 // not generate duplicate entries. |
| 153 return StringPrintf("%s://0x%lx", kProtocol, static_cast<void*>(data_source)); | 153 return StringPrintf("%s://0x%lx", kProtocol, static_cast<void*>(data_source)); |
| 154 } | 154 } |
| 155 | 155 |
| 156 } // namespace media | 156 } // namespace media |
| OLD | NEW |