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

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

Issue 10535029: Add support for encrypted WebM files as defined in the RFC. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 6 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
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 uint8* hmac, int hmac_size,
12 : key_id_size_(key_id_size) { 12 uint64 iv,
13 const uint8* key_id, int key_id_size)
14 : hmac_size_(hmac_size),
15 iv_(iv),
16 key_id_size_(key_id_size) {
17 CHECK_GT(hmac_size, 0);
13 CHECK_GT(key_id_size, 0); 18 CHECK_GT(key_id_size, 0);
19 hmac_.reset(new uint8[hmac_size]);
20 memcpy(hmac_.get(), hmac, hmac_size);
14 key_id_.reset(new uint8[key_id_size]); 21 key_id_.reset(new uint8[key_id_size]);
15 memcpy(key_id_.get(), key_id, key_id_size); 22 memcpy(key_id_.get(), key_id, key_id_size);
16 } 23 }
17 24
18 DecryptConfig::~DecryptConfig() {} 25 DecryptConfig::~DecryptConfig() {}
19 26
20 } // namespace media 27 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698