Shaka Player Embedded
configuration.h
Go to the documentation of this file.
1 // Copyright 2017 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef SHAKA_EMBEDDED_EME_CONFIGURATION_H_
16 #define SHAKA_EMBEDDED_EME_CONFIGURATION_H_
17 
18 #include <stdint.h>
19 
20 #include <vector>
21 
22 #include "../macros.h"
23 
24 namespace shaka {
25 namespace eme {
26 
34 enum class MediaKeysRequirement : uint8_t {
35  Required,
36  Optional,
37  NotAllowed,
38 };
39 
40 enum class MediaKeySessionType : uint8_t {
41  Temporary,
43 };
44 
45 enum class MediaKeyInitDataType : uint8_t {
46  Cenc,
47  KeyIds,
48  WebM,
49 };
50 
51 enum class MediaKeyMessageType : uint8_t {
56 };
57 
58 enum class MediaKeyStatus : uint8_t {
59  Usable,
60  Expired,
61  Released,
66 };
67 
68 enum class ExceptionType : uint8_t {
69  TypeError,
73  RangeError,
74 };
75 
76 enum class DecryptStatus : uint8_t {
78  Success,
84  OtherError,
85 };
86 
87 enum class EncryptionScheme : uint8_t {
88  AesCtr,
89  AesCbc,
90 };
91 
94  EncryptionPattern(uint32_t encrypted_blocks, uint32_t clear_blocks);
95 
97  uint32_t encrypted_blocks;
99  uint32_t clear_blocks;
100 };
101 
108  SubsampleInfo(uint32_t clear_bytes, uint32_t protected_bytes);
109 
111  uint32_t clear_bytes;
113  uint32_t protected_bytes;
114 };
115 
118  public:
120  const std::vector<uint8_t>& key_id,
121  const std::vector<uint8_t>& iv);
123  EncryptionPattern pattern,
124  const std::vector<uint8_t>& key_id,
125  const std::vector<uint8_t>& iv);
127  EncryptionPattern pattern,
128  const std::vector<uint8_t>& key_id,
129  const std::vector<uint8_t>& iv,
130  const std::vector<SubsampleInfo>& subsamples);
132 
134 
135 
138 
144 
149  const std::vector<uint8_t> key_id;
150 
152  const std::vector<uint8_t> iv;
153 
159  const std::vector<SubsampleInfo> subsamples;
160 };
161 
164 } // namespace eme
165 } // namespace shaka
166 
167 #endif // SHAKA_EMBEDDED_EME_CONFIGURATION_H_
const EncryptionPattern pattern
#define SHAKA_EXPORT
Definition: macros.h:30
#define SHAKA_NON_COPYABLE_OR_MOVABLE_TYPE(Type)
Definition: macros.h:51
const std::vector< uint8_t > iv
const EncryptionScheme scheme
const std::vector< SubsampleInfo > subsamples
const std::vector< uint8_t > key_id