| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/decrypting_demuxer_stream.h" | 5 #include "media/filters/decrypting_demuxer_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/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 152 |
| 153 request_decryptor_notification_cb_.Reset(); | 153 request_decryptor_notification_cb_.Reset(); |
| 154 decryptor_ = decryptor; | 154 decryptor_ = decryptor; |
| 155 | 155 |
| 156 switch (stream_type_) { | 156 switch (stream_type_) { |
| 157 case AUDIO: { | 157 case AUDIO: { |
| 158 const AudioDecoderConfig& input_audio_config = | 158 const AudioDecoderConfig& input_audio_config = |
| 159 demuxer_stream_->audio_decoder_config(); | 159 demuxer_stream_->audio_decoder_config(); |
| 160 audio_config_.reset(new AudioDecoderConfig()); | 160 audio_config_.reset(new AudioDecoderConfig()); |
| 161 audio_config_->Initialize(input_audio_config.codec(), | 161 audio_config_->Initialize(input_audio_config.codec(), |
| 162 input_audio_config.bits_per_channel(), | 162 input_audio_config.sample_format(), |
| 163 input_audio_config.channel_layout(), | 163 input_audio_config.channel_layout(), |
| 164 input_audio_config.samples_per_second(), | 164 input_audio_config.samples_per_second(), |
| 165 input_audio_config.extra_data(), | 165 input_audio_config.extra_data(), |
| 166 input_audio_config.extra_data_size(), | 166 input_audio_config.extra_data_size(), |
| 167 false, // Output audio is not encrypted. | 167 false, // Output audio is not encrypted. |
| 168 false); | 168 false); |
| 169 break; | 169 break; |
| 170 } | 170 } |
| 171 | 171 |
| 172 case VIDEO: { | 172 case VIDEO: { |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 state_ = kIdle; | 342 state_ = kIdle; |
| 343 base::ResetAndReturn(&reset_cb_).Run(); | 343 base::ResetAndReturn(&reset_cb_).Run(); |
| 344 } | 344 } |
| 345 | 345 |
| 346 Decryptor::StreamType DecryptingDemuxerStream::GetDecryptorStreamType() const { | 346 Decryptor::StreamType DecryptingDemuxerStream::GetDecryptorStreamType() const { |
| 347 DCHECK(stream_type_ == AUDIO || stream_type_ == VIDEO); | 347 DCHECK(stream_type_ == AUDIO || stream_type_ == VIDEO); |
| 348 return stream_type_ == AUDIO ? Decryptor::kAudio : Decryptor::kVideo; | 348 return stream_type_ == AUDIO ? Decryptor::kAudio : Decryptor::kVideo; |
| 349 } | 349 } |
| 350 | 350 |
| 351 } // namespace media | 351 } // namespace media |
| OLD | NEW |