25 #ifndef ClearKeySession_h
26 #define ClearKeySession_h
29 #include "openssl/evp.h"
34 #include <cjson/cJSON.h>
46 pthread_mutex_t decryptMutex;
50 unsigned char* m_keyStr;
52 unsigned char* m_keyId;
57 void initAampDRMSession();
58 #if OPENSSL_VERSION_NUMBER >= 0x10100000L
59 EVP_CIPHER_CTX *mOpensslCtx;
61 EVP_CIPHER_CTX mOpensslCtx;
90 void generateAampDRMSession(
const uint8_t *f_pbInitData,
91 uint32_t f_cbInitData, std::string &customData);
99 DrmData * aampGenerateKeyRequest(
string& destinationURL, uint32_t timeout);
107 int aampDRMProcessKey(
DrmData* key, uint32_t timeout);
114 void setKeyId(
const char* keyId, int32_t keyIDLen);
125 int decrypt(
const uint8_t *f_pbIV, uint32_t f_cbIV,
126 const uint8_t *payloadData, uint32_t payloadDataSize, uint8_t **ppOpaqueData);
138 int decrypt(GstBuffer* keyIDBuffer, GstBuffer* ivBuffer, GstBuffer* buffer,
unsigned subSampleCount,
139 GstBuffer* subSamplesBuffer, GstCaps* caps);
150 void clearDecryptContext();