| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // (in OnBufferReady()). | 198 // (in OnBufferReady()). |
| 199 if (pending_demuxer_read_) | 199 if (pending_demuxer_read_) |
| 200 return; | 200 return; |
| 201 | 201 |
| 202 ResetDecoder(); | 202 ResetDecoder(); |
| 203 } | 203 } |
| 204 | 204 |
| 205 template <DemuxerStream::Type StreamType> | 205 template <DemuxerStream::Type StreamType> |
| 206 bool DecoderStream<StreamType>::CanReadWithoutStalling() const { | 206 bool DecoderStream<StreamType>::CanReadWithoutStalling() const { |
| 207 DCHECK(task_runner_->BelongsToCurrentThread()); | 207 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 208 return !ready_outputs_.empty() || decoder_->CanReadWithoutStalling(); | 208 return !ready_outputs_.empty() || |
| 209 (decoder_ && decoder_->CanReadWithoutStalling()); |
| 209 } | 210 } |
| 210 | 211 |
| 211 template <> | 212 template <> |
| 212 bool DecoderStream<DemuxerStream::AUDIO>::CanReadWithoutStalling() const { | 213 bool DecoderStream<DemuxerStream::AUDIO>::CanReadWithoutStalling() const { |
| 213 DCHECK(task_runner_->BelongsToCurrentThread()); | 214 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 214 return true; | 215 return true; |
| 215 } | 216 } |
| 216 | 217 |
| 217 template <DemuxerStream::Type StreamType> | 218 template <DemuxerStream::Type StreamType> |
| 218 int DecoderStream<StreamType>::GetMaxDecodeRequests() const { | 219 int DecoderStream<StreamType>::GetMaxDecodeRequests() const { |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 } | 775 } |
| 775 | 776 |
| 776 // The resetting process will be continued in OnDecoderReinitialized(). | 777 // The resetting process will be continued in OnDecoderReinitialized(). |
| 777 ReinitializeDecoder(); | 778 ReinitializeDecoder(); |
| 778 } | 779 } |
| 779 | 780 |
| 780 template class DecoderStream<DemuxerStream::VIDEO>; | 781 template class DecoderStream<DemuxerStream::VIDEO>; |
| 781 template class DecoderStream<DemuxerStream::AUDIO>; | 782 template class DecoderStream<DemuxerStream::AUDIO>; |
| 782 | 783 |
| 783 } // namespace media | 784 } // namespace media |
| OLD | NEW |