Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: media/crypto/aes_decryptor.cc

Issue 12638030: Make AudioDecoderConfig copyable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/crypto/aes_decryptor.h ('k') | media/filters/audio_decoder_selector_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/crypto/aes_decryptor.h ('k') | media/filters/audio_decoder_selector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698