| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/opus_audio_decoder.h" | 5 #include "media/filters/opus_audio_decoder.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/sys_byteorder.h" | 10 #include "base/sys_byteorder.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 126 OpusAudioDecoder::OpusAudioDecoder( | 126 OpusAudioDecoder::OpusAudioDecoder( |
| 127 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) | 127 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) |
| 128 : task_runner_(task_runner), opus_decoder_(nullptr) {} | 128 : task_runner_(task_runner), opus_decoder_(nullptr) {} |
| 129 | 129 |
| 130 std::string OpusAudioDecoder::GetDisplayName() const { | 130 std::string OpusAudioDecoder::GetDisplayName() const { |
| 131 return "OpusAudioDecoder"; | 131 return "OpusAudioDecoder"; |
| 132 } | 132 } |
| 133 | 133 |
| 134 void OpusAudioDecoder::Initialize(const AudioDecoderConfig& config, | 134 void OpusAudioDecoder::Initialize(const AudioDecoderConfig& config, |
| 135 const SetCdmReadyCB& /* set_cdm_ready_cb */, | |
| 136 const InitCB& init_cb, | 135 const InitCB& init_cb, |
| 137 const OutputCB& output_cb) { | 136 const OutputCB& output_cb) { |
| 138 DCHECK(task_runner_->BelongsToCurrentThread()); | 137 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 139 InitCB bound_init_cb = BindToCurrentLoop(init_cb); | 138 InitCB bound_init_cb = BindToCurrentLoop(init_cb); |
| 140 | 139 |
| 141 if (config.is_encrypted()) { | 140 if (config.is_encrypted()) { |
| 142 bound_init_cb.Run(false); | 141 bound_init_cb.Run(false); |
| 143 return; | 142 return; |
| 144 } | 143 } |
| 145 | 144 |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 output_buffer->get()->TrimEnd(trim_frames); | 352 output_buffer->get()->TrimEnd(trim_frames); |
| 354 | 353 |
| 355 // Handles discards and timestamping. Discard the buffer if more data needed. | 354 // Handles discards and timestamping. Discard the buffer if more data needed. |
| 356 if (!discard_helper_->ProcessBuffers(input, *output_buffer)) | 355 if (!discard_helper_->ProcessBuffers(input, *output_buffer)) |
| 357 *output_buffer = nullptr; | 356 *output_buffer = nullptr; |
| 358 | 357 |
| 359 return true; | 358 return true; |
| 360 } | 359 } |
| 361 | 360 |
| 362 } // namespace media | 361 } // namespace media |
| OLD | NEW |