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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 FUNCTION_DVLOG(2) << ": " << status; | 295 FUNCTION_DVLOG(2) << ": " << status; |
296 DCHECK(state_ == STATE_NORMAL || state_ == STATE_FLUSHING_DECODER || | 296 DCHECK(state_ == STATE_NORMAL || state_ == STATE_FLUSHING_DECODER || |
297 state_ == STATE_PENDING_DEMUXER_READ || state_ == STATE_ERROR) | 297 state_ == STATE_PENDING_DEMUXER_READ || state_ == STATE_ERROR) |
298 << state_; | 298 << state_; |
299 DCHECK_GT(pending_decode_requests_, 0); | 299 DCHECK_GT(pending_decode_requests_, 0); |
300 | 300 |
301 --pending_decode_requests_; | 301 --pending_decode_requests_; |
302 | 302 |
303 TRACE_EVENT_ASYNC_END0("media", GetTraceString<StreamType>(), this); | 303 TRACE_EVENT_ASYNC_END0("media", GetTraceString<StreamType>(), this); |
304 | 304 |
305 if (end_of_stream) | 305 if (end_of_stream) { |
| 306 DCHECK(!pending_decode_requests_); |
306 decoding_eos_ = false; | 307 decoding_eos_ = false; |
| 308 } |
307 | 309 |
308 if (state_ == STATE_ERROR) { | 310 if (state_ == STATE_ERROR) { |
309 DCHECK(read_cb_.is_null()); | 311 DCHECK(read_cb_.is_null()); |
310 return; | 312 return; |
311 } | 313 } |
312 | 314 |
313 // Drop decoding result if Reset() was called during decoding. | 315 // Drop decoding result if Reset() was called during decoding. |
314 // The resetting process will be handled when the decoder is reset. | 316 // The resetting process will be handled when the decoder is reset. |
315 if (!reset_cb_.is_null()) | 317 if (!reset_cb_.is_null()) |
316 return; | 318 return; |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 } | 553 } |
552 | 554 |
553 // The resetting process will be continued in OnDecoderReinitialized(). | 555 // The resetting process will be continued in OnDecoderReinitialized(). |
554 ReinitializeDecoder(); | 556 ReinitializeDecoder(); |
555 } | 557 } |
556 | 558 |
557 template class DecoderStream<DemuxerStream::VIDEO>; | 559 template class DecoderStream<DemuxerStream::VIDEO>; |
558 template class DecoderStream<DemuxerStream::AUDIO>; | 560 template class DecoderStream<DemuxerStream::AUDIO>; |
559 | 561 |
560 } // namespace media | 562 } // namespace media |
OLD | NEW |