RDK Documentation (Open Sourced RDK Components)
AampVanillaDrmHelper.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 AampVanillaDrmHelper.h
22  * @brief Handles the operation foe Vanilla DRM
23  */
24 
25 #ifndef AAMPVANILLADRMHELPER_H
26 #define AAMPVANILLADRMHELPER_H
27 
28 #include "AampDrmHelper.h"
29 #include <string>
30 #include <vector>
31 
32 /**
33  * @class AampVanillaDrmHelper
34  * @brief Handles the operation foe Vanilla DRM
35  */
36 
38 {
39 private:
40  const std::string EMPTY_STRING;
41 public:
42  virtual const std::string& ocdmSystemId() const { return EMPTY_STRING; };
43 
44  virtual void createInitData(std::vector<uint8_t>& initData){};
45 
46  virtual bool parsePssh(const uint8_t* initData, uint32_t initDataLen){ return false; };
47 
48  virtual bool isClearDecrypt() { return true; };
49 
50  virtual void setDrmMetaData(const std::string& metaData) { }
51 
52  virtual int getDrmCodecType() const { return CODEC_TYPE; }
53 
54  virtual void getKey(std::vector<uint8_t>& keyID) { keyID.clear(); };
55 
56  virtual bool isExternalLicense() const { return true; };
57 
58  virtual void generateLicenseRequest(const AampChallengeInfo& challengeInfo, AampLicenseRequest& licenseRequest) const {};
59 
60  virtual const std::string& friendlyName() const override { return FRIENDLY_NAME; }
61 
62  virtual void createInitData(std::vector<uint8_t>& initData) const {};
63 
64  virtual bool isClearDecrypt() const { return true; };
65 
66  virtual void getKey(std::vector<uint8_t>& keyID) const {};
67 
68  AampVanillaDrmHelper(AampLogManager *logObj) : AampDrmHelper(DrmInfo {},logObj), FRIENDLY_NAME("Vanilla_AES"), CODEC_TYPE(3), EMPTY_STRING() {}
69 
70 private:
71  const std::string FRIENDLY_NAME;
72  const int CODEC_TYPE;
73 
74 };
75 
76 #endif /* AAMPVANILLADRMHELPER_H */
77 
AampDrmHelper.h
Implented DRM helper functionalities.
AampVanillaDrmHelper::getKey
virtual void getKey(std::vector< uint8_t > &keyID) const
Get the key ID.
Definition: AampVanillaDrmHelper.h:66
AampVanillaDrmHelper::setDrmMetaData
virtual void setDrmMetaData(const std::string &metaData)
Sets the content specific DRM metadata.
Definition: AampVanillaDrmHelper.h:50
AampVanillaDrmHelper::getDrmCodecType
virtual int getDrmCodecType() const
Returns the DRM codec type for the helper, used in trace.
Definition: AampVanillaDrmHelper.h:52
AampLogManager
AampLogManager Class.
Definition: AampLogManager.h:150
AampVanillaDrmHelper::isExternalLicense
virtual bool isExternalLicense() const
Determines if the DRM itself fetches the license or if AAMP should use its own internal HTTP client t...
Definition: AampVanillaDrmHelper.h:56
AampVanillaDrmHelper
Handles the operation foe Vanilla DRM.
Definition: AampVanillaDrmHelper.h:37
AampLicenseRequest
Holds the data to get the License.
Definition: AampDrmHelper.h:57
AampVanillaDrmHelper::parsePssh
virtual bool parsePssh(const uint8_t *initData, uint32_t initDataLen)
Parse the optional PSSH data.
Definition: AampVanillaDrmHelper.h:46
AampVanillaDrmHelper::friendlyName
virtual const std::string & friendlyName() const override
Gets the friendly display name of the DRM.
Definition: AampVanillaDrmHelper.h:60
DrmInfo
DRM information required to decrypt.
Definition: AampDrmInfo.h:47
AampVanillaDrmHelper::createInitData
virtual void createInitData(std::vector< uint8_t > &initData) const
Definition: AampVanillaDrmHelper.h:62
AampVanillaDrmHelper::isClearDecrypt
virtual bool isClearDecrypt() const
Determine if the DRM system needs to be in the clear or encrypted.
Definition: AampVanillaDrmHelper.h:64
AampVanillaDrmHelper::ocdmSystemId
virtual const std::string & ocdmSystemId() const
Returns the OCDM system ID of the helper.
Definition: AampVanillaDrmHelper.h:42
AampVanillaDrmHelper::generateLicenseRequest
virtual void generateLicenseRequest(const AampChallengeInfo &challengeInfo, AampLicenseRequest &licenseRequest) const
Generate the request details for the DRM license.
Definition: AampVanillaDrmHelper.h:58
AampDrmHelper
AampDRM helper to handle DRM operations.
Definition: AampDrmHelper.h:79
AampChallengeInfo
Aamp challenge info to get the License.
Definition: AampDrmHelper.h:44