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| must be 16 bytes as defined by WebM and ISO. Or must be | 39 // Currently |iv_size| must be 16 bytes as defined by WebM and ISO. |
40 // empty which signals to perform the integrity check on an unencrypted | |
41 // frame as defined WebM. | |
42 // |checksum| is the hash value of the encrypted buffer. |checksum| is | 40 // |checksum| is the hash value of the encrypted buffer. |checksum| is |
43 // defined by the encrypted format and may be NULL. | 41 // defined by the encrypted format and may be NULL. |
44 // |data_offset| is the amount of data that should be discarded from the | 42 // |data_offset| is the amount of data that should be discarded from the |
45 // head of the sample buffer before applying subsample information. A | 43 // head of the sample buffer before applying subsample information. A |
46 // decrypted buffer will be shorter than an encrypted buffer by this amount. | 44 // decrypted buffer will be shorter than an encrypted buffer by this amount. |
47 // |subsamples| defines the clear and encrypted portions of the sample as | 45 // |subsamples| defines the clear and encrypted portions of the sample as |
48 // described above. A decrypted buffer will be equal in size to the sum | 46 // described above. A decrypted buffer will be equal in size to the sum |
49 // of the subsample sizes. | 47 // of the subsample sizes. |
50 // | 48 // |
51 // |data_offset| is applied after |checksum|, but before |subsamples|. | 49 // |data_offset| is applied after |checksum|, but before |subsamples|. |
(...skipping 26 matching lines...) Expand all Loading... |
78 // Subsample information. May be empty for some formats, meaning entire frame | 76 // Subsample information. May be empty for some formats, meaning entire frame |
79 // (less data ignored by data_offset_) is encrypted. | 77 // (less data ignored by data_offset_) is encrypted. |
80 const std::vector<SubsampleEntry> subsamples_; | 78 const std::vector<SubsampleEntry> subsamples_; |
81 | 79 |
82 DISALLOW_COPY_AND_ASSIGN(DecryptConfig); | 80 DISALLOW_COPY_AND_ASSIGN(DecryptConfig); |
83 }; | 81 }; |
84 | 82 |
85 } // namespace media | 83 } // namespace media |
86 | 84 |
87 #endif // MEDIA_BASE_DECRYPT_CONFIG_H_ | 85 #endif // MEDIA_BASE_DECRYPT_CONFIG_H_ |
OLD | NEW |