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_audio_decoder.h" | 5 #include "media/filters/ffmpeg_audio_decoder.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
9 #include "media/base/audio_buffer.h" | 9 #include "media/base/audio_buffer.h" |
10 #include "media/base/audio_bus.h" | 10 #include "media/base/audio_bus.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 136 |
137 FFmpegAudioDecoder::~FFmpegAudioDecoder() { | 137 FFmpegAudioDecoder::~FFmpegAudioDecoder() { |
138 DCHECK(task_runner_->BelongsToCurrentThread()); | 138 DCHECK(task_runner_->BelongsToCurrentThread()); |
139 | 139 |
140 if (state_ != kUninitialized) { | 140 if (state_ != kUninitialized) { |
141 ReleaseFFmpegResources(); | 141 ReleaseFFmpegResources(); |
142 ResetTimestampState(); | 142 ResetTimestampState(); |
143 } | 143 } |
144 } | 144 } |
145 | 145 |
| 146 std::string FFmpegAudioDecoder::GetDisplayName() const { |
| 147 return "FFmpegAudioDecoder"; |
| 148 } |
| 149 |
146 void FFmpegAudioDecoder::Initialize(const AudioDecoderConfig& config, | 150 void FFmpegAudioDecoder::Initialize(const AudioDecoderConfig& config, |
147 const PipelineStatusCB& status_cb, | 151 const PipelineStatusCB& status_cb, |
148 const OutputCB& output_cb) { | 152 const OutputCB& output_cb) { |
149 DCHECK(task_runner_->BelongsToCurrentThread()); | 153 DCHECK(task_runner_->BelongsToCurrentThread()); |
150 DCHECK(!config.is_encrypted()); | 154 DCHECK(!config.is_encrypted()); |
151 | 155 |
152 FFmpegGlue::InitializeFFmpeg(); | 156 FFmpegGlue::InitializeFFmpeg(); |
153 | 157 |
154 config_ = config; | 158 config_ = config; |
155 PipelineStatusCB initialize_cb = BindToCurrentLoop(status_cb); | 159 PipelineStatusCB initialize_cb = BindToCurrentLoop(status_cb); |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 | 388 |
385 ResetTimestampState(); | 389 ResetTimestampState(); |
386 return true; | 390 return true; |
387 } | 391 } |
388 | 392 |
389 void FFmpegAudioDecoder::ResetTimestampState() { | 393 void FFmpegAudioDecoder::ResetTimestampState() { |
390 discard_helper_->Reset(config_.codec_delay()); | 394 discard_helper_->Reset(config_.codec_delay()); |
391 } | 395 } |
392 | 396 |
393 } // namespace media | 397 } // namespace media |
OLD | NEW |