OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROMECAST_PUBLIC_MEDIA_CAST_DECRYPT_CONFIG_H_ | |
6 #define CHROMECAST_PUBLIC_MEDIA_CAST_DECRYPT_CONFIG_H_ | |
7 | |
8 #include <stdint.h> | |
9 #include <string> | |
10 #include <vector> | |
11 | |
12 namespace chromecast { | |
13 namespace media { | |
14 | |
15 // The Common Encryption spec provides for subsample encryption, where portions | |
16 // of a sample are set in cleartext. A SubsampleEntry specifies the number of | |
17 // clear and encrypted bytes in each subsample. For decryption, all of the | |
18 // encrypted bytes in a sample should be considered a single logical stream, | |
19 // regardless of how they are divided into subsamples, and the clear bytes | |
20 // should not be considered as part of decryption. This is logically equivalent | |
21 // to concatenating all 'cypher_bytes' portions of subsamples, decrypting that | |
22 // result, and then copying each byte from the decrypted block over the | |
23 // position of the corresponding encrypted byte. | |
24 struct SubsampleEntry { | |
25 SubsampleEntry() : clear_bytes(0), cypher_bytes(0) {} | |
26 SubsampleEntry(uint32_t clear_bytes, uint32_t cypher_bytes) | |
27 : clear_bytes(clear_bytes), cypher_bytes(cypher_bytes) {} | |
28 uint32_t clear_bytes; | |
29 uint32_t cypher_bytes; | |
30 }; | |
31 | |
32 // Contains all information that a decryptor needs to decrypt a media sample. | |
gunsch
2015/07/29 17:04:20
"that a decryptor needs" --> "needed"
and probabl
halliwell
2015/07/29 19:58:20
Done.
| |
33 class CastDecryptConfig { | |
34 public: | |
35 virtual ~CastDecryptConfig() {} | |
36 | |
37 virtual const std::string& key_id() const = 0; | |
38 virtual const std::string& iv() const = 0; | |
39 virtual const std::vector<SubsampleEntry>& subsamples() const = 0; | |
40 }; | |
41 | |
42 } // namespace media | |
43 } // namespace chromecast | |
44 | |
45 #endif // CHROMECAST_PUBLIC_MEDIA_CAST_DECRYPT_CONFIG_H_ | |
OLD | NEW |