| 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 stream_, cdm_context, | 230 stream_, cdm_context, |
| 231 base::Bind(&DecoderStream<StreamType>::OnDecoderSelected, | 231 base::Bind(&DecoderStream<StreamType>::OnDecoderSelected, |
| 232 weak_factory_.GetWeakPtr()), | 232 weak_factory_.GetWeakPtr()), |
| 233 base::Bind(&DecoderStream<StreamType>::OnDecodeOutputReady, | 233 base::Bind(&DecoderStream<StreamType>::OnDecodeOutputReady, |
| 234 weak_factory_.GetWeakPtr()), | 234 weak_factory_.GetWeakPtr()), |
| 235 waiting_for_decryption_key_cb_); | 235 waiting_for_decryption_key_cb_); |
| 236 } | 236 } |
| 237 | 237 |
| 238 template <DemuxerStream::Type StreamType> | 238 template <DemuxerStream::Type StreamType> |
| 239 void DecoderStream<StreamType>::OnDecoderSelected( | 239 void DecoderStream<StreamType>::OnDecoderSelected( |
| 240 scoped_ptr<Decoder> selected_decoder, | 240 std::unique_ptr<Decoder> selected_decoder, |
| 241 scoped_ptr<DecryptingDemuxerStream> decrypting_demuxer_stream) { | 241 std::unique_ptr<DecryptingDemuxerStream> decrypting_demuxer_stream) { |
| 242 FUNCTION_DVLOG(2) << ": " | 242 FUNCTION_DVLOG(2) << ": " |
| 243 << (selected_decoder ? selected_decoder->GetDisplayName() | 243 << (selected_decoder ? selected_decoder->GetDisplayName() |
| 244 : "No decoder selected."); | 244 : "No decoder selected."); |
| 245 DCHECK(task_runner_->BelongsToCurrentThread()); | 245 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 246 DCHECK(state_ == STATE_INITIALIZING || state_ == STATE_REINITIALIZING_DECODER) | 246 DCHECK(state_ == STATE_INITIALIZING || state_ == STATE_REINITIALIZING_DECODER) |
| 247 << state_; | 247 << state_; |
| 248 if (state_ == STATE_INITIALIZING) { | 248 if (state_ == STATE_INITIALIZING) { |
| 249 DCHECK(!init_cb_.is_null()); | 249 DCHECK(!init_cb_.is_null()); |
| 250 DCHECK(read_cb_.is_null()); | 250 DCHECK(read_cb_.is_null()); |
| 251 DCHECK(reset_cb_.is_null()); | 251 DCHECK(reset_cb_.is_null()); |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 } | 619 } |
| 620 | 620 |
| 621 // The resetting process will be continued in OnDecoderReinitialized(). | 621 // The resetting process will be continued in OnDecoderReinitialized(). |
| 622 ReinitializeDecoder(); | 622 ReinitializeDecoder(); |
| 623 } | 623 } |
| 624 | 624 |
| 625 template class DecoderStream<DemuxerStream::VIDEO>; | 625 template class DecoderStream<DemuxerStream::VIDEO>; |
| 626 template class DecoderStream<DemuxerStream::AUDIO>; | 626 template class DecoderStream<DemuxerStream::AUDIO>; |
| 627 | 627 |
| 628 } // namespace media | 628 } // namespace media |
| OLD | NEW |