|
RDK Documentation (Open Sourced RDK Components)
|
Go to the documentation of this file.
25 #ifndef AampDRMSessionManager_h
26 #define AampDRMSessionManager_h
34 #include <curl/curl.h>
38 #include "sec_client.h"
41 #define VIDEO_SESSION 0
42 #define AUDIO_SESSION 1
71 std::vector<uint8_t> data;
72 pthread_mutex_t sessionMutex;
75 DrmSessionContext() : sessionMutex(PTHREAD_MUTEX_INITIALIZER), drmSession(NULL),data()
81 drmSession = other.drmSession;
86 sessionMutex = other.sessionMutex;
88 drmSession = other.drmSession;
93 pthread_mutex_destroy(&sessionMutex);
104 aamp(NULL), drmType(
eDRM_NONE), drmHelper()
108 unsigned char *initData;
113 std::shared_ptr<AampDrmHelper> drmHelper;
123 std::vector<std::vector<uint8_t>> data;
124 long long creationTime;
155 pthread_mutex_t accessTokenMutex;
156 pthread_mutex_t cachedKeyMutex;
157 pthread_mutex_t mDrmSessionLock;
158 bool curlSessionAbort;
159 bool licenseRequestAbort;
160 bool mEnableAccessAtrributes;
162 #ifdef USE_SECMANAGER
182 static size_t write_callback(
char *ptr,
size_t size,
size_t nmemb,
194 double dlnow,
double ultotal,
double ulnow );
202 void initializeDrmSessions();
223 const unsigned char * initDataPtr, uint16_t dataLength,
MediaType streamType,
224 PrivateInstanceAAMP* aamp, DrmMetaDataEventPtr e,
const unsigned char *contentMetadata =
nullptr,
225 bool isPrimarySession =
false);
232 #if defined(USE_SECCLIENT) || defined(USE_SECMANAGER)
284 void setVideoWindowSize(
int width,
int height);
286 void setPlaybackSpeedState(
int speed,
double position,
bool delayNeeded =
false);
324 const char*
getAccessToken(
int &tokenLength,
long &error_code ,
bool bSslPeerVerify);
340 KeyState handleLicenseResponse(std::shared_ptr<AampDrmHelper> drmHelper,
int sessionSlot,
int &cdmError,
341 int32_t httpResponseCode, int32_t httpExtResponseCode, shared_ptr<DrmData> licenseResponse, DrmMetaDataEventPtr eventHandle,
PrivateInstanceAAMP* aampInstance);
343 KeyState processLicenseResponse(std::shared_ptr<AampDrmHelper> drmHelper,
int sessionSlot,
int &cdmError,
344 shared_ptr<DrmData> licenseResponse, DrmMetaDataEventPtr eventHandle,
PrivateInstanceAAMP* aampInstance);
KeyState getDrmSession(std::shared_ptr< AampDrmHelper > drmHelper, int &selectedSlot, DrmMetaDataEventPtr eventHandle, PrivateInstanceAAMP *aampInstance, bool isPrimarySession=false)
Create a DRM Session using the Drm Helper Determine a slot in the drmSession Contexts which can be us...
AampDRMSessionManager(const AampDRMSessionManager &)=delete
Copy constructor disabled.
Implented DRM helper functionalities.
bool isProcessedLicenseAcquire
AampDrmSession * createDrmSession(const char *systemId, MediaFormat mediaFormat, const unsigned char *initDataPtr, uint16_t dataLength, MediaType streamType, PrivateInstanceAAMP *aamp, DrmMetaDataEventPtr e, const unsigned char *contentMetadata=nullptr, bool isPrimarySession=false)
Creates and/or returns the DRM session corresponding to keyId (Present in initDataPtr) AampDRMSession...
AampDRMSessionManager & operator=(const AampDRMSessionManager &)=delete
assignment operator disabled
Drm Session Data Information for storing in a pool from parser.
To hold DRM key, license request etc.
Holds data regarding drm session.
void setSessionMgrState(SessionMgrState state)
Set Session manager state.
Types and APIs exposed by the AAMP player.
bool getCurlAbort(void)
Get Session abort flag.
Controller for managing DRM sessions.
pthread_t createDRMSessionThreadID
void notifyCleanup()
Resethe current seesion ID.
structure to hold DRM data to write
void clearDrmSession(bool forceClearSession=false)
Clean up the Session Data if license key acquisition failed or if LicenseCaching is false.
const char * getAccessToken(int &tokenLength, long &error_code, bool bSslPeerVerify)
Get the accessToken from authService.
DrmData * getLicense(AampLicenseRequest &licRequest, int32_t *httpError, MediaType streamType, PrivateInstanceAAMP *aamp, bool isContentMetadataAvailable=false, std::string licenseProxy="")
Get DRM license key from DRM server.
static size_t write_callback(char *ptr, size_t size, size_t nmemb, void *userdata)
Curl write callback, used to get the curl o/p from DRM license, accessToken curl requests.
SessionMgrState
Enum to represent session manager state. Session manager would abort any createDrmSession request if ...
Holds the data to get the License.
SessionMgrState getSessionMgrState()
Get Session manager state.
void clearFailedKeyIds()
Clean up the failed keyIds.
bool IsKeyIdUsable(std::vector< uint8_t > keyIdArray)
Get DRM license key from DRM server.
struct DrmSessionParams * sessionData
unsigned char * processedKeyId
bool configureLicenseServerParameters(std::shared_ptr< AampDrmHelper > drmHelper, AampLicenseRequest &licRequest, std::string &licenseServerProxy, const AampChallengeInfo &challengeInfo, PrivateInstanceAAMP *aampInstance)
Configure the Drm license server parameters for URL/proxy and custom http request headers.
Header file for AampDrmSessionFactory.
Base class for DRM sessions.
void setCurlAbort(bool isAbort)
Set Session abort flag.
Context-free common utility functions.
Private functions and types used internally by AAMP.
static int progress_callback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow)
void clearSessionData()
Clean up the memory used by session variables.
Structure to hold, keyId and session creation time for keyId.
Class representing the AAMP player's private instance, which is not exposed to outside world.
KeyState initializeDrmSession(std::shared_ptr< AampDrmHelper > drmHelper, int sessionSlot, DrmMetaDataEventPtr eventHandle, PrivateInstanceAAMP *aampInstance)
Initialize the Drm System with InitData(PSSH)
KeyState acquireLicense(std::shared_ptr< AampDrmHelper > drmHelper, int sessionSlot, int &cdmError, DrmMetaDataEventPtr eventHandle, PrivateInstanceAAMP *aampInstance, MediaType streamType)
sent license challenge to the DRM server and provide the respone to CDM
To store drmSession and keyId data.
void setLicenseRequestAbort(bool isAbort)
Get Session abort flag.
KeyState
DRM session states.
bool drmSessionThreadStarted
DRMSystems
DRM system types.
void clearAccessToken()
Clean up the memory for accessToken.
~AampDRMSessionManager()
AampDRMSessionManager Destructor.
Aamp challenge info to get the License.
Drm Session Cache Information for keeping single DRM session always.
Header file for AampDrmSession.