RDK Documentation (Open Sourced RDK Components)
opencdmsession.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 2018 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 opencdmsession.h
22  * @brief DRM Session management for Aamp
23  *
24  */
25 
26 #ifndef OpenCDMSession_h
27 #define OpenCDMSession_h
28 
29 #include "AampDrmSession.h"
30 #include "aampoutputprotection.h"
31 #include <open_cdm.h>
32 using namespace std;
33 
34 /**
35  * @class AAMPOCDMSession
36  * @brief Open CDM DRM session
37  */
39 {
40 
41 private:
42  pthread_mutex_t decryptMutex;
43 
44  AampOutputProtection* m_pOutputProtection;
45  KeyState m_eKeyState;
46  media::OpenCdm* m_pOpencdm;
47  media::OpenCdm* m_pOpencdmDecrypt;
48  string m_sessionID;
49  void initAampDRMSession();
50 
51 public:
52  AAMPOCDMSession(AampLogManager *logObj, const string& keySystem);
53  ~AAMPOCDMSession();
54  AAMPOCDMSession(const AAMPOCDMSession&) = delete;
55  AAMPOCDMSession& operator=(const AAMPOCDMSession&) = delete;
56  void generateAampDRMSession(const uint8_t *f_pbInitData,
57  uint32_t f_cbInitData, std::string &customData);
58  DrmData * aampGenerateKeyRequest(string& destinationURL, uint32_t timeout);
59  int aampDRMProcessKey(DrmData* key, uint32_t timeout);
60  int decrypt(const uint8_t *f_pbIV, uint32_t f_cbIV,
61  const uint8_t *payloadData, uint32_t payloadDataSize, uint8_t **ppOpaqueData);
62  KeyState getState();
63  void clearDecryptContext();
64 };
65 
66 #endif
67 
aampoutputprotection.h
Output protection management for Aamp.
DrmData
To hold DRM key, license request etc.
Definition: AampDrmData.h:32
AAMPOCDMSession
Open CDM DRM session.
Definition: opencdmsession.h:38
AampLogManager
AampLogManager Class.
Definition: AampLogManager.h:150
AampOutputProtection
Class to enforce HDCP authentication.
Definition: aampoutputprotection.h:119
AampDrmSession
Base class for DRM sessions.
Definition: AampDrmSession.h:69
KeyState
KeyState
DRM session states.
Definition: AampDrmSession.h:54
AampDrmSession.h
Header file for AampDrmSession.