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

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: Make comment not specific to video_decoder_config(). 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
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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 DVLOG(2) << __FUNCTION__; 363 DVLOG(2) << __FUNCTION__;
364 DCHECK(task_runner_->BelongsToCurrentThread()); 364 DCHECK(task_runner_->BelongsToCurrentThread());
365 DCHECK_EQ(state_, STATE_PENDING_DEMUXER_READ) << state_; 365 DCHECK_EQ(state_, STATE_PENDING_DEMUXER_READ) << state_;
366 DCHECK_EQ(buffer.get() != NULL, status == DemuxerStream::kOk) << status; 366 DCHECK_EQ(buffer.get() != NULL, status == DemuxerStream::kOk) << status;
367 DCHECK(!read_cb_.is_null()); 367 DCHECK(!read_cb_.is_null());
368 DCHECK(stop_cb_.is_null()); 368 DCHECK(stop_cb_.is_null());
369 369
370 state_ = STATE_NORMAL; 370 state_ = STATE_NORMAL;
371 371
372 if (status == DemuxerStream::kConfigChanged) { 372 if (status == DemuxerStream::kConfigChanged) {
373 DCHECK(stream_->SupportsConfigChanges());
scherkus (not reviewing) 2014/03/25 22:16:47 \o/
373 state_ = STATE_FLUSHING_DECODER; 374 state_ = STATE_FLUSHING_DECODER;
374 if (!reset_cb_.is_null()) { 375 if (!reset_cb_.is_null()) {
375 AbortRead(); 376 AbortRead();
376 // If we are using DecryptingDemuxerStream, we already called DDS::Reset() 377 // If we are using DecryptingDemuxerStream, we already called DDS::Reset()
377 // which will continue the resetting process in it's callback. 378 // which will continue the resetting process in it's callback.
378 if (!decrypting_demuxer_stream_) 379 if (!decrypting_demuxer_stream_)
379 Reset(base::ResetAndReturn(&reset_cb_)); 380 Reset(base::ResetAndReturn(&reset_cb_));
380 // Reinitialization will continue after Reset() is done. 381 // Reinitialization will continue after Reset() is done.
381 } else { 382 } else {
382 FlushDecoder(); 383 FlushDecoder();
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 stream_ = NULL; 508 stream_ = NULL;
508 decoder_.reset(); 509 decoder_.reset();
509 decrypting_demuxer_stream_.reset(); 510 decrypting_demuxer_stream_.reset();
510 base::ResetAndReturn(&stop_cb_).Run(); 511 base::ResetAndReturn(&stop_cb_).Run();
511 } 512 }
512 513
513 template class DecoderStream<DemuxerStream::VIDEO>; 514 template class DecoderStream<DemuxerStream::VIDEO>;
514 template class DecoderStream<DemuxerStream::AUDIO>; 515 template class DecoderStream<DemuxerStream::AUDIO>;
515 516
516 } // namespace media 517 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698