| 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_selector.h" | 5 #include "media/filters/decoder_selector.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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 166 |
| 167 decrypted_stream_->Initialize( | 167 decrypted_stream_->Initialize( |
| 168 input_stream_, cdm_context_, | 168 input_stream_, cdm_context_, |
| 169 base::Bind(&DecoderSelector<StreamType>::DecryptingDemuxerStreamInitDone, | 169 base::Bind(&DecoderSelector<StreamType>::DecryptingDemuxerStreamInitDone, |
| 170 weak_ptr_factory_.GetWeakPtr())); | 170 weak_ptr_factory_.GetWeakPtr())); |
| 171 } | 171 } |
| 172 | 172 |
| 173 template <DemuxerStream::Type StreamType> | 173 template <DemuxerStream::Type StreamType> |
| 174 void DecoderSelector<StreamType>::DecryptingDemuxerStreamInitDone( | 174 void DecoderSelector<StreamType>::DecryptingDemuxerStreamInitDone( |
| 175 PipelineStatus status) { | 175 PipelineStatus status) { |
| 176 DVLOG(2) << __func__; | 176 DVLOG(2) << __func__ |
| 177 << ": status=" << MediaLog::PipelineStatusToString(status); |
| 177 DCHECK(task_runner_->BelongsToCurrentThread()); | 178 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 178 | 179 |
| 179 // If DecryptingDemuxerStream initialization succeeded, we'll use it to do | 180 // If DecryptingDemuxerStream initialization succeeded, we'll use it to do |
| 180 // decryption and use a decoder to decode the clear stream. Otherwise, we'll | 181 // decryption and use a decoder to decode the clear stream. Otherwise, we'll |
| 181 // try to see whether any decoder can decrypt-and-decode the encrypted stream | 182 // try to see whether any decoder can decrypt-and-decode the encrypted stream |
| 182 // directly. So in both cases, we'll initialize the decoders. | 183 // directly. So in both cases, we'll initialize the decoders. |
| 183 | 184 |
| 184 if (status == PIPELINE_OK) { | 185 if (status == PIPELINE_OK) { |
| 185 input_stream_ = decrypted_stream_.get(); | 186 input_stream_ = decrypted_stream_.get(); |
| 186 DCHECK(!IsStreamEncrypted(input_stream_)); | 187 DCHECK(!IsStreamEncrypted(input_stream_)); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 | 244 |
| 244 // These forward declarations tell the compiler that we will use | 245 // These forward declarations tell the compiler that we will use |
| 245 // DecoderSelector with these arguments, allowing us to keep these definitions | 246 // DecoderSelector with these arguments, allowing us to keep these definitions |
| 246 // in our .cc without causing linker errors. This also means if anyone tries to | 247 // in our .cc without causing linker errors. This also means if anyone tries to |
| 247 // instantiate a DecoderSelector with anything but these two specializations | 248 // instantiate a DecoderSelector with anything but these two specializations |
| 248 // they'll most likely get linker errors. | 249 // they'll most likely get linker errors. |
| 249 template class DecoderSelector<DemuxerStream::AUDIO>; | 250 template class DecoderSelector<DemuxerStream::AUDIO>; |
| 250 template class DecoderSelector<DemuxerStream::VIDEO>; | 251 template class DecoderSelector<DemuxerStream::VIDEO>; |
| 251 | 252 |
| 252 } // namespace media | 253 } // namespace media |
| OLD | NEW |