| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 131 |
| 132 OpusAudioDecoder::OpusAudioDecoder( | 132 OpusAudioDecoder::OpusAudioDecoder( |
| 133 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) | 133 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) |
| 134 : task_runner_(task_runner), opus_decoder_(nullptr) {} | 134 : task_runner_(task_runner), opus_decoder_(nullptr) {} |
| 135 | 135 |
| 136 std::string OpusAudioDecoder::GetDisplayName() const { | 136 std::string OpusAudioDecoder::GetDisplayName() const { |
| 137 return "OpusAudioDecoder"; | 137 return "OpusAudioDecoder"; |
| 138 } | 138 } |
| 139 | 139 |
| 140 void OpusAudioDecoder::Initialize(const AudioDecoderConfig& config, | 140 void OpusAudioDecoder::Initialize(const AudioDecoderConfig& config, |
| 141 const SetCdmReadyCB& /* set_cdm_ready_cb */, | 141 CdmContext* /* cdm_context */, |
| 142 const InitCB& init_cb, | 142 const InitCB& init_cb, |
| 143 const OutputCB& output_cb) { | 143 const OutputCB& output_cb) { |
| 144 DCHECK(task_runner_->BelongsToCurrentThread()); | 144 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 145 InitCB bound_init_cb = BindToCurrentLoop(init_cb); | 145 InitCB bound_init_cb = BindToCurrentLoop(init_cb); |
| 146 | 146 |
| 147 if (config.is_encrypted()) { | 147 if (config.is_encrypted()) { |
| 148 bound_init_cb.Run(false); | 148 bound_init_cb.Run(false); |
| 149 return; | 149 return; |
| 150 } | 150 } |
| 151 | 151 |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 output_buffer->get()->TrimEnd(trim_frames); | 359 output_buffer->get()->TrimEnd(trim_frames); |
| 360 | 360 |
| 361 // Handles discards and timestamping. Discard the buffer if more data needed. | 361 // Handles discards and timestamping. Discard the buffer if more data needed. |
| 362 if (!discard_helper_->ProcessBuffers(input, *output_buffer)) | 362 if (!discard_helper_->ProcessBuffers(input, *output_buffer)) |
| 363 *output_buffer = nullptr; | 363 *output_buffer = nullptr; |
| 364 | 364 |
| 365 return true; | 365 return true; |
| 366 } | 366 } |
| 367 | 367 |
| 368 } // namespace media | 368 } // namespace media |
| OLD | NEW |