| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 139 |
| 140 if (state_ != kUninitialized) | 140 if (state_ != kUninitialized) |
| 141 ReleaseFFmpegResources(); | 141 ReleaseFFmpegResources(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 std::string FFmpegAudioDecoder::GetDisplayName() const { | 144 std::string FFmpegAudioDecoder::GetDisplayName() const { |
| 145 return "FFmpegAudioDecoder"; | 145 return "FFmpegAudioDecoder"; |
| 146 } | 146 } |
| 147 | 147 |
| 148 void FFmpegAudioDecoder::Initialize(const AudioDecoderConfig& config, | 148 void FFmpegAudioDecoder::Initialize(const AudioDecoderConfig& config, |
| 149 const SetCdmReadyCB& /* set_cdm_ready_cb */, | |
| 150 const InitCB& init_cb, | 149 const InitCB& init_cb, |
| 151 const OutputCB& output_cb) { | 150 const OutputCB& output_cb) { |
| 152 DCHECK(task_runner_->BelongsToCurrentThread()); | 151 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 153 DCHECK(config.IsValidConfig()); | 152 DCHECK(config.IsValidConfig()); |
| 154 | 153 |
| 155 InitCB bound_init_cb = BindToCurrentLoop(init_cb); | 154 InitCB bound_init_cb = BindToCurrentLoop(init_cb); |
| 156 | 155 |
| 157 if (config.is_encrypted()) { | 156 if (config.is_encrypted()) { |
| 158 bound_init_cb.Run(false); | 157 bound_init_cb.Run(false); |
| 159 return; | 158 return; |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 return true; | 383 return true; |
| 385 } | 384 } |
| 386 | 385 |
| 387 void FFmpegAudioDecoder::ResetTimestampState() { | 386 void FFmpegAudioDecoder::ResetTimestampState() { |
| 388 discard_helper_.reset(new AudioDiscardHelper(config_.samples_per_second(), | 387 discard_helper_.reset(new AudioDiscardHelper(config_.samples_per_second(), |
| 389 config_.codec_delay())); | 388 config_.codec_delay())); |
| 390 discard_helper_->Reset(config_.codec_delay()); | 389 discard_helper_->Reset(config_.codec_delay()); |
| 391 } | 390 } |
| 392 | 391 |
| 393 } // namespace media | 392 } // namespace media |
| OLD | NEW |