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 #ifndef MEDIA_BASE_DECRYPT_CONFIG_H_ | 5 #ifndef MEDIA_BASE_DECRYPT_CONFIG_H_ |
6 #define MEDIA_BASE_DECRYPT_CONFIG_H_ | 6 #define MEDIA_BASE_DECRYPT_CONFIG_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "media/base/media_export.h" | 10 #include "media/base/media_export.h" |
11 | 11 |
12 namespace media { | 12 namespace media { |
13 | 13 |
14 // Contains all information that a decryptor needs to decrypt. | 14 // Contains all information that a decryptor needs to decrypt a frame. |
15 class MEDIA_EXPORT DecryptConfig { | 15 class MEDIA_EXPORT DecryptConfig { |
16 public: | 16 public: |
17 explicit DecryptConfig(const uint8* key_id, int key_id_size); | 17 // |key_id| is the ID that references the decryption key for this frame. |iv| |
18 // is the initialization vector defined by the encrypted format. Currently | |
19 // |iv_size| must be 16 bytes as defined be WebM and ISO. |checksum| is the | |
ddorwin
2012/07/14 00:50:31
s/be/by
fgalligan1
2012/07/16 23:51:42
Done.
| |
20 // hash value of the encrypted buffer. |checksum| is defined by the | |
21 // encrypted format and may be NULL. |encrypted_frame_offset| is the offset | |
22 // into the encrypted buffer that the encrypted frame starts. The class | |
23 // will copy the data from |key_id|, |iv|, and |checksum|. | |
24 DecryptConfig(const uint8* key_id, int key_id_size, | |
25 const uint8* iv, int iv_size, | |
26 const uint8* checksum, int checksum_size, | |
27 int encrypted_frame_offset); | |
18 ~DecryptConfig(); | 28 ~DecryptConfig(); |
19 | 29 |
20 const uint8* key_id() const { return key_id_.get(); } | 30 const uint8* key_id() const { return key_id_.get(); } |
21 int key_id_size() const { return key_id_size_; } | 31 int key_id_size() const { return key_id_size_; } |
32 const uint8* iv() const { return iv_.get(); } | |
33 int iv_size() const { return iv_size_; } | |
34 const uint8* checksum() const { return checksum_.get(); } | |
35 int checksum_size() const { return checksum_size_; } | |
36 int encrypted_frame_offset() const { return encrypted_frame_offset_; } | |
22 | 37 |
23 private: | 38 private: |
24 scoped_array<uint8> key_id_; | 39 scoped_array<uint8> key_id_; |
ddorwin
2012/07/14 00:50:31
const for all, at least for the sizes. Can the sco
fgalligan1
2012/07/16 23:51:42
Const on the sizes. I can change the scoped_array,
ddorwin
2012/07/17 00:19:52
Const just says the pointer won't change. Since th
fgalligan1
2012/07/17 16:34:56
Done.
| |
25 int key_id_size_; | 40 int key_id_size_; |
26 | 41 |
42 // Initialization vector. | |
43 scoped_array<uint8> iv_; | |
44 int iv_size_; | |
45 | |
46 // Checksum of the data to be verified before decrypting the data. This may | |
47 // be set to NULL for some formats. | |
ddorwin
2012/07/14 00:50:31
nit: remove "set to"
fgalligan1
2012/07/16 23:51:42
Done.
| |
48 scoped_array<uint8> checksum_; | |
49 int checksum_size_; | |
50 | |
51 // This is the offset in bytes to where the encrypted data starts within | |
52 // the input buffer. | |
53 int encrypted_frame_offset_; | |
54 | |
27 DISALLOW_COPY_AND_ASSIGN(DecryptConfig); | 55 DISALLOW_COPY_AND_ASSIGN(DecryptConfig); |
28 }; | 56 }; |
29 | 57 |
30 } // namespace media | 58 } // namespace media |
31 | 59 |
32 #endif // MEDIA_BASE_DECRYPT_CONFIG_H_ | 60 #endif // MEDIA_BASE_DECRYPT_CONFIG_H_ |
OLD | NEW |