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

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

Issue 177333003: Add support for midstream audio configuration changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ABS
Patch Set: disable fifo, add <cmath> to fix compile error 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/decoder_stream.h ('k') | media/filters/decrypting_audio_decoder.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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 DCHECK(stream_->SupportsConfigChanges());
379
380 if (!config_change_observer_cb_.is_null())
381 config_change_observer_cb_.Run();
382
379 state_ = STATE_FLUSHING_DECODER; 383 state_ = STATE_FLUSHING_DECODER;
380 if (!reset_cb_.is_null()) { 384 if (!reset_cb_.is_null()) {
381 AbortRead(); 385 AbortRead();
382 // If we are using DecryptingDemuxerStream, we already called DDS::Reset() 386 // If we are using DecryptingDemuxerStream, we already called DDS::Reset()
383 // which will continue the resetting process in it's callback. 387 // which will continue the resetting process in it's callback.
384 if (!decrypting_demuxer_stream_) 388 if (!decrypting_demuxer_stream_)
385 Reset(base::ResetAndReturn(&reset_cb_)); 389 Reset(base::ResetAndReturn(&reset_cb_));
386 // Reinitialization will continue after Reset() is done. 390 // Reinitialization will continue after Reset() is done.
387 } else { 391 } else {
388 FlushDecoder(); 392 FlushDecoder();
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 stream_ = NULL; 522 stream_ = NULL;
519 decoder_.reset(); 523 decoder_.reset();
520 decrypting_demuxer_stream_.reset(); 524 decrypting_demuxer_stream_.reset();
521 base::ResetAndReturn(&stop_cb_).Run(); 525 base::ResetAndReturn(&stop_cb_).Run();
522 } 526 }
523 527
524 template class DecoderStream<DemuxerStream::VIDEO>; 528 template class DecoderStream<DemuxerStream::VIDEO>;
525 template class DecoderStream<DemuxerStream::AUDIO>; 529 template class DecoderStream<DemuxerStream::AUDIO>;
526 530
527 } // namespace media 531 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/decoder_stream.h ('k') | media/filters/decrypting_audio_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698