RDK Documentation (Open Sourced RDK Components)
AampSecManager Class Reference

Class to get License from Sec Manager. More...

#include <AampSecManager.h>

Inheritance diagram for AampSecManager:
Inheritance graph
Collaboration diagram for AampSecManager:
Collaboration graph

Public Member Functions

bool AcquireLicense (PrivateInstanceAAMP *aamp, const char *licenseUrl, const char *moneyTraceMetdata[][2], const char *accessAttributes[][2], const char *contentMetadata, size_t contentMetadataLen, const char *licenseRequest, size_t licenseRequestLen, const char *keySystemId, const char *mediaUsage, const char *accessToken, size_t accessTokenLen, int64_t *sessionId, char **licenseResponse, size_t *licenseResponseLength, int32_t *statusCode, int32_t *reasonCode, int32_t *businessStatus)
 To acquire license from SecManager. More...
 
void UpdateSessionState (int64_t sessionId, bool active)
 To update session state to SecManager. More...
 
void ReleaseSession (int64_t sessionId)
 To notify SecManager to release a session. More...
 
bool setVideoWindowSize (int64_t sessionId, int64_t video_width, int64_t video_height)
 To update session state to SecManager. More...
 
bool setPlaybackSpeedState (int64_t sessionId, int64_t playback_speed, int64_t playback_position, bool delayNeeded=false)
 To set Playback Speed State to SecManager. More...
 
bool loadClutWatermark (int64_t sessionId, int64_t graphicId, int64_t watermarkClutBufferKey, int64_t watermarkImageBufferKey, int64_t clutPaletteSize, const char *clutPaletteFormat, int64_t watermarkWidth, int64_t watermarkHeight, float aspectRatio)
 To Load ClutWatermark. More...
 
- Public Member Functions inherited from AampScheduler
 AampScheduler ()
 AampScheduler Constructor.
 
 AampScheduler (const AampScheduler &)=delete
 
AampScheduleroperator= (const AampScheduler &)=delete
 
virtual ~AampScheduler ()
 AampScheduler Destructor.
 
int ScheduleTask (AsyncTaskObj obj)
 To schedule a task to be executed later. More...
 
void RemoveAllTasks ()
 To remove all scheduled tasks and prevent further tasks from scheduling. More...
 
bool RemoveTask (int id)
 To remove a scheduled tasks with ID. More...
 
void StartScheduler ()
 To start scheduler thread. More...
 
void StopScheduler ()
 To stop scheduler and associated resources. More...
 
void SuspendScheduler ()
 To acquire execution lock for synchronisation purposes. More...
 
void ResumeScheduler ()
 To release execution lock. More...
 
void EnableScheduleTask ()
 To enable scheduler to queue new tasks. More...
 
void SetState (PrivAAMPState sstate)
 To player state to Scheduler. More...
 
void SetLogger (AampLogManager *logObj)
 Set the logger instance for the Scheduler. More...
 

Static Public Member Functions

static AampSecManagerGetInstance ()
 To get AampSecManager instance. More...
 
static void DestroyInstance ()
 To release AampSecManager singelton instance.
 

Private Member Functions

 AampSecManager ()
 AampScheduler Constructor.
 
 ~AampSecManager ()
 AampScheduler Destructor.
 
 AampSecManager (const AampSecManager &)=delete
 Copy constructor disabled. More...
 
AampSecManageroperator= (const AampSecManager &)=delete
 assignment operator disabled More...
 
void RegisterEvent (string eventName, std::function< void(const WPEFramework::Core::JSON::VariantContainer &)> functionHandler)
 Registers Event to input plugin and to mRegisteredEvents list for later use. More...
 
void RegisterAllEvents ()
 Registers all Events to input plugin.
 
void UnRegisterAllEvents ()
 UnRegisters all Events from plugin.
 
void watermarkSessionHandler (const JsonObject &parameters)
 Detects watermarking session conditions. More...
 
void addWatermarkHandler (const JsonObject &parameters)
 Gets watermark image details and manages watermark rendering. More...
 
void updateWatermarkHandler (const JsonObject &parameters)
 Gets updated watermark image details and manages watermark rendering. More...
 
void removeWatermarkHandler (const JsonObject &parameters)
 Removes watermark image. More...
 
void showWatermarkHandler (const JsonObject &parameters)
 Handles watermark calls to be only once. More...
 
void ShowWatermark (bool show)
 Show watermark image.
 
void CreateWatermark (int graphicId, int zIndex)
 Create Watermark.
 
void DeleteWatermark (int graphicId)
 Delete Watermark.
 
void UpdateWatermark (int graphicId, int smKey, int smSize)
 Update Wateramrk.
 
void AlwaysShowWatermarkOnTop (bool show)
 Show watermark image This method need to be used only when RDKShell is used for rendering. Not supported by Watermark Plugin.
 
void GetWaterMarkPalette (int sessionId, int graphicId)
 GetWaterMarkPalette.
 
void ModifyWatermarkPalette (int graphicId, int clutKey, int imageKey)
 ModifyWatermarkPalette.
 

Private Attributes

PrivateInstanceAAMPmAamp
 
ThunderAccessAAMP mSecManagerObj
 
ThunderAccessAAMP mWatermarkPluginObj
 
std::mutex mSecMutex
 
std::mutex mWatMutex
 
std::mutex mSpeedStateMutex
 
std::list< std::string > mRegisteredEvents
 
bool mSchedulerStarted
 

Static Private Attributes

static AampSecManagermInstance = NULL
 

Additional Inherited Members

- Protected Member Functions inherited from AampScheduler
void ExecuteAsyncTask ()
 Executes scheduled tasks - invoked by thread. More...
 
- Protected Attributes inherited from AampScheduler
AampLogManagermLogObj
 
std::deque< AsyncTaskObjmTaskQueue
 
std::mutex mQMutex
 
std::condition_variable mQCond
 
bool mSchedulerRunning
 
std::thread mSchedulerThread
 
std::mutex mExMutex
 
std::unique_lock< std::mutex > mExLock
 
int mNextTaskId
 
int mCurrentTaskId
 
bool mLockOut
 
PrivAAMPState mState
 

yes

Class to get License from Sec Manager.

Definition at line 41 of file AampSecManager.h.

Constructor & Destructor Documentation

◆ AampSecManager()

AampSecManager::AampSecManager ( const AampSecManager )
privatedelete

Copy constructor disabled.

Member Function Documentation

◆ GetInstance()

AampSecManager::GetInstance ( )
static

To get AampSecManager instance.

Returns
AampSecManager instance

Definition at line 35 of file AampSecManager.cpp.

◆ AcquireLicense()

AampSecManager::AcquireLicense ( PrivateInstanceAAMP aamp,
const char *  licenseUrl,
const char *  moneyTraceMetdata[][2],
const char *  accessAttributes[][2],
const char *  contentMetadata,
size_t  contentMetadataLen,
const char *  licenseRequest,
size_t  licenseRequestLen,
const char *  keySystemId,
const char *  mediaUsage,
const char *  accessToken,
size_t  accessTokenLen,
int64_t *  sessionId,
char **  licenseResponse,
size_t *  licenseResponseLength,
int32_t *  statusCode,
int32_t *  reasonCode,
int32_t *  businessStatus 
)

To acquire license from SecManager.

Parameters
[in]licenseUrl- url to fetch license from
[in]moneyTraceMetdata- moneytrace info
[in]accessAttributes- accessAttributes info
[in]contentMetadata- content metadata info
[in]licenseRequest- license challenge info
[in]keySystemId- unique system ID of drm
[in]mediaUsage- indicates whether its stream or download license request
[in]accessToken- access token info
[out]sessionId- ID of current session
[out]licenseResponse- license response
[out]licenseResponseLength- len of license response
[out]statusCode- license fetch status code
[out]reasonCode- license fetch reason code
Returns
bool - true if license fetch successful, false otherwise

Definition at line 100 of file AampSecManager.cpp.

◆ UpdateSessionState()

AampSecManager::UpdateSessionState ( int64_t  sessionId,
bool  active 
)

To update session state to SecManager.

Parameters
[in]sessionId- session id
[in]active- true if session is active, false otherwise

Definition at line 314 of file AampSecManager.cpp.

◆ ReleaseSession()

AampSecManager::ReleaseSession ( int64_t  sessionId)

To notify SecManager to release a session.

Parameters
[in]sessionId- session id

Definition at line 354 of file AampSecManager.cpp.

◆ setVideoWindowSize()

AampSecManager::setVideoWindowSize ( int64_t  sessionId,
int64_t  video_width,
int64_t  video_height 
)

To update session state to SecManager.

Parameters
[in]sessionId- session id
[in]video_width- video width
[in]video_height- video height

Definition at line 388 of file AampSecManager.cpp.

◆ setPlaybackSpeedState()

AampSecManager::setPlaybackSpeedState ( int64_t  sessionId,
int64_t  playback_speed,
int64_t  playback_position,
bool  delayNeeded = false 
)

To set Playback Speed State to SecManager.

Parameters
[in]sessionId- session id
[in]playback_speed- playback speed
[in]playback_position- playback position
[in]delayNeeded- if delay is required, to avoid any wm flash before tune

Definition at line 425 of file AampSecManager.cpp.

◆ loadClutWatermark()

AampSecManager::loadClutWatermark ( int64_t  sessionId,
int64_t  graphicId,
int64_t  watermarkClutBufferKey,
int64_t  watermarkImageBufferKey,
int64_t  clutPaletteSize,
const char *  clutPaletteFormat,
int64_t  watermarkWidth,
int64_t  watermarkHeight,
float  aspectRatio 
)

To Load ClutWatermark.

Parameters
[in]sessionId- session id

Definition at line 469 of file AampSecManager.cpp.

◆ operator=()

AampSecManager* AampSecManager::operator= ( const AampSecManager )
privatedelete

assignment operator disabled

◆ RegisterEvent()

AampSecManager::RegisterEvent ( string  eventName,
std::function< void(const WPEFramework::Core::JSON::VariantContainer &)>  functionHandler 
)
private

Registers Event to input plugin and to mRegisteredEvents list for later use.

Parameters
[in]eventName: Event name
[in]functionHandler: Event funciton pointer

Definition at line 514 of file AampSecManager.cpp.

◆ watermarkSessionHandler()

AampSecManager::watermarkSessionHandler ( const JsonObject &  parameters)
private

Detects watermarking session conditions.

Parameters
parameters- i/p JsonObject params

Definition at line 565 of file AampSecManager.cpp.

◆ addWatermarkHandler()

AampSecManager::addWatermarkHandler ( const JsonObject &  parameters)
private

Gets watermark image details and manages watermark rendering.

Parameters
parameters- i/p JsonObject params

Definition at line 579 of file AampSecManager.cpp.

◆ updateWatermarkHandler()

AampSecManager::updateWatermarkHandler ( const JsonObject &  parameters)
private

Gets updated watermark image details and manages watermark rendering.

Parameters
parameters- i/p JsonObject params

Definition at line 636 of file AampSecManager.cpp.

◆ removeWatermarkHandler()

AampSecManager::removeWatermarkHandler ( const JsonObject &  parameters)
private

Removes watermark image.

Parameters
parameters- i/p JsonObject params

Definition at line 655 of file AampSecManager.cpp.

◆ showWatermarkHandler()

AampSecManager::showWatermarkHandler ( const JsonObject &  parameters)
private

Handles watermark calls to be only once.

Parameters
parameters- i/p JsonObject params

Definition at line 686 of file AampSecManager.cpp.

Field Documentation

◆ mInstance

AampSecManager * AampSecManager::mInstance = NULL
staticprivate

singleton instance

Definition at line 214 of file AampSecManager.h.

◆ mAamp

PrivateInstanceAAMP* AampSecManager::mAamp
private

Pointer to the PrivateInstanceAAMP

Definition at line 215 of file AampSecManager.h.

◆ mSecManagerObj

ThunderAccessAAMP AampSecManager::mSecManagerObj
private

ThunderAccessAAMP object for communicating with SecManager

Definition at line 216 of file AampSecManager.h.

◆ mWatermarkPluginObj

ThunderAccessAAMP AampSecManager::mWatermarkPluginObj
private

ThunderAccessAAMP object for communicating with Watermark Plugin Obj

Definition at line 217 of file AampSecManager.h.

◆ mSecMutex

std::mutex AampSecManager::mSecMutex
private

Lock for accessing mSecManagerObj

Definition at line 218 of file AampSecManager.h.

◆ mWatMutex

std::mutex AampSecManager::mWatMutex
private

Lock for accessing mWatermarkPluginObj

Definition at line 219 of file AampSecManager.h.

◆ mSpeedStateMutex

std::mutex AampSecManager::mSpeedStateMutex
private

Lock for accessing mWatermarkPluginObj

Definition at line 220 of file AampSecManager.h.


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