summaryrefslogtreecommitdiffstats
path: root/media/base/decrypt_config.cc
diff options
context:
space:
mode:
authorstrobe@google.com <strobe@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-26 00:49:59 +0000
committerstrobe@google.com <strobe@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-26 00:49:59 +0000
commit9746f9132e55a91d2ec3d866711277b874574743 (patch)
treeb0f6d236afc3515855403363b6e9fe455a6c801d /media/base/decrypt_config.cc
parent7db8893ab741949612cebfed89e11d267daacbf9 (diff)
downloadchromium_src-9746f9132e55a91d2ec3d866711277b874574743.zip
chromium_src-9746f9132e55a91d2ec3d866711277b874574743.tar.gz
chromium_src-9746f9132e55a91d2ec3d866711277b874574743.tar.bz2
Add Common Encryption support to BMFF, including subsample decryption.
BUG=132351 TEST=AesDecryptorTest, plus manual playback in browser Review URL: https://chromiumcodereview.appspot.com/10651006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148453 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/decrypt_config.cc')
-rw-r--r--media/base/decrypt_config.cc32
1 files changed, 13 insertions, 19 deletions
diff --git a/media/base/decrypt_config.cc b/media/base/decrypt_config.cc
index fb502df..c499c92 100644
--- a/media/base/decrypt_config.cc
+++ b/media/base/decrypt_config.cc
@@ -8,25 +8,19 @@
namespace media {
-DecryptConfig::DecryptConfig(const uint8* key_id, int key_id_size,
- const uint8* iv, int iv_size,
- const uint8* checksum, int checksum_size,
- int encrypted_frame_offset)
- : key_id_(new uint8[key_id_size]),
- key_id_size_(key_id_size),
- iv_(new uint8[iv_size]),
- iv_size_(iv_size),
- checksum_(checksum_size > 0 ? new uint8[checksum_size] : NULL),
- checksum_size_(checksum_size),
- encrypted_frame_offset_(encrypted_frame_offset) {
- CHECK_GT(key_id_size, 0);
- CHECK_EQ(iv_size, DecryptConfig::kDecryptionKeySize);
- CHECK_GE(checksum_size, 0);
- CHECK_GE(encrypted_frame_offset, 0);
- memcpy(key_id_.get(), key_id, key_id_size);
- memcpy(iv_.get(), iv, iv_size);
- if (checksum_size > 0)
- memcpy(checksum_.get(), checksum, checksum_size);
+DecryptConfig::DecryptConfig(const std::string& key_id,
+ const std::string& iv,
+ const std::string& checksum,
+ const int data_offset,
+ const std::vector<SubsampleEntry>& subsamples)
+ : key_id_(key_id),
+ iv_(iv),
+ checksum_(checksum),
+ data_offset_(data_offset),
+ subsamples_(subsamples) {
+ CHECK_GT(key_id.size(), 0u);
+ CHECK_EQ(iv.size(), static_cast<size_t>(DecryptConfig::kDecryptionKeySize));
+ CHECK_GE(data_offset, 0);
}
DecryptConfig::~DecryptConfig() {}