Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: media/filters/decoder_stream.cc

Issue 694153002: DecoderStream: Check that no pending decode when flush is finished. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698