| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 const scoped_refptr<MediaLog>& media_log) | 129 const scoped_refptr<MediaLog>& media_log) |
| 130 : task_runner_(task_runner), | 130 : task_runner_(task_runner), |
| 131 state_(kUninitialized), | 131 state_(kUninitialized), |
| 132 av_sample_format_(0), | 132 av_sample_format_(0), |
| 133 media_log_(media_log) { | 133 media_log_(media_log) { |
| 134 } | 134 } |
| 135 | 135 |
| 136 FFmpegAudioDecoder::~FFmpegAudioDecoder() { | 136 FFmpegAudioDecoder::~FFmpegAudioDecoder() { |
| 137 DCHECK(task_runner_->BelongsToCurrentThread()); | 137 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 138 | 138 |
| 139 if (state_ != kUninitialized) { | 139 if (state_ != kUninitialized) |
| 140 ReleaseFFmpegResources(); | 140 ReleaseFFmpegResources(); |
| 141 ResetTimestampState(); | |
| 142 } | |
| 143 } | 141 } |
| 144 | 142 |
| 145 std::string FFmpegAudioDecoder::GetDisplayName() const { | 143 std::string FFmpegAudioDecoder::GetDisplayName() const { |
| 146 return "FFmpegAudioDecoder"; | 144 return "FFmpegAudioDecoder"; |
| 147 } | 145 } |
| 148 | 146 |
| 149 void FFmpegAudioDecoder::Initialize(const AudioDecoderConfig& config, | 147 void FFmpegAudioDecoder::Initialize(const AudioDecoderConfig& config, |
| 150 const InitCB& init_cb, | 148 const InitCB& init_cb, |
| 151 const OutputCB& output_cb) { | 149 const OutputCB& output_cb) { |
| 152 DCHECK(task_runner_->BelongsToCurrentThread()); | 150 DCHECK(task_runner_->BelongsToCurrentThread()); |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 | 386 |
| 389 ResetTimestampState(); | 387 ResetTimestampState(); |
| 390 return true; | 388 return true; |
| 391 } | 389 } |
| 392 | 390 |
| 393 void FFmpegAudioDecoder::ResetTimestampState() { | 391 void FFmpegAudioDecoder::ResetTimestampState() { |
| 394 discard_helper_->Reset(config_.codec_delay()); | 392 discard_helper_->Reset(config_.codec_delay()); |
| 395 } | 393 } |
| 396 | 394 |
| 397 } // namespace media | 395 } // namespace media |
| OLD | NEW |