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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |