| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/decoder_stream.h" | 5 #include "media/filters/decoder_stream.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 return; | 441 return; |
| 442 | 442 |
| 443 case DecodeStatus::ABORTED: | 443 case DecodeStatus::ABORTED: |
| 444 // Decoder can return DecodeStatus::ABORTED during Reset() or during | 444 // Decoder can return DecodeStatus::ABORTED during Reset() or during |
| 445 // destruction. | 445 // destruction. |
| 446 return; | 446 return; |
| 447 | 447 |
| 448 case DecodeStatus::OK: | 448 case DecodeStatus::OK: |
| 449 // Any successful decode counts! | 449 // Any successful decode counts! |
| 450 if (buffer_size > 0) | 450 if (buffer_size > 0) |
| 451 StreamTraits::ReportStatistics(statistics_cb_, buffer_size); | 451 statistics_cb_.Run(buffer_size); |
| 452 | 452 |
| 453 if (state_ == STATE_NORMAL) { | 453 if (state_ == STATE_NORMAL) { |
| 454 if (end_of_stream) { | 454 if (end_of_stream) { |
| 455 state_ = STATE_END_OF_STREAM; | 455 state_ = STATE_END_OF_STREAM; |
| 456 if (ready_outputs_.empty() && !read_cb_.is_null()) | 456 if (ready_outputs_.empty() && !read_cb_.is_null()) |
| 457 SatisfyRead(OK, StreamTraits::CreateEOSOutput()); | 457 SatisfyRead(OK, StreamTraits::CreateEOSOutput()); |
| 458 return; | 458 return; |
| 459 } | 459 } |
| 460 | 460 |
| 461 if (CanDecodeMore()) | 461 if (CanDecodeMore()) |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 } | 781 } |
| 782 | 782 |
| 783 // The resetting process will be continued in OnDecoderReinitialized(). | 783 // The resetting process will be continued in OnDecoderReinitialized(). |
| 784 ReinitializeDecoder(); | 784 ReinitializeDecoder(); |
| 785 } | 785 } |
| 786 | 786 |
| 787 template class DecoderStream<DemuxerStream::VIDEO>; | 787 template class DecoderStream<DemuxerStream::VIDEO>; |
| 788 template class DecoderStream<DemuxerStream::AUDIO>; | 788 template class DecoderStream<DemuxerStream::AUDIO>; |
| 789 | 789 |
| 790 } // namespace media | 790 } // namespace media |
| OLD | NEW |