Shaka Packager SDK
Public Member Functions | List of all members
shaka::media::SyncPointQueue Class Reference

A synchronized queue for cue points. More...

#include <sync_point_queue.h>

Public Member Functions

 SyncPointQueue (const AdCueGeneratorParams &params)
 
void AddThread ()
 
void Cancel ()
 Cancel the queue and unblock all threads.
 
double GetHint (double time_in_seconds)
 
std::shared_ptr< const CueEventGetNext (double hint_in_seconds)
 
std::shared_ptr< const CueEventPromoteAt (double time_in_seconds)
 
bool HasMore (double hint_in_seconds) const
 

Detailed Description

A synchronized queue for cue points.

Definition at line 20 of file sync_point_queue.h.

Member Function Documentation

◆ AddThread()

void shaka::media::SyncPointQueue::AddThread ( )

Add a new thread. Each thread using this instance must call this method in order to keep track of its clients.

Definition at line 27 of file sync_point_queue.cc.

◆ GetHint()

double shaka::media::SyncPointQueue::GetHint ( double  time_in_seconds)
Returns
A hint for when the next cue event would be. The returned hint is not less than time_in_seconds. The actual time for the next cue event will not be less than the returned hint, with the exact value depends on promotion.

Definition at line 40 of file sync_point_queue.cc.

◆ GetNext()

std::shared_ptr< const CueEvent > shaka::media::SyncPointQueue::GetNext ( double  hint_in_seconds)
Returns
The next cue based on a previous hint. If a cue has been promoted that comes after hint_in_seconds it is returned. If no cue after hint_in_seconds has been promoted, this will block until either a cue is promoted or all threads are blocked (in which case, the unpromoted cue at hint_in_seconds will be self-promoted and returned) or Cancel() is called.

Definition at line 56 of file sync_point_queue.cc.

◆ HasMore()

bool shaka::media::SyncPointQueue::HasMore ( double  hint_in_seconds) const
Returns
True if there are more cues after the given hint. The hint must be a hint returned from |GetHint|. Using any other value results in undefined behavior.

Definition at line 92 of file sync_point_queue.cc.

◆ PromoteAt()

std::shared_ptr< const CueEvent > shaka::media::SyncPointQueue::PromoteAt ( double  time_in_seconds)

Promote the first cue that is not greater than time_in_seconds. All unpromoted cues before the cue will be discarded.

Definition at line 86 of file sync_point_queue.cc.


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