RDK Documentation (Open Sourced RDK Components)
ClearKeySession Class Reference

Open CDM DRM session. More...

#include <ClearKeyDrmSession.h>

Inheritance diagram for ClearKeySession:
Inheritance graph
Collaboration diagram for ClearKeySession:
Collaboration graph

Public Member Functions

 ClearKeySession (AampLogManager *logObj)
 ClearKeySession Constructor.
 
 ~ClearKeySession ()
 ClearKeySession Destructor.
 
 ClearKeySession (const ClearKeySession &)=delete
 Copy constructor disabled. More...
 
ClearKeySessionoperator= (const ClearKeySession &)=delete
 assignment operator disabled More...
 
void generateAampDRMSession (const uint8_t *f_pbInitData, uint32_t f_cbInitData, std::string &customData)
 Create drm session with given init data state will be KEY_INIT on success KEY_ERROR if failed. More...
 
DrmDataaampGenerateKeyRequest (string &destinationURL, uint32_t timeout)
 Generate key request from DRM session Caller function should free the returned memory. More...
 
int aampDRMProcessKey (DrmData *key, uint32_t timeout)
 Updates the received key to DRM session. More...
 
void setKeyId (const char *keyId, int32_t keyIDLen)
 SetKid for this session. More...
 
int decrypt (const uint8_t *f_pbIV, uint32_t f_cbIV, const uint8_t *payloadData, uint32_t payloadDataSize, uint8_t **ppOpaqueData)
 Function to decrypt stream buffer.
 
int decrypt (GstBuffer *keyIDBuffer, GstBuffer *ivBuffer, GstBuffer *buffer, unsigned subSampleCount, GstBuffer *subSamplesBuffer, GstCaps *caps)
 Function to decrypt stream.
 
KeyState getState ()
 Get the current state of DRM Session. More...
 
void clearDecryptContext ()
 Clear the current session context So that new init data can be bound.
 
- Public Member Functions inherited from AampDrmSession
virtual bool waitForState (KeyState state, const uint32_t timeout)
 Waits for the current state of DRM Session to match required.. Timeout is that from the helper. Only used by OCDM Adapter for now. More...
 
 AampDrmSession (AampLogManager *logObj, const string &keySystem)
 Constructor for AampDrmSession.
 
 AampDrmSession (const AampDrmSession &)=delete
 Copy constructor disabled. More...
 
AampDrmSessionoperator= (const AampDrmSession &)=delete
 assignment operator disabled More...
 
virtual ~AampDrmSession ()
 Destructor for AampDrmSession..
 
string getKeySystem ()
 Get the DRM System, ie, UUID for PlayReady WideVine etc.. More...
 
void setOutputProtection (bool bValue)
 Set the OutputProtection for DRM Session. More...
 

Private Member Functions

void initAampDRMSession ()
 Initialize CK DRM session, Initializes EVP context.
 

Private Attributes

pthread_mutex_t decryptMutex
 
KeyState m_eKeyState
 
string m_sessionID
 
unsigned char * m_keyStr
 
size_t m_keyLen
 
unsigned char * m_keyId
 
size_t m_keyIdLen
 
EVP_CIPHER_CTX mOpensslCtx
 

Additional Inherited Members

- Data Fields inherited from AampDrmSession
AampLogManagermLogObj
 
- Protected Attributes inherited from AampDrmSession
std::string m_keySystem
 
bool m_OutputProtectionEnabled
 

yes

Open CDM DRM session.

Definition at line 42 of file ClearKeyDrmSession.h.

Constructor & Destructor Documentation

◆ ClearKeySession()

ClearKeySession::ClearKeySession ( const ClearKeySession )
delete

Copy constructor disabled.

Member Function Documentation

◆ operator=()

ClearKeySession& ClearKeySession::operator= ( const ClearKeySession )
delete

assignment operator disabled

◆ generateAampDRMSession()

ClearKeySession::generateAampDRMSession ( const uint8_t *  f_pbInitData,
uint32_t  f_cbInitData,
std::string &  customData 
)
virtual

Create drm session with given init data state will be KEY_INIT on success KEY_ERROR if failed.

Parameters
f_pbInitDatapointer to initdata
f_cbInitDatainit data size

Implements AampDrmSession.

Definition at line 137 of file ClearKeyDrmSession.cpp.

◆ aampGenerateKeyRequest()

ClearKeySession::aampGenerateKeyRequest ( string &  destinationURL,
uint32_t  timeout 
)
virtual

Generate key request from DRM session Caller function should free the returned memory.

Parameters
destinationURL: gets updated with license server url
timeoutmax timeout untill which to wait for cdm key generation.
Return values
Pointerto DrmData containing license request, NULL if failure.

Implements AampDrmSession.

Definition at line 206 of file ClearKeyDrmSession.cpp.

◆ aampDRMProcessKey()

ClearKeySession::aampDRMProcessKey ( DrmData key,
uint32_t  timeout 
)
virtual

Updates the received key to DRM session.

Parameters
key: License key from license server.
timeoutmax timeout untill which to wait for cdm processing.
Return values
DRM_SUCCESS(1)if no errors encountered

Implements AampDrmSession.

Definition at line 248 of file ClearKeyDrmSession.cpp.

◆ setKeyId()

ClearKeySession::setKeyId ( const char *  keyId,
int32_t  keyIDLen 
)

SetKid for this session.

Parameters
keyIdClear key ID
keyIDLenkey length

Definition at line 86 of file ClearKeyDrmSession.cpp.

◆ getState()

ClearKeySession::getState ( )
virtual

Get the current state of DRM Session.

Return values
KeyState

Implements AampDrmSession.

Definition at line 595 of file ClearKeyDrmSession.cpp.


The documentation for this class was generated from the following files: