RDK Documentation (Open Sourced RDK Components)
PrivateCDAIObjectMPD Class Reference

Private Client Side DAI object for DASH. More...

#include <admanager_mpd.h>

Collaboration diagram for PrivateCDAIObjectMPD:
Collaboration graph

Public Member Functions

 PrivateCDAIObjectMPD (AampLogManager *logObj, PrivateInstanceAAMP *aamp)
 PrivateCDAIObjectMPD constructor.
 
 ~PrivateCDAIObjectMPD ()
 PrivateCDAIObjectMPD destructor.
 
 PrivateCDAIObjectMPD (const PrivateCDAIObjectMPD &)=delete
 PrivateCDAIObjectMPD copy constructor.
 
PrivateCDAIObjectMPDoperator= (const PrivateCDAIObjectMPD &)=delete
 PrivateCDAIObjectMPD assignment operator.
 
void SetAlternateContents (const std::string &periodId, const std::string &adId, const std::string &url, uint64_t startMS, uint32_t breakdur=0)
 Setting the alternate contents' (Ads/blackouts) URL. More...
 
void FulFillAdObject ()
 Method for fullfilling the Ad.
 
MPD * GetAdMPD (std::string &url, bool &finalManifest, bool tryFog=false)
 Method for downloading and parsing Ad's MPD. More...
 
void InsertToPeriodMap (IPeriod *period)
 Method to insert period into period map. More...
 
bool isPeriodExist (const std::string &periodId)
 Method to check the existence of period in the period map. More...
 
bool isAdBreakObjectExist (const std::string &adBrkId)
 Method to check the existence of Adbreak object in the AdbreakObject map. More...
 
void PrunePeriodMaps (std::vector< std::string > &newPeriodIds)
 Method to remove expired periods from the period map. More...
 
void ResetState ()
 Method to reset the state of the CDAI state machine.
 
void ClearMaps ()
 Method to clear the maps in the CDAI object.
 
void PlaceAds (dash::mpd::IMPD *mpd)
 Method to create a bidirectional between the ads and the underlying content periods.
 
int CheckForAdStart (const float &rate, bool init, const std::string &periodId, double offSet, std::string &breakId, double &adOffset)
 Checking to see if a period is the begining of the Adbreak or not. More...
 
bool CheckForAdTerminate (double fragmentTime)
 Checking to see if the position in a period corresponds to an end of Ad playback or not. More...
 
bool isPeriodInAdbreak (const std::string &periodId)
 Checking to see if a period has Adbreak. More...
 

Data Fields

AampLogManagermLogObj
 
PrivateInstanceAAMPmAamp
 
std::mutex mDaiMtx
 
bool mIsFogTSB
 
std::unordered_map< std::string, AdBreakObjectmAdBreaks
 
std::unordered_map< std::string, Period2AdDatamPeriodMap
 
std::string mCurPlayingBreakId
 
pthread_t mAdObjThreadID
 
bool mAdObjThreadStarted
 
bool mAdFailed
 
std::shared_ptr< std::vector< AdNode > > mCurAds
 
int mCurAdIdx
 
AdFulfillObj mAdFulfillObj
 
PlacementObj mPlacementObj
 
PlacementObj mAdtoInsertInNextBreak
 
double mContentSeekOffset
 
AdState mAdState
 

yes

Private Client Side DAI object for DASH.

Definition at line 278 of file admanager_mpd.h.

Member Function Documentation

◆ SetAlternateContents()

PrivateCDAIObjectMPD::SetAlternateContents ( const std::string &  periodId,
const std::string &  adId,
const std::string &  url,
uint64_t  startMS,
uint32_t  breakdur = 0 
)

Setting the alternate contents' (Ads/blackouts) URL.

Parameters
[in]periodId- Adbreak's unique identifier.
[in]adId- Individual Ad's id
[in]url- Ad URL
[in]startMS- Ad start time in milliseconds
[in]breakdur- Adbreak's duration in MS

Definition at line 762 of file admanager_mpd.cpp.

◆ GetAdMPD()

PrivateCDAIObjectMPD::GetAdMPD ( std::string &  manifestUrl,
bool &  finalManifest,
bool  tryFog = false 
)

Method for downloading and parsing Ad's MPD.

Returns
Pointer to the MPD object
Parameters
[in]url- Ad manifest's URL
[out]finalManifest- Is final MPD or the final MPD should be downloaded later
[in]tryFog- Attempt to download from FOG or not

Definition at line 518 of file admanager_mpd.cpp.

◆ InsertToPeriodMap()

PrivateCDAIObjectMPD::InsertToPeriodMap ( IPeriod *  period)

Method to insert period into period map.

Parameters
[in]period- Pointer of the period to be inserted

Definition at line 98 of file admanager_mpd.cpp.

◆ isPeriodExist()

PrivateCDAIObjectMPD::isPeriodExist ( const std::string &  periodId)

Method to check the existence of period in the period map.

Parameters
[in]periodId- Period id to be checked.
Returns
true or false

Definition at line 110 of file admanager_mpd.cpp.

◆ isAdBreakObjectExist()

bool PrivateCDAIObjectMPD::isAdBreakObjectExist ( const std::string &  adBrkId)
inline

Method to check the existence of Adbreak object in the AdbreakObject map.

Parameters
[in]adBrkId- Adbreak id to be checked.
Returns
true or false

Definition at line 118 of file admanager_mpd.cpp.

◆ PrunePeriodMaps()

PrivateCDAIObjectMPD::PrunePeriodMaps ( std::vector< std::string > &  newPeriodIds)

Method to remove expired periods from the period map.

Parameters
[in]newPeriodIds- Period ids from the latest manifest

Definition at line 126 of file admanager_mpd.cpp.

◆ CheckForAdStart()

PrivateCDAIObjectMPD::CheckForAdStart ( const float &  rate,
bool  init,
const std::string &  periodId,
double  offSet,
std::string &  breakId,
double &  adOffset 
)

Checking to see if a period is the begining of the Adbreak or not.

Returns
Ad index, if the period has an ad over it. Else -1
Parameters
[in]rate- Playback rate
[in]periodId- Period id to be checked
[in]offSet- Period offset to be checked
[out]breakId- Id of the Adbreak, if the period & offset falls in an Adbreak
[out]adOffset- Offset of the Ad for that point of the period

Definition at line 422 of file admanager_mpd.cpp.

◆ CheckForAdTerminate()

PrivateCDAIObjectMPD::CheckForAdTerminate ( double  fragmentTime)

Checking to see if the position in a period corresponds to an end of Ad playback or not.

Parameters
[in]fragmentTime- Current offset in the period
Returns
True or false

Definition at line 494 of file admanager_mpd.cpp.

◆ isPeriodInAdbreak()

PrivateCDAIObjectMPD::isPeriodInAdbreak ( const std::string &  periodId)
inline

Checking to see if a period has Adbreak.

Parameters
[in]periodId- Period id
Returns
True or false

Definition at line 508 of file admanager_mpd.cpp.

Field Documentation

◆ mAamp

PrivateInstanceAAMP* PrivateCDAIObjectMPD::mAamp

AAMP player's private instance

Definition at line 282 of file admanager_mpd.h.

◆ mDaiMtx

std::mutex PrivateCDAIObjectMPD::mDaiMtx

Mutex protecting DAI critical section

Definition at line 283 of file admanager_mpd.h.

◆ mIsFogTSB

bool PrivateCDAIObjectMPD::mIsFogTSB

Channel playing from TSB or not

Definition at line 284 of file admanager_mpd.h.

◆ mAdBreaks

std::unordered_map<std::string, AdBreakObject> PrivateCDAIObjectMPD::mAdBreaks

Periodid to adbreakobject map

Definition at line 285 of file admanager_mpd.h.

◆ mPeriodMap

std::unordered_map<std::string, Period2AdData> PrivateCDAIObjectMPD::mPeriodMap

periodId to Ad map

Definition at line 286 of file admanager_mpd.h.

◆ mCurPlayingBreakId

std::string PrivateCDAIObjectMPD::mCurPlayingBreakId

Currently playing Ad

Definition at line 287 of file admanager_mpd.h.

◆ mAdObjThreadID

pthread_t PrivateCDAIObjectMPD::mAdObjThreadID

ThreadId of Ad fulfillment

Definition at line 288 of file admanager_mpd.h.

◆ mAdObjThreadStarted

bool PrivateCDAIObjectMPD::mAdObjThreadStarted

Flag denotes if ad object thread is started

Definition at line 289 of file admanager_mpd.h.

◆ mAdFailed

bool PrivateCDAIObjectMPD::mAdFailed

Current Ad playback failed flag

Definition at line 290 of file admanager_mpd.h.

◆ mCurAds

std::shared_ptr<std::vector<AdNode> > PrivateCDAIObjectMPD::mCurAds

Vector of ads from the current Adbreak

Definition at line 291 of file admanager_mpd.h.

◆ mCurAdIdx

int PrivateCDAIObjectMPD::mCurAdIdx

Currently playing Ad index

Definition at line 292 of file admanager_mpd.h.

◆ mAdFulfillObj

AdFulfillObj PrivateCDAIObjectMPD::mAdFulfillObj

Temporary object for Ad fulfillment (to pass to the fulfillment thread)

Definition at line 293 of file admanager_mpd.h.

◆ mPlacementObj

PlacementObj PrivateCDAIObjectMPD::mPlacementObj

Temporary object for Ad placement over period

Definition at line 294 of file admanager_mpd.h.

◆ mContentSeekOffset

double PrivateCDAIObjectMPD::mContentSeekOffset

Seek offset after the Ad playback

Definition at line 296 of file admanager_mpd.h.

◆ mAdState

AdState PrivateCDAIObjectMPD::mAdState

Current state of the CDAI state machine

Definition at line 297 of file admanager_mpd.h.


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