RDK Documentation (Open Sourced RDK Components)
AampDrmInfo.h
Go to the documentation of this file.
1 /*
2  * If not stated otherwise in this file or this component's license file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2020 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 /**
21  * @file AampDrmInfo.h
22  * @brief DRM license information for Aamp
23  */
24 
25 #ifndef AAMPDRMINFO_H
26 #define AAMPDRMINFO_H
27 
28 #include <string>
29 #include "AampDrmMediaFormat.h"
30 
31 
32 /**
33  * @enum DrmMethod
34  * @brief DRM method
35  */
36 typedef enum
37 {
38  eMETHOD_NONE,
39  eMETHOD_AES_128, /**< encrypted using Advanced Encryption Standard 128-bit key and PKCS7 padding */
40 } DrmMethod;
41 
42 
43 /**
44  * @struct DrmInfo
45  * @brief DRM information required to decrypt
46  */
47 struct DrmInfo
48 {
49  DrmInfo() : method(eMETHOD_NONE), mediaFormat(eMEDIAFORMAT_HLS), useFirst16BytesAsIV(false), iv(nullptr),
52  {};
53  ~DrmInfo() {};
54  // copy constructor
55  DrmInfo(const DrmInfo& other) : method(other.method), mediaFormat(other.mediaFormat),
56  useFirst16BytesAsIV(other.useFirst16BytesAsIV), masterManifestURL(other.masterManifestURL),
57  manifestURL(other.manifestURL), keyURI(other.keyURI), keyFormat(other.keyFormat),
60  {
61  // copying same iv, releases memory allocated after deleting any of these objects.
62  iv = other.iv;
63  }
64  DrmInfo& operator=(const DrmInfo& other)
65  {
66  method = other.method;
67  mediaFormat = other.mediaFormat;
68  useFirst16BytesAsIV = other.useFirst16BytesAsIV;
70  manifestURL = other.manifestURL;
71  keyURI = other.keyURI;
72  keyFormat = other.keyFormat;
73  systemUUID = other.systemUUID;
74  initData = other.initData;
75  // copying same iv, releases memory allocated after deleting any of these objects.
76  iv = other.iv;
77  return *this;
78  }
79  DrmMethod method; /**< Encryption method */
80  MediaFormat mediaFormat; /**< Format of the media being played e.g. DASH, HLS*/
81  bool useFirst16BytesAsIV;
82  bool bPropagateUriParams; /**< Propagagate Manifest uri params in DRM */
83  bool bUseMediaSequenceIV; /**< To create IV using media sequence number */
84  unsigned char *iv; /**< [16] Initialisation vector */
85  std::string masterManifestURL; /**< URL of the master manifest */
86  std::string manifestURL; /**< URL of playlist the DRM info was taken from. May be the same as the masterManifestURL */
87  std::string keyURI; /**< URI to fetch key. May be relative to the manifest URL */
88  std::string keyFormat; /**< Format of key */
89  std::string systemUUID; /**< UUID of the DRM */
90  std::string initData; /**< Base64 init data string from the main manifest URI */
91 };
92 
93 #endif /* AAMPDRMINFO_H */
DrmInfo::keyURI
std::string keyURI
Definition: AampDrmInfo.h:87
DrmMethod
DrmMethod
DRM method.
Definition: AampDrmInfo.h:36
DrmInfo::manifestURL
std::string manifestURL
Definition: AampDrmInfo.h:86
DrmInfo::iv
unsigned char * iv
Definition: AampDrmInfo.h:84
DrmInfo::bUseMediaSequenceIV
bool bUseMediaSequenceIV
Definition: AampDrmInfo.h:83
DrmInfo::systemUUID
std::string systemUUID
Definition: AampDrmInfo.h:89
DrmInfo::initData
std::string initData
Definition: AampDrmInfo.h:90
DrmInfo
DRM information required to decrypt.
Definition: AampDrmInfo.h:47
AampDrmMediaFormat.h
Types of Media.
DrmInfo::masterManifestURL
std::string masterManifestURL
Definition: AampDrmInfo.h:85
DrmInfo::keyFormat
std::string keyFormat
Definition: AampDrmInfo.h:88
eMETHOD_AES_128
@ eMETHOD_AES_128
Definition: AampDrmInfo.h:39
eMEDIAFORMAT_HLS
@ eMEDIAFORMAT_HLS
Definition: AampDrmMediaFormat.h:34
DrmInfo::bPropagateUriParams
bool bPropagateUriParams
Definition: AampDrmInfo.h:82
DrmInfo::method
DrmMethod method
Definition: AampDrmInfo.h:79
DrmInfo::mediaFormat
MediaFormat mediaFormat
Definition: AampDrmInfo.h:80
MediaFormat
MediaFormat
Media format types.
Definition: AampDrmMediaFormat.h:32