OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_video_decoder.h" | 5 #include "media/filters/ffmpeg_video_decoder.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 ReleaseVideoBufferImpl, | 152 ReleaseVideoBufferImpl, |
153 opaque, | 153 opaque, |
154 0); | 154 0); |
155 return 0; | 155 return 0; |
156 } | 156 } |
157 | 157 |
158 std::string FFmpegVideoDecoder::GetDisplayName() const { | 158 std::string FFmpegVideoDecoder::GetDisplayName() const { |
159 return "FFmpegVideoDecoder"; | 159 return "FFmpegVideoDecoder"; |
160 } | 160 } |
161 | 161 |
162 void FFmpegVideoDecoder::Initialize(const VideoDecoderConfig& config, | 162 void FFmpegVideoDecoder::Initialize( |
163 bool low_delay, | 163 const VideoDecoderConfig& config, |
164 const PipelineStatusCB& status_cb, | 164 bool low_delay, |
165 const OutputCB& output_cb) { | 165 const PipelineStatusCB& status_cb, |
| 166 const OutputCB& output_cb, |
| 167 const base::Closure& /* waiting_for_encryption_key_cb */) { |
166 DCHECK(task_runner_->BelongsToCurrentThread()); | 168 DCHECK(task_runner_->BelongsToCurrentThread()); |
167 DCHECK(!config.is_encrypted()); | 169 DCHECK(!config.is_encrypted()); |
168 DCHECK(!output_cb.is_null()); | 170 DCHECK(!output_cb.is_null()); |
169 | 171 |
170 FFmpegGlue::InitializeFFmpeg(); | 172 FFmpegGlue::InitializeFFmpeg(); |
171 | 173 |
172 config_ = config; | 174 config_ = config; |
173 PipelineStatusCB initialize_cb = BindToCurrentLoop(status_cb); | 175 PipelineStatusCB initialize_cb = BindToCurrentLoop(status_cb); |
174 | 176 |
175 if (!config.IsValidConfig() || !ConfigureDecoder(low_delay)) { | 177 if (!config.IsValidConfig() || !ConfigureDecoder(low_delay)) { |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) { | 355 if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) { |
354 ReleaseFFmpegResources(); | 356 ReleaseFFmpegResources(); |
355 return false; | 357 return false; |
356 } | 358 } |
357 | 359 |
358 av_frame_.reset(av_frame_alloc()); | 360 av_frame_.reset(av_frame_alloc()); |
359 return true; | 361 return true; |
360 } | 362 } |
361 | 363 |
362 } // namespace media | 364 } // namespace media |
OLD | NEW |