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 "base/logging.h" | 5 #include "base/logging.h" |
6 #include "media/webm/webm_content_encodings.h" | 6 #include "media/webm/webm_content_encodings.h" |
7 | 7 |
8 namespace media { | 8 namespace media { |
9 | 9 |
10 ContentEncoding::ContentEncoding() | 10 ContentEncoding::ContentEncoding() |
11 : order_(kOrderInvalid), | 11 : order_(kOrderInvalid), |
12 scope_(kScopeInvalid), | 12 scope_(kScopeInvalid), |
13 type_(kTypeInvalid), | 13 type_(kTypeInvalid), |
14 encryption_algo_(kEncAlgoInvalid), | 14 encryption_algo_(kEncAlgoInvalid), |
15 encryption_key_id_size_(0) { | 15 encryption_key_id_size_(0), |
| 16 cipher_mode_(kCipherModeInvalid) { |
16 } | 17 } |
17 | 18 |
18 ContentEncoding::~ContentEncoding() {} | 19 ContentEncoding::~ContentEncoding() {} |
19 | 20 |
20 void ContentEncoding::SetEncryptionKeyId(const uint8* encryption_key_id, | 21 void ContentEncoding::SetEncryptionKeyId(const uint8* encryption_key_id, |
21 int size) { | 22 int size) { |
22 DCHECK(encryption_key_id); | 23 DCHECK(encryption_key_id); |
23 DCHECK_GT(size, 0); | 24 DCHECK_GT(size, 0); |
24 encryption_key_id_.reset(new uint8[size]); | 25 encryption_key_id_.reset(new uint8[size]); |
25 memcpy(encryption_key_id_.get(), encryption_key_id, size); | 26 memcpy(encryption_key_id_.get(), encryption_key_id, size); |
26 encryption_key_id_size_ = size; | 27 encryption_key_id_size_ = size; |
27 } | 28 } |
28 | 29 |
29 } // namespace media | 30 } // namespace media |
OLD | NEW |