| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 DCHECK_EQ(dropped_size % kBytesPerChannel, 0); | 544 DCHECK_EQ(dropped_size % kBytesPerChannel, 0); |
| 545 decoded_audio_data += dropped_size; | 545 decoded_audio_data += dropped_size; |
| 546 decoded_audio_size -= dropped_size; | 546 decoded_audio_size -= dropped_size; |
| 547 output_bytes_to_drop_ -= dropped_size; | 547 output_bytes_to_drop_ -= dropped_size; |
| 548 } | 548 } |
| 549 | 549 |
| 550 if (decoded_audio_size > 0) { | 550 if (decoded_audio_size > 0) { |
| 551 // Copy the audio samples into an output buffer. | 551 // Copy the audio samples into an output buffer. |
| 552 *output_buffer = DataBuffer::CopyFrom( | 552 *output_buffer = DataBuffer::CopyFrom( |
| 553 decoded_audio_data, decoded_audio_size); | 553 decoded_audio_data, decoded_audio_size); |
| 554 (*output_buffer)->SetTimestamp(output_timestamp_helper_->GetTimestamp()); | 554 (*output_buffer)->set_timestamp(output_timestamp_helper_->GetTimestamp()); |
| 555 (*output_buffer)->SetDuration( | 555 (*output_buffer)->set_duration( |
| 556 output_timestamp_helper_->GetDuration(decoded_audio_size)); | 556 output_timestamp_helper_->GetDuration(decoded_audio_size)); |
| 557 output_timestamp_helper_->AddBytes(decoded_audio_size); | 557 output_timestamp_helper_->AddBytes(decoded_audio_size); |
| 558 } | 558 } |
| 559 | 559 |
| 560 // Decoding finished successfully, update statistics. | 560 // Decoding finished successfully, update statistics. |
| 561 PipelineStatistics statistics; | 561 PipelineStatistics statistics; |
| 562 statistics.audio_bytes_decoded = decoded_audio_size; | 562 statistics.audio_bytes_decoded = decoded_audio_size; |
| 563 statistics_cb_.Run(statistics); | 563 statistics_cb_.Run(statistics); |
| 564 | 564 |
| 565 return true; | 565 return true; |
| 566 } | 566 } |
| 567 | 567 |
| 568 } // namespace media | 568 } // namespace media |
| OLD | NEW |