| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 template <DemuxerStream::Type StreamType> | 677 template <DemuxerStream::Type StreamType> |
| 678 void DecoderStream<StreamType>::ReinitializeDecoder() { | 678 void DecoderStream<StreamType>::ReinitializeDecoder() { |
| 679 FUNCTION_DVLOG(2); | 679 FUNCTION_DVLOG(2); |
| 680 DCHECK(task_runner_->BelongsToCurrentThread()); | 680 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 681 DCHECK_EQ(state_, STATE_FLUSHING_DECODER); | 681 DCHECK_EQ(state_, STATE_FLUSHING_DECODER); |
| 682 DCHECK_EQ(pending_decode_requests_, 0); | 682 DCHECK_EQ(pending_decode_requests_, 0); |
| 683 | 683 |
| 684 state_ = STATE_REINITIALIZING_DECODER; | 684 state_ = STATE_REINITIALIZING_DECODER; |
| 685 // Decoders should not need a new CDM during reinitialization. | 685 // Decoders should not need a new CDM during reinitialization. |
| 686 traits_.InitializeDecoder( | 686 traits_.InitializeDecoder( |
| 687 decoder_.get(), stream_, cdm_context_, | 687 decoder_.get(), StreamTraits::GetDecoderConfig(stream_), |
| 688 stream_->liveness() == DemuxerStream::LIVENESS_LIVE, cdm_context_, |
| 688 base::Bind(&DecoderStream<StreamType>::OnDecoderReinitialized, | 689 base::Bind(&DecoderStream<StreamType>::OnDecoderReinitialized, |
| 689 weak_factory_.GetWeakPtr()), | 690 weak_factory_.GetWeakPtr()), |
| 690 base::Bind(&DecoderStream<StreamType>::OnDecodeOutputReady, | 691 base::Bind(&DecoderStream<StreamType>::OnDecodeOutputReady, |
| 691 fallback_weak_factory_.GetWeakPtr())); | 692 fallback_weak_factory_.GetWeakPtr())); |
| 692 } | 693 } |
| 693 | 694 |
| 694 template <DemuxerStream::Type StreamType> | 695 template <DemuxerStream::Type StreamType> |
| 695 void DecoderStream<StreamType>::OnDecoderReinitialized(bool success) { | 696 void DecoderStream<StreamType>::OnDecoderReinitialized(bool success) { |
| 696 FUNCTION_DVLOG(2); | 697 FUNCTION_DVLOG(2); |
| 697 DCHECK(task_runner_->BelongsToCurrentThread()); | 698 DCHECK(task_runner_->BelongsToCurrentThread()); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 } | 774 } |
| 774 | 775 |
| 775 // The resetting process will be continued in OnDecoderReinitialized(). | 776 // The resetting process will be continued in OnDecoderReinitialized(). |
| 776 ReinitializeDecoder(); | 777 ReinitializeDecoder(); |
| 777 } | 778 } |
| 778 | 779 |
| 779 template class DecoderStream<DemuxerStream::VIDEO>; | 780 template class DecoderStream<DemuxerStream::VIDEO>; |
| 780 template class DecoderStream<DemuxerStream::AUDIO>; | 781 template class DecoderStream<DemuxerStream::AUDIO>; |
| 781 | 782 |
| 782 } // namespace media | 783 } // namespace media |
| OLD | NEW |