Media Controller
A GStreamer implementation using the VideoXpert SDK
MediaController::StoppedState Class Reference

Represents a stream that is currently in the stopped state. More...

#include <StreamState.h>

Public Member Functions

virtual ~StoppedState ()
 Virtual destructor. More...
 
bool Play (StreamBase &stream, float speed, unsigned int unixTime) override
 Perform the Play action based on the stream state. More...
 
bool GoToLive (StreamBase &stream) override
 Perform the GoToLive action based on the stream state. More...
 
- Public Member Functions inherited from MediaController::StreamState
virtual ~StreamState ()
 Virtual destructor. More...
 
virtual void Pause (StreamBase &stream)
 Perform the Pause action based on the stream state. More...
 
virtual void Stop (StreamBase &stream)
 Perform the Stop action based on the stream state. More...
 

Additional Inherited Members

- Protected Member Functions inherited from MediaController::StreamState
 StreamState ()
 Constructor. More...
 

Detailed Description

Represents a stream that is currently in the stopped state.

Definition at line 86 of file StreamState.h.

Inherits MediaController::StreamState.

Constructor & Destructor Documentation

virtual MediaController::StoppedState::~StoppedState ( )
inlinevirtual

Virtual destructor.

Definition at line 92 of file StreamState.h.

92 {}

Member Function Documentation

bool StoppedState::GoToLive ( StreamBase stream)
overridevirtual

Perform the GoToLive action based on the stream state.

Parameters
streamThe stream instance.

Reimplemented from MediaController::StreamState.

Definition at line 79 of file StreamState.cpp.

79  {
80  return stream.Play();
81 }
bool Play(float speed=0, unsigned int unixTime=0) override
Call Play on the stream.
Definition: StreamBase.cpp:22
bool StoppedState::Play ( StreamBase stream,
float  speed,
unsigned int  unixTime 
)
overridevirtual

Perform the Play action based on the stream state.

Parameters
streamThe stream instance.
speedThe playback speed.
unixTimeThe start time for playback.

Reimplemented from MediaController::StreamState.

Definition at line 69 of file StreamState.cpp.

69  {
70  // Playing from a stopped state assumes the stream starts in live mode. However,
71  // if a negative speed value is given then the stream will be in playback mode since
72  // it is playing in reverse from live.
73  if (speed < 0 || unixTime != 0)
74  return stream.Play(speed, unixTime == 0 ? Utilities::CurrentUnixTime() : unixTime);
75 
76  return stream.Play();
77 }
bool Play(float speed=0, unsigned int unixTime=0) override
Call Play on the stream.
Definition: StreamBase.cpp:22
unsigned int CurrentUnixTime()
Get the current time as a unix timestamp.
Definition: Utilities.cpp:21

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