Shaka Player Embedded
media_key_system_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_JS_EME_MEDIA_KEY_SYSTEM_CONFIGURATION_H_
16 #define SHAKA_EMBEDDED_JS_EME_MEDIA_KEY_SYSTEM_CONFIGURATION_H_
17 
18 #include <string>
19 #include <vector>
20 
22 
23 #include "src/mapping/enum.h"
24 #include "src/mapping/struct.h"
25 
26 namespace shaka {
27 namespace js {
28 namespace eme {
29 
30 // Alias the names in shaka::eme to shaka::js::eme for convenience.
31 using namespace shaka::eme; // NOLINT
32 
35 
36  ADD_DICT_FIELD(contentType, std::string);
37  ADD_DICT_FIELD(robustness, std::string);
38 };
39 
42 
43  ADD_DICT_FIELD(label, std::string);
44  ADD_DICT_FIELD(initDataTypes, std::vector<MediaKeyInitDataType>);
45  ADD_DICT_FIELD(audioCapabilities, std::vector<MediaKeySystemMediaCapability>);
46  ADD_DICT_FIELD(videoCapabilities, std::vector<MediaKeySystemMediaCapability>);
47  ADD_DICT_FIELD(distinctiveIdentifier, MediaKeysRequirement);
48  ADD_DICT_FIELD(persistentState, MediaKeysRequirement);
49  ADD_DICT_FIELD(sessionTypes, std::vector<MediaKeySessionType>);
50 };
51 
52 } // namespace eme
53 } // namespace js
54 } // namespace shaka
55 
56 // Enums defined in <shaka/eme/configuration.h>
58  AddMapping(Enum::Required, "required");
59  AddMapping(Enum::Optional, "optional");
60  AddMapping(Enum::NotAllowed, "not-allowed");
61 }
62 
64  AddMapping(Enum::Temporary, "temporary");
65  AddMapping(Enum::PersistentLicense, "persistent-license");
66 }
67 
69  AddMapping(Enum::Cenc, "cenc");
70  AddMapping(Enum::KeyIds, "keyids");
71  AddMapping(Enum::WebM, "webm");
72 }
73 
75  AddMapping(Enum::LicenseRequest, "license-request");
76  AddMapping(Enum::LicenseRenewal, "license-renewal");
77  AddMapping(Enum::LicenseRelease, "license-release");
78  AddMapping(Enum::IndividualizationRequest, "individualization-request");
79 }
80 
82  AddMapping(Enum::Usable, "usable");
83  AddMapping(Enum::Expired, "expired");
84  AddMapping(Enum::Released, "released");
85  AddMapping(Enum::OutputRestricted, "output-restricted");
86  AddMapping(Enum::OutputDownscaled, "output-downscaled");
87  AddMapping(Enum::StatusPending, "status-pending");
88  AddMapping(Enum::InternalError, "internal-error");
89 }
90 
91 #endif // SHAKA_EMBEDDED_JS_EME_MEDIA_KEY_SYSTEM_CONFIGURATION_H_
#define DECLARE_STRUCT_SPECIAL_METHODS_COPYABLE(Type)
Definition: struct.h:42
DEFINE_ENUM_MAPPING(shaka::eme, MediaKeysRequirement)
#define ADD_DICT_FIELD(member,...)
Definition: struct.h:39