RDK Documentation (Open Sourced RDK Components)
AampEventManager Class Reference

Class to Handle Aamp Events. More...

#include <AampEventManager.h>

Collaboration diagram for AampEventManager:
Collaboration graph

Public Member Functions

 AampEventManager (AampLogManager *logObj)
 Default Constructor.
 
 ~AampEventManager ()
 Destructor Function.
 
void SetFakeTuneFlag (bool isFakeTuneSetting)
 SetFakeTuneFlag - Some events are restricted for FakeTune. More...
 
void SetAsyncTuneState (bool isAsyncTuneSetting)
 SetAsyncTuneState - Flag for Async Tune. More...
 
void SetPlayerState (PrivAAMPState state)
 SetPlayerState - Flag to update player state. More...
 
void SendEvent (const AAMPEventPtr &eventData, AAMPEventMode eventMode=AAMP_EVENT_DEFAULT_MODE)
 SendEvent - Generic function to send events. More...
 
void AddListenerForAllEvents (EventListener *eventListener)
 AddListenerForAllEvents - Register one listener for all events. More...
 
void RemoveListenerForAllEvents (EventListener *eventListener)
 RemoveListenerForAllEvents - Remove listener for all events. More...
 
void AddEventListener (AAMPEventType eventType, EventListener *eventListener)
 AddEventListener - Register listener for one eventtype. More...
 
void RemoveEventListener (AAMPEventType eventType, EventListener *eventListener)
 RemoveEventListener - Remove one listener registration for one event. More...
 
bool IsEventListenerAvailable (AAMPEventType eventType)
 IsEventListenerAvailable - Check if any listners present for this event.
 
bool IsSpecificEventListenerAvailable (AAMPEventType eventType)
 IsSpecificEventListenerAvailable - Check if this particular listener present for this event. More...
 
void FlushPendingEvents ()
 FlushPendingEvents - Clear all pending events from EventManager. More...
 
 AampEventManager (const AampEventManager &)=delete
 Copy constructor disabled. More...
 
AampEventManageroperator= (const AampEventManager &)=delete
 assignment operator disabled More...
 

Private Types

typedef std::queue< AAMPEventPtr > EventWorkerDataQ
 
typedef std::map< guint, bool > AsyncEventList
 
typedef std::map< guint, bool >::iterator AsyncEventListIter
 

Private Member Functions

void AsyncEvent ()
 AsyncEvent - Task function for IdleEvent. More...
 
guint GetSourceID ()
 GetSourceID - Get the idle task's source ID. More...
 
void SetCallbackAsDispatched (guint id)
 SetCallbackAsDispatched - Set callbackId as dispatched/done. More...
 
void SetCallbackAsPending (guint id)
 SetCallbackAsPending - Set callbackId as Pending/to be done. More...
 
void SendEventAsync (const AAMPEventPtr &eventData)
 SendEventAsync - Function to send events Async. More...
 
void SendEventSync (const AAMPEventPtr &eventData)
 SendEventSync - Function to send events sync. More...
 

Static Private Member Functions

static gboolean EventManagerThreadFunction (gpointer This)
 Thread entry function for Async Event Processing.
 

Private Attributes

bool mIsFakeTune
 
bool mAsyncTuneEnabled
 
PrivAAMPState mPlayerState
 
pthread_mutex_t mMutexVar
 
int mEventPriority
 
ListenerDatamEventListeners [AAMP_MAX_NUM_EVENTS]
 
int mEventStats [AAMP_MAX_NUM_EVENTS]
 
EventWorkerDataQ mEventWorkerDataQue
 
AsyncEventList mPendingAsyncEvents
 
AampLogManagermLogObj
 

yes

Class to Handle Aamp Events.

Definition at line 55 of file AampEventManager.h.

Member Typedef Documentation

◆ EventWorkerDataQ

typedef std::queue<AAMPEventPtr> AampEventManager::EventWorkerDataQ
private

Event Queue for Async processing

Definition at line 67 of file AampEventManager.h.

◆ AsyncEventList

typedef std::map<guint, bool> AampEventManager::AsyncEventList
private

Collection of Async tasks pending

Definition at line 69 of file AampEventManager.h.

Constructor & Destructor Documentation

◆ AampEventManager()

AampEventManager::AampEventManager ( const AampEventManager )
delete

Copy constructor disabled.

Member Function Documentation

◆ AsyncEvent()

AampEventManager::AsyncEvent ( )
private

AsyncEvent - Task function for IdleEvent.

Returns
void

Definition at line 322 of file AampEventManager.cpp.

◆ GetSourceID()

AampEventManager::GetSourceID ( )
private

GetSourceID - Get the idle task's source ID.

Returns
Source Id

Definition at line 35 of file AampEventManager.cpp.

◆ SetCallbackAsDispatched()

AampEventManager::SetCallbackAsDispatched ( guint  id)
private

SetCallbackAsDispatched - Set callbackId as dispatched/done.

Parameters
id- CallbackId for the IdleEvent
Returns
void

Definition at line 439 of file AampEventManager.cpp.

◆ SetCallbackAsPending()

AampEventManager::SetCallbackAsPending ( guint  id)
private

SetCallbackAsPending - Set callbackId as Pending/to be done.

Parameters
id- CallbackId for the IdleEvent
Returns
void

Definition at line 460 of file AampEventManager.cpp.

◆ SendEventAsync()

AampEventManager::SendEventAsync ( const AAMPEventPtr &  eventData)
private

SendEventAsync - Function to send events Async.

Parameters
eventData- Event data
Returns
void

Definition at line 342 of file AampEventManager.cpp.

◆ SendEventSync()

AampEventManager::SendEventSync ( const AAMPEventPtr &  eventData)
private

SendEventSync - Function to send events sync.

Parameters
eventData- Event data
Returns
void

Definition at line 368 of file AampEventManager.cpp.

◆ SetFakeTuneFlag()

void AampEventManager::SetFakeTuneFlag ( bool  isFakeTuneSetting)

SetFakeTuneFlag - Some events are restricted for FakeTune.

Parameters
isFakeTuneSetting- True for FakeTune
Returns
void

Definition at line 236 of file AampEventManager.cpp.

◆ SetAsyncTuneState()

void AampEventManager::SetAsyncTuneState ( bool  isAsyncTuneSetting)

SetAsyncTuneState - Flag for Async Tune.

Parameters
isAsyncTuneSetting- True for Async tune
Returns
void

Definition at line 246 of file AampEventManager.cpp.

◆ SetPlayerState()

void AampEventManager::SetPlayerState ( PrivAAMPState  state)

SetPlayerState - Flag to update player state.

Parameters
state- Aamp Player state
Returns
void

Definition at line 264 of file AampEventManager.cpp.

◆ SendEvent()

void AampEventManager::SendEvent ( const AAMPEventPtr &  eventData,
AAMPEventMode  eventMode = AAMP_EVENT_DEFAULT_MODE 
)

SendEvent - Generic function to send events.

Parameters
eventData- Event data
eventMode- Aamp Event mode
Returns
void

Definition at line 274 of file AampEventManager.cpp.

◆ AddListenerForAllEvents()

void AampEventManager::AddListenerForAllEvents ( EventListener eventListener)

AddListenerForAllEvents - Register one listener for all events.

Parameters
eventListener- listerner for events
Returns
void

Definition at line 125 of file AampEventManager.cpp.

◆ RemoveListenerForAllEvents()

void AampEventManager::RemoveListenerForAllEvents ( EventListener eventListener)

RemoveListenerForAllEvents - Remove listener for all events.

Parameters
eventListener- listerner for events
Returns
void

Definition at line 140 of file AampEventManager.cpp.

◆ AddEventListener()

void AampEventManager::AddEventListener ( AAMPEventType  eventType,
EventListener eventListener 
)

AddEventListener - Register listener for one eventtype.

Parameters
eventType- Aamp Event type
eventListener- listerner for events
Returns
void

Definition at line 155 of file AampEventManager.cpp.

◆ RemoveEventListener()

void AampEventManager::RemoveEventListener ( AAMPEventType  eventType,
EventListener eventListener 
)

RemoveEventListener - Remove one listener registration for one event.

Parameters
eventType- Aamp Event type
eventListener- listerner for events
Returns
void

Definition at line 179 of file AampEventManager.cpp.

◆ IsSpecificEventListenerAvailable()

bool AampEventManager::IsSpecificEventListenerAvailable ( AAMPEventType  eventType)

IsSpecificEventListenerAvailable - Check if this particular listener present for this event.

Parameters
eventType- Event Type
Returns
True if listner present

Definition at line 206 of file AampEventManager.cpp.

◆ FlushPendingEvents()

void AampEventManager::FlushPendingEvents ( )

FlushPendingEvents - Clear all pending events from EventManager.

Returns
void

Definition at line 85 of file AampEventManager.cpp.

◆ operator=()

AampEventManager& AampEventManager::operator= ( const AampEventManager )
delete

assignment operator disabled

Field Documentation

◆ mIsFakeTune

bool AampEventManager::mIsFakeTune
private

Flag indicating if fake tune enabled or not

Definition at line 59 of file AampEventManager.h.

◆ mAsyncTuneEnabled

bool AampEventManager::mAsyncTuneEnabled
private

Flag indicating if Async tune enabled or not

Definition at line 60 of file AampEventManager.h.

◆ mPlayerState

PrivAAMPState AampEventManager::mPlayerState
private

Player state flag , updated only at start and Release

Definition at line 61 of file AampEventManager.h.

◆ mMutexVar

pthread_mutex_t AampEventManager::mMutexVar
private

Mutex variable to handle pending and dispatch operation

Definition at line 62 of file AampEventManager.h.

◆ mEventPriority

int AampEventManager::mEventPriority
private

Async Event task Priority

Definition at line 63 of file AampEventManager.h.

◆ mEventListeners

ListenerData* AampEventManager::mEventListeners[AAMP_MAX_NUM_EVENTS]
private

Event listener registration

Definition at line 65 of file AampEventManager.h.

◆ mEventStats

int AampEventManager::mEventStats[AAMP_MAX_NUM_EVENTS]
private

Event stats

Definition at line 66 of file AampEventManager.h.


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