RDK Documentation (Open Sourced RDK Components)
PlayReadyDRMSession Class Reference

Class for PlayReady DRM operations. More...

#include <playreadydrmsession.h>

Inheritance diagram for PlayReadyDRMSession:
Inheritance graph
Collaboration diagram for PlayReadyDRMSession:
Collaboration graph

Public Member Functions

 PlayReadyDRMSession (AampLogManager *logObj)
 PlayReadyDRMSession Constructor.
 
 ~PlayReadyDRMSession ()
 PlayReadyDRMSession Destructor.
 
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...
 
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. More...
 
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 int decrypt (GstBuffer *keyIDBuffer, GstBuffer *ivBuffer, GstBuffer *buffer, unsigned subSampleCount, GstBuffer *subSamplesBuffer, GstCaps *caps=NULL)
 Function to decrypt GStreamer stream buffer.
 
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 PR DRM session, state will be set as KEY_INIT on success KEY_ERROR if failure.
 
int _GetPROFromInitData (const DRM_BYTE *f_pbInitData, DRM_DWORD f_cbInitData, DRM_DWORD *f_pibPRO, DRM_DWORD *f_pcbPRO)
 Retrieve PlayReady Object(PRO) from init data. More...
 
int _ParseInitData (const uint8_t *f_pbInitData, uint32_t f_cbInitData)
 Parse init data to retrieve PRO from it. More...
 

Private Attributes

DRM_APP_CONTEXT * m_ptrAppContext
 
DRM_DECRYPT_CONTEXT m_oDecryptContext
 
DRM_BYTE * m_sbOpaBuf
 
DRM_DWORD m_cbOpaBuf
 
DRM_BYTE * m_sbRevocateBuf
 
KeyState m_eKeyState
 
DRM_CHAR m_rgchSesnID [CCH_BASE64_EQUIV(SIZEOF(DRM_ID))+1]
 
DRM_BOOL m_fCommit
 
DRM_BYTE * m_pbPRO
 
DRM_DWORD m_cbPRO
 
DRM_BYTE * m_pbChallenge
 
DRM_DWORD m_cbChallenge
 
DRM_CHAR * m_ptrDestURL
 
pthread_mutex_t decryptMutex
 
AampOutputProtectionm_pOutputProtection
 

Additional Inherited Members

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

yes

Class for PlayReady DRM operations.

Definition at line 48 of file playreadydrmsession.h.

Member Function Documentation

◆ _GetPROFromInitData()

PlayReadyDRMSession::_GetPROFromInitData ( const DRM_BYTE *  f_pbInitData,
DRM_DWORD  f_cbInitData,
DRM_DWORD *  f_pibPRO,
DRM_DWORD *  f_pcbPRO 
)
private

Retrieve PlayReady Object(PRO) from init data.

Parameters
f_pbInitData: Pointer to initdata
f_cbInitData: size of initdata
f_pibPRO: Gets updated with PRO
f_pcbPRO: size of PRO
Return values
DRM_SUCCESSif no errors encountered

Definition at line 292 of file playreadydrmsession.cpp.

◆ _ParseInitData()

PlayReadyDRMSession::_ParseInitData ( const uint8_t *  f_pbInitData,
uint32_t  f_cbInitData 
)
private

Parse init data to retrieve PRO from it.

Parameters
f_pbInitData: Pointer to initdata
f_cbInitData: size of init data
Return values
DRM_SUCCESSif no errors encountered

Definition at line 442 of file playreadydrmsession.cpp.

◆ generateAampDRMSession()

PlayReadyDRMSession::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 201 of file playreadydrmsession.cpp.

◆ aampGenerateKeyRequest()

PlayReadyDRMSession::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
timeout: max timeout untill which to wait for cdm key generation.
Return values
Pointerto DrmData containing license request, NULL if failure.

Implements AampDrmSession.

Definition at line 476 of file playreadydrmsession.cpp.

◆ aampDRMProcessKey()

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

Updates the received key to DRM session.

Parameters
key: License key from license server.
timeout: max timeout untill which to wait for cdm key processing.
Return values
DRM_SUCCESSif no errors encountered

Implements AampDrmSession.

Definition at line 552 of file playreadydrmsession.cpp.

◆ decrypt()

PlayReadyDRMSession::decrypt ( const uint8_t *  f_pbIV,
uint32_t  f_cbIV,
const uint8_t *  payloadData,
uint32_t  payloadDataSize,
uint8_t **  ppOpaqueData 
)
virtual

Function to decrypt stream buffer.

Parameters
f_pbIV: Initialization vector.
f_cbIV: Initialization vector length.
payloadData: Data to decrypt.
payloadDataSize: Size of data.
ppOpaqueData: pointer to opaque buffer in case of SVP.
Return values
Returns1 on success 0 on failure.

Reimplemented from AampDrmSession.

Definition at line 612 of file playreadydrmsession.cpp.

◆ getState()

PlayReadyDRMSession::getState ( )
virtual

Get the current state of DRM Session.

Return values
KeyState

Implements AampDrmSession.

Definition at line 711 of file playreadydrmsession.cpp.


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