Shaka Player Embedded
Public Member Functions | List of all members
shaka::media::PipelineManager Class Reference

#include <pipeline_manager.h>

Public Member Functions

 PipelineManager (std::function< void(VideoPlaybackState)> on_status_changed, std::function< void()> on_seek, const util::Clock *clock)
 
virtual ~PipelineManager ()
 
virtual void Reset ()
 
virtual void DoneInitializing ()
 
virtual VideoPlaybackState GetPlaybackState () const
 
virtual double GetDuration () const
 
virtual void SetDuration (double duration)
 
virtual double GetCurrentTime () const
 
virtual void SetCurrentTime (double time)
 
virtual double GetPlaybackRate () const
 
virtual void SetPlaybackRate (double rate)
 
virtual void Play ()
 
virtual void Pause ()
 
virtual void Buffering ()
 
virtual void CanPlay ()
 
virtual void OnEnded ()
 
virtual void OnError ()
 

Detailed Description

Tracks the current playhead time and tracks the pipeline status. This handles playback rate, pause/play, and tracking current time. The caller is in charge of tracking the amount of content that is buffered and whether playback is actually possible.

This type is thread safe; however if calls are made to this from multiple threads at once, it is unspecified what order the changes will happen including the order of the calls to |on_status_changed|. The callback is invoked without the lock held, which allows for calls back into this object; but this means that another thread could make a state change before the callback is completed. This also means that the callback can be invoked multiple times concurrently.

Definition at line 42 of file pipeline_manager.h.

Constructor & Destructor Documentation

§ PipelineManager()

shaka::media::PipelineManager::PipelineManager ( std::function< void(VideoPlaybackState)>  on_status_changed,
std::function< void()>  on_seek,
const util::Clock clock 
)

Definition at line 26 of file pipeline_manager.cc.

§ ~PipelineManager()

shaka::media::PipelineManager::~PipelineManager ( )
virtual

Definition at line 36 of file pipeline_manager.cc.

Member Function Documentation

§ Buffering()

void shaka::media::PipelineManager::Buffering ( )
virtual

Called when the video stalls due to lack of content.

Definition at line 195 of file pipeline_manager.cc.

§ CanPlay()

void shaka::media::PipelineManager::CanPlay ( )
virtual

Called when the video has enough content to play forward.

Definition at line 209 of file pipeline_manager.cc.

§ DoneInitializing()

void shaka::media::PipelineManager::DoneInitializing ( )
virtual

Tells the manager that we have gotten all the initialization data.

Definition at line 48 of file pipeline_manager.cc.

§ GetCurrentTime()

double shaka::media::PipelineManager::GetCurrentTime ( ) const
virtual
Returns
The current video time, in seconds.

Definition at line 106 of file pipeline_manager.cc.

§ GetDuration()

double shaka::media::PipelineManager::GetDuration ( ) const
virtual
Returns
The current video duration.

Definition at line 69 of file pipeline_manager.cc.

§ GetPlaybackRate()

double shaka::media::PipelineManager::GetPlaybackRate ( ) const
virtual
Returns
The current playback rate.

Definition at line 145 of file pipeline_manager.cc.

§ GetPlaybackState()

VideoPlaybackState shaka::media::PipelineManager::GetPlaybackState ( ) const
virtual
Returns
The current pipeline status.

Definition at line 64 of file pipeline_manager.cc.

§ OnEnded()

void shaka::media::PipelineManager::OnEnded ( )
virtual

Called when the video should end. Note that the current time is always clamped to duration, so this only raises the event.

Definition at line 227 of file pipeline_manager.cc.

§ OnError()

void shaka::media::PipelineManager::OnError ( )
virtual

Called when an error occurs and the pipeline should stop forever.

Definition at line 244 of file pipeline_manager.cc.

§ Pause()

void shaka::media::PipelineManager::Pause ( )
virtual

Pauses the video.

Definition at line 179 of file pipeline_manager.cc.

§ Play()

void shaka::media::PipelineManager::Play ( )
virtual

Starts playing the video.

Definition at line 156 of file pipeline_manager.cc.

§ Reset()

void shaka::media::PipelineManager::Reset ( )
virtual

Resets the state to the initial state; this doesn't raise events.

Definition at line 38 of file pipeline_manager.cc.

§ SetCurrentTime()

void shaka::media::PipelineManager::SetCurrentTime ( double  time)
virtual

Seeks to the given video time.

Definition at line 111 of file pipeline_manager.cc.

§ SetDuration()

void shaka::media::PipelineManager::SetDuration ( double  duration)
virtual

Sets the video duration.

Definition at line 74 of file pipeline_manager.cc.

§ SetPlaybackRate()

void shaka::media::PipelineManager::SetPlaybackRate ( double  rate)
virtual

Sets the current playback rate.

Definition at line 150 of file pipeline_manager.cc.


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