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

The base class for the different stream types. More...

#include <StreamBase.h>

Public Member Functions

virtual ~StreamBase ()
 Virtual destructor. More...
 
bool Play (float speed=0, unsigned int unixTime=0) override
 Call Play on the stream. More...
 
void Pause () override
 Call Pause on the stream. More...
 
void Stop () override
 Call TearDown on the stream. More...
 
void NewRequest (MediaRequest &request) override
 Set the stream to a new source. More...
 
virtual bool Resume (float speed=0, unsigned int unixTime=0)
 Send PLAY on an existing stream. More...
 
GstWrapperGetGstreamer () const
 Get the current GStreamer wrapper instance. More...
 
unsigned int GetLastTimestamp () const
 Gets the current time of the stream. More...
 
Mode GetMode () override
 Get the current playback mode. More...
 
- Public Member Functions inherited from MediaController::IStream
virtual ~IStream ()
 Virtual destructor. More...
 
virtual void PlayStream (float speed, unsigned int unixTime)=0
 
virtual bool GoToLive ()=0
 Set the stream to Live and call Play. More...
 

Public Attributes

StreamStatestate
 The current state of the stream. More...
 
VxSdk::VxStreamProtocol::Value protocol
 The protocol of the stream. More...
 

Protected Member Functions

 StreamBase (MediaRequest &request)
 Constructor. More...
 

Protected Attributes

MediaRequest _mediaRequest
 
GstWrapper_gst
 

Private Member Functions

 StreamBase ()
 Default constructor. More...
 

Additional Inherited Members

- Public Types inherited from MediaController::IStream
enum  Mode {
  kStopped,
  kLive,
  kPlayback
}
 Values that represent the different playback modes. More...
 

Detailed Description

The base class for the different stream types.

Definition at line 14 of file StreamBase.h.

Inherits MediaController::IStream.

Inherited by MediaController::MjpegPull::Stream, and MediaController::Rtsp::Stream.

Constructor & Destructor Documentation

StreamBase::~StreamBase ( )
virtual

Virtual destructor.

Definition at line 18 of file StreamBase.cpp.

18  {
19 
20 }
StreamBase::StreamBase ( MediaRequest request)
protected

Constructor.

Parameters
requestThe requested media.

Definition at line 12 of file StreamBase.cpp.

12  :
13  _mediaRequest(request) {
14  // Build a new pipeline using the description generated above.
15  this->_gst = new GstWrapper();
16 }
Manages the GStreamer instance.
Definition: GstWrapper.h:13
MediaRequest _mediaRequest
Definition: StreamBase.h:72
StreamBase::StreamBase ( )
private

Default constructor.

Definition at line 10 of file StreamBase.cpp.

10 {}

Member Function Documentation

GstWrapper * StreamBase::GetGstreamer ( ) const

Get the current GStreamer wrapper instance.

Returns
The current GstWrapper instance.

Definition at line 32 of file StreamBase.cpp.

32  {
33  return this->_gst;
34 }
unsigned int StreamBase::GetLastTimestamp ( ) const

Gets the current time of the stream.

Returns
The last timestamp received.

Definition at line 36 of file StreamBase.cpp.

36  {
37  return this->_gst->GetLastTimestamp();
38 }
unsigned int GetLastTimestamp() const
Get the last timestamp received from the stream.
Definition: GstWrapper.cpp:306
Controller::Mode StreamBase::GetMode ( )
overridevirtual

Get the current playback mode.

Returns
The current stream Mode.

Implements MediaController::IStream.

Definition at line 40 of file StreamBase.cpp.

40  {
41  return this->_gst->GetMode();
42 }
Controller::Mode GetMode() const
Get the current playback mode.
Definition: GstWrapper.h:90
void StreamBase::NewRequest ( MediaRequest request)
overridevirtual

Set the stream to a new source.

Parameters
requestThe new MediaRequest to reset the stream to.

Implements MediaController::IStream.

Definition at line 28 of file StreamBase.cpp.

28 {}
void StreamBase::Pause ( )
overridevirtual

Call Pause on the stream.

Implements MediaController::IStream.

Definition at line 24 of file StreamBase.cpp.

24 {}
bool StreamBase::Play ( float  speed = 0,
unsigned int  unixTime = 0 
)
overridevirtual

Call Play on the stream.

Parameters
speedThe playback speed. Negative values can be used for reverse playback. A value of 0 will resume a paused stream.
unixTimeThe start time for playback. A value of 0 will start a live stream.

Implements MediaController::IStream.

Definition at line 22 of file StreamBase.cpp.

22 { return false; }
bool StreamBase::Resume ( float  speed = 0,
unsigned int  unixTime = 0 
)
virtual

Send PLAY on an existing stream.

Parameters
speedThe playback speed. Negative values can be used for reverse playback. A value of 0 will resume a paused stream.
unixTimeThe start time for playback. A value of 0 will start a live stream.

Reimplemented in MediaController::Rtsp::Stream, and MediaController::MjpegPull::Stream.

Definition at line 30 of file StreamBase.cpp.

30 { return false; }
void StreamBase::Stop ( )
overridevirtual

Call TearDown on the stream.

Implements MediaController::IStream.

Definition at line 26 of file StreamBase.cpp.

26 {}

Member Data Documentation

GstWrapper* MediaController::StreamBase::_gst
protected

Definition at line 73 of file StreamBase.h.

MediaRequest MediaController::StreamBase::_mediaRequest
protected

Definition at line 72 of file StreamBase.h.

VxSdk::VxStreamProtocol::Value MediaController::StreamBase::protocol

The protocol of the stream.

Definition at line 56 of file StreamBase.h.

StreamState* MediaController::StreamBase::state

The current state of the stream.

Definition at line 49 of file StreamBase.h.


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