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

Side by Side Diff: media/base/decrypt_config.cc

Issue 10651006: Add Common Encryption support to BMFF, including subsample decryption. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Satisfy mac_rel buildbot Created 8 years, 4 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
« no previous file with comments | « media/base/decrypt_config.h ('k') | media/crypto/aes_decryptor.h » ('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/base/decrypt_config.h" 5 #include "media/base/decrypt_config.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace media { 9 namespace media {
10 10
11 DecryptConfig::DecryptConfig(const uint8* key_id, int key_id_size, 11 DecryptConfig::DecryptConfig(const std::string& key_id,
12 const uint8* iv, int iv_size, 12 const std::string& iv,
13 const uint8* checksum, int checksum_size, 13 const std::string& checksum,
14 int encrypted_frame_offset) 14 const int data_offset,
15 : key_id_(new uint8[key_id_size]), 15 const std::vector<SubsampleEntry>& subsamples)
16 key_id_size_(key_id_size), 16 : key_id_(key_id),
17 iv_(new uint8[iv_size]), 17 iv_(iv),
18 iv_size_(iv_size), 18 checksum_(checksum),
19 checksum_(checksum_size > 0 ? new uint8[checksum_size] : NULL), 19 data_offset_(data_offset),
20 checksum_size_(checksum_size), 20 subsamples_(subsamples) {
21 encrypted_frame_offset_(encrypted_frame_offset) { 21 CHECK_GT(key_id.size(), 0u);
22 CHECK_GT(key_id_size, 0); 22 CHECK_EQ(iv.size(), static_cast<size_t>(DecryptConfig::kDecryptionKeySize));
23 CHECK_EQ(iv_size, DecryptConfig::kDecryptionKeySize); 23 CHECK_GE(data_offset, 0);
24 CHECK_GE(checksum_size, 0);
25 CHECK_GE(encrypted_frame_offset, 0);
26 memcpy(key_id_.get(), key_id, key_id_size);
27 memcpy(iv_.get(), iv, iv_size);
28 if (checksum_size > 0)
29 memcpy(checksum_.get(), checksum, checksum_size);
30 } 24 }
31 25
32 DecryptConfig::~DecryptConfig() {} 26 DecryptConfig::~DecryptConfig() {}
33 27
34 } // namespace media 28 } // namespace media
OLDNEW
« no previous file with comments | « media/base/decrypt_config.h ('k') | media/crypto/aes_decryptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698