| 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/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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| 11 #include "base/location.h" | 11 #include "base/location.h" |
| 12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
| 13 #include "base/sys_byteorder.h" | 13 #include "base/sys_byteorder.h" |
| 14 #include "media/base/audio_buffer.h" | 14 #include "media/base/audio_buffer.h" |
| 15 #include "media/base/audio_decoder_config.h" | 15 #include "media/base/audio_decoder_config.h" |
| 16 #include "media/base/audio_timestamp_helper.h" | 16 #include "media/base/audio_timestamp_helper.h" |
| 17 #include "media/base/bind_to_loop.h" | 17 #include "media/base/bind_to_current_loop.h" |
| 18 #include "media/base/buffers.h" | 18 #include "media/base/buffers.h" |
| 19 #include "media/base/decoder_buffer.h" | 19 #include "media/base/decoder_buffer.h" |
| 20 #include "media/base/demuxer.h" | 20 #include "media/base/demuxer.h" |
| 21 #include "media/base/pipeline.h" | 21 #include "media/base/pipeline.h" |
| 22 #include "third_party/opus/src/include/opus.h" | 22 #include "third_party/opus/src/include/opus.h" |
| 23 #include "third_party/opus/src/include/opus_multistream.h" | 23 #include "third_party/opus/src/include/opus_multistream.h" |
| 24 | 24 |
| 25 namespace media { | 25 namespace media { |
| 26 | 26 |
| 27 static uint16 ReadLE16(const uint8* data, size_t data_size, int read_offset) { | 27 static uint16 ReadLE16(const uint8* data, size_t data_size, int read_offset) { |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 output_timestamp_helper_->AddFrames(frames_decoded); | 619 output_timestamp_helper_->AddFrames(frames_decoded); |
| 620 | 620 |
| 621 // Discard the buffer to indicate we need more data. | 621 // Discard the buffer to indicate we need more data. |
| 622 if (!frames_to_output) | 622 if (!frames_to_output) |
| 623 *output_buffer = NULL; | 623 *output_buffer = NULL; |
| 624 | 624 |
| 625 return true; | 625 return true; |
| 626 } | 626 } |
| 627 | 627 |
| 628 } // namespace media | 628 } // namespace media |
| OLD | NEW |