25 #ifndef PlayReadyDrmSession_h
26 #define PlayReadyDrmSession_h
30 #include <drmbuild_oem.h>
31 #include <drmcommon.h>
32 #include <drmmanager.h>
33 #include <drmmathsafe.h>
40 #define ChkBufferSize(a,b) do { \
41 ChkBOOL((a) <= (b), DRM_E_FAIL); \
52 DRM_APP_CONTEXT *m_ptrAppContext;
53 DRM_DECRYPT_CONTEXT m_oDecryptContext;
58 DRM_BYTE *m_sbRevocateBuf;
60 DRM_CHAR m_rgchSesnID[CCH_BASE64_EQUIV(SIZEOF(DRM_ID)) + 1];
66 DRM_BYTE *m_pbChallenge;
67 DRM_DWORD m_cbChallenge;
68 DRM_CHAR *m_ptrDestURL;
69 pthread_mutex_t decryptMutex;
76 void initAampDRMSession();
85 int _GetPROFromInitData(
const DRM_BYTE *f_pbInitData,
86 DRM_DWORD f_cbInitData, DRM_DWORD *f_pibPRO, DRM_DWORD *f_pcbPRO);
93 int _ParseInitData(
const uint8_t *f_pbInitData, uint32_t f_cbInitData);
110 void generateAampDRMSession(
const uint8_t *f_pbInitData,
111 uint32_t f_cbInitData, std::string &customData);
118 DrmData * aampGenerateKeyRequest(
string& destinationURL, uint32_t timeout);
125 int aampDRMProcessKey(
DrmData* key, uint32_t timeout);
135 int decrypt(
const uint8_t *f_pbIV, uint32_t f_cbIV,
136 const uint8_t *payloadData, uint32_t payloadDataSize, uint8_t **ppOpaqueData);
146 void clearDecryptContext();