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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 }; | 29 }; |
30 | 30 |
31 // Contains all information that a decryptor needs to decrypt a media sample. | 31 // Contains all information that a decryptor needs to decrypt a media sample. |
32 class MEDIA_EXPORT DecryptConfig { | 32 class MEDIA_EXPORT DecryptConfig { |
33 public: | 33 public: |
34 // Keys are always 128 bits. | 34 // Keys are always 128 bits. |
35 static const int kDecryptionKeySize = 16; | 35 static const int kDecryptionKeySize = 16; |
36 | 36 |
37 // |key_id| is the ID that references the decryption key for this sample. | 37 // |key_id| is the ID that references the decryption key for this sample. |
38 // |iv| is the initialization vector defined by the encrypted format. | 38 // |iv| is the initialization vector defined by the encrypted format. |
39 // Currently |iv_size| must be 16 bytes as defined by WebM and ISO. | 39 // Currently |iv| must be 16 bytes as defined by WebM and ISO. Or must be |
| 40 // empty which signals to perform the integrity check on an unencrypted |
| 41 // frame as defined WebM. |
40 // |checksum| is the hash value of the encrypted buffer. |checksum| is | 42 // |checksum| is the hash value of the encrypted buffer. |checksum| is |
41 // defined by the encrypted format and may be NULL. | 43 // defined by the encrypted format and may be NULL. |
42 // |data_offset| is the amount of data that should be discarded from the | 44 // |data_offset| is the amount of data that should be discarded from the |
43 // head of the sample buffer before applying subsample information. A | 45 // head of the sample buffer before applying subsample information. A |
44 // decrypted buffer will be shorter than an encrypted buffer by this amount. | 46 // decrypted buffer will be shorter than an encrypted buffer by this amount. |
45 // |subsamples| defines the clear and encrypted portions of the sample as | 47 // |subsamples| defines the clear and encrypted portions of the sample as |
46 // described above. A decrypted buffer will be equal in size to the sum | 48 // described above. A decrypted buffer will be equal in size to the sum |
47 // of the subsample sizes. | 49 // of the subsample sizes. |
48 // | 50 // |
49 // |data_offset| is applied after |checksum|, but before |subsamples|. | 51 // |data_offset| is applied after |checksum|, but before |subsamples|. |
(...skipping 26 matching lines...) Expand all Loading... |
76 // Subsample information. May be empty for some formats, meaning entire frame | 78 // Subsample information. May be empty for some formats, meaning entire frame |
77 // (less data ignored by data_offset_) is encrypted. | 79 // (less data ignored by data_offset_) is encrypted. |
78 const std::vector<SubsampleEntry> subsamples_; | 80 const std::vector<SubsampleEntry> subsamples_; |
79 | 81 |
80 DISALLOW_COPY_AND_ASSIGN(DecryptConfig); | 82 DISALLOW_COPY_AND_ASSIGN(DecryptConfig); |
81 }; | 83 }; |
82 | 84 |
83 } // namespace media | 85 } // namespace media |
84 | 86 |
85 #endif // MEDIA_BASE_DECRYPT_CONFIG_H_ | 87 #endif // MEDIA_BASE_DECRYPT_CONFIG_H_ |
OLD | NEW |