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

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

Issue 208263018: Add SupportsConfigChanges() to DemuxerStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@audioconverterchunk
Patch Set: Remove DCHECK Created 6 years, 9 months 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 | « media/filters/chunk_demuxer.cc ('k') | media/filters/decrypting_demuxer_stream.h » ('j') | 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 DCHECK(task_runner_->BelongsToCurrentThread()); 368 DCHECK(task_runner_->BelongsToCurrentThread());
369 DCHECK_EQ(state_, STATE_PENDING_DEMUXER_READ) << state_; 369 DCHECK_EQ(state_, STATE_PENDING_DEMUXER_READ) << state_;
370 DCHECK_EQ(buffer.get() != NULL, status == DemuxerStream::kOk) << status; 370 DCHECK_EQ(buffer.get() != NULL, status == DemuxerStream::kOk) << status;
371 DCHECK(!read_cb_.is_null()); 371 DCHECK(!read_cb_.is_null());
372 DCHECK(stop_cb_.is_null()); 372 DCHECK(stop_cb_.is_null());
373 373
374 state_ = STATE_NORMAL; 374 state_ = STATE_NORMAL;
375 375
376 if (status == DemuxerStream::kConfigChanged) { 376 if (status == DemuxerStream::kConfigChanged) {
377 FUNCTION_DVLOG(2) << ": " << "ConfigChanged"; 377 FUNCTION_DVLOG(2) << ": " << "ConfigChanged";
378 DCHECK(stream_->SupportsConfigChanges());
378 state_ = STATE_FLUSHING_DECODER; 379 state_ = STATE_FLUSHING_DECODER;
379 if (!reset_cb_.is_null()) { 380 if (!reset_cb_.is_null()) {
380 AbortRead(); 381 AbortRead();
381 // If we are using DecryptingDemuxerStream, we already called DDS::Reset() 382 // If we are using DecryptingDemuxerStream, we already called DDS::Reset()
382 // which will continue the resetting process in it's callback. 383 // which will continue the resetting process in it's callback.
383 if (!decrypting_demuxer_stream_) 384 if (!decrypting_demuxer_stream_)
384 Reset(base::ResetAndReturn(&reset_cb_)); 385 Reset(base::ResetAndReturn(&reset_cb_));
385 // Reinitialization will continue after Reset() is done. 386 // Reinitialization will continue after Reset() is done.
386 } else { 387 } else {
387 FlushDecoder(); 388 FlushDecoder();
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 stream_ = NULL; 518 stream_ = NULL;
518 decoder_.reset(); 519 decoder_.reset();
519 decrypting_demuxer_stream_.reset(); 520 decrypting_demuxer_stream_.reset();
520 base::ResetAndReturn(&stop_cb_).Run(); 521 base::ResetAndReturn(&stop_cb_).Run();
521 } 522 }
522 523
523 template class DecoderStream<DemuxerStream::VIDEO>; 524 template class DecoderStream<DemuxerStream::VIDEO>;
524 template class DecoderStream<DemuxerStream::AUDIO>; 525 template class DecoderStream<DemuxerStream::AUDIO>;
525 526
526 } // namespace media 527 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | media/filters/decrypting_demuxer_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698