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/crypto/aes_decryptor.h" | 5 #include "media/crypto/aes_decryptor.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 | 259 |
260 decrypted->SetTimestamp(encrypted->GetTimestamp()); | 260 decrypted->SetTimestamp(encrypted->GetTimestamp()); |
261 decrypted->SetDuration(encrypted->GetDuration()); | 261 decrypted->SetDuration(encrypted->GetDuration()); |
262 decrypt_cb.Run(kSuccess, decrypted); | 262 decrypt_cb.Run(kSuccess, decrypted); |
263 } | 263 } |
264 | 264 |
265 void AesDecryptor::CancelDecrypt(StreamType stream_type) { | 265 void AesDecryptor::CancelDecrypt(StreamType stream_type) { |
266 // Decrypt() calls the DecryptCB synchronously so there's nothing to cancel. | 266 // Decrypt() calls the DecryptCB synchronously so there's nothing to cancel. |
267 } | 267 } |
268 | 268 |
269 void AesDecryptor::InitializeAudioDecoder(scoped_ptr<AudioDecoderConfig> config, | 269 void AesDecryptor::InitializeAudioDecoder(const AudioDecoderConfig& config, |
270 const DecoderInitCB& init_cb) { | 270 const DecoderInitCB& init_cb) { |
271 // AesDecryptor does not support audio decoding. | 271 // AesDecryptor does not support audio decoding. |
272 init_cb.Run(false); | 272 init_cb.Run(false); |
273 } | 273 } |
274 | 274 |
275 void AesDecryptor::InitializeVideoDecoder(const VideoDecoderConfig& config, | 275 void AesDecryptor::InitializeVideoDecoder(const VideoDecoderConfig& config, |
276 const DecoderInitCB& init_cb) { | 276 const DecoderInitCB& init_cb) { |
277 // AesDecryptor does not support video decoding. | 277 // AesDecryptor does not support video decoding. |
278 init_cb.Run(false); | 278 init_cb.Run(false); |
279 } | 279 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 bool AesDecryptor::DecryptionKey::Init() { | 328 bool AesDecryptor::DecryptionKey::Init() { |
329 CHECK(!secret_.empty()); | 329 CHECK(!secret_.empty()); |
330 decryption_key_.reset(crypto::SymmetricKey::Import( | 330 decryption_key_.reset(crypto::SymmetricKey::Import( |
331 crypto::SymmetricKey::AES, secret_)); | 331 crypto::SymmetricKey::AES, secret_)); |
332 if (!decryption_key_.get()) | 332 if (!decryption_key_.get()) |
333 return false; | 333 return false; |
334 return true; | 334 return true; |
335 } | 335 } |
336 | 336 |
337 } // namespace media | 337 } // namespace media |
OLD | NEW |