MistServer  2.5.3-Pro-19-gf5e75b1 ( Generic_64)
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes
Mist::Input Class Referenceabstract

#include <input.h>

Inheritance diagram for Mist::Input:
Mist::InOutBase Mist::inputAV Mist::inputBuffer Mist::inputDTSC Mist::inputDTSC Mist::inputFLV Mist::inputFolder Mist::inputISMV Mist::inputMP3 Mist::inputMP4 Mist::inputOGG Mist::inputTS

Public Member Functions

 Input (Util::Config *cfg)
 
virtual ~Input ()
 
virtual void argumentsParsed ()
 
void bufferFinalize (unsigned long tid)
 Wraps up the buffering of a shared memory data page. More...
 
void bufferLivePacket (JSON::Value &packet)
 Buffers a live packet to a page. More...
 
void bufferLivePacket (DTSC::Packet &packet)
 Buffers a live packet to a page. More...
 
void bufferNext (DTSC::Packet &pack)
 Buffers the next packet on the currently opened page. More...
 
void bufferNext (JSON::Value &pack)
 Buffers the next packet on the currently opened page. More...
 
void bufferRemove (unsigned long tid, unsigned long pageNumber)
 Removes a fully buffered page. More...
 
bool bufferStart (unsigned long tid, unsigned long pageNumber)
 
void initiateMeta ()
 Opens a shared memory page for the stream metadata. More...
 
virtual int run ()
 

Protected Member Functions

virtual bool atKeyFrame ()
 
bool bufferFrame (unsigned int track, unsigned int keyNum)
 
void checkHeaderTimes (std::string streamFile)
 
void continueNegotiate (unsigned long tid)
 
virtual void convert ()
 
virtual void finish ()
 
virtual void getNext (bool smart=true)
 
virtual void parseHeader ()
 
void play (int until=0)
 
void playOnce ()
 
void quitPlay ()
 
virtual bool readHeader ()=0
 
virtual void removeUnused ()
 
virtual void seek (int seekTime)
 
virtual void serve ()
 The main loop for inputs in stream serving mode. More...
 
virtual bool setup ()=0
 
virtual void trackSelect (std::string trackSpec)
 
virtual void userCallback (char *data, size_t len, unsigned int id)
 

Static Protected Member Functions

static void callbackWrapper (char *data, size_t len, unsigned int id)
 

Protected Attributes

unsigned int benchMark
 
JSON::Value capa
 
int initialTime
 Timestamp of the last time we received or sent something. More...
 
bool isBuffer
 
std::map< int, std::set< int > > keyTimes
 
int lastActive
 Media-timestamp of the last packet. More...
 
DTSC::Meta myMeta
 Stores either the input or output metadata. More...
 
negotiationProxy nProxy
 
unsigned int packTime
 
std::map< unsigned int, std::map< unsigned int, unsigned int > > pageCounter
 
int playing
 
unsigned int playUntil
 
std::set< unsigned long > selectedTracks
 Stores the track id's that are either selected for playback or input. More...
 
bool standAlone
 
std::string streamName
 
DTSC::Packet thisPacket
 
IPC::sharedServer userPage
 

Static Protected Attributes

static Util::Configconfig = NULL
 
static Inputsingleton = NULL
 

Constructor & Destructor Documentation

Mist::Input::Input ( Util::Config cfg)
virtual Mist::Input::~Input ( )
inlinevirtual

Member Function Documentation

virtual void Mist::Input::argumentsParsed ( )
inlinevirtual
bool Mist::Input::atKeyFrame ( )
protectedvirtual

Reimplemented in Mist::inputISMV.

void Mist::InOutBase::bufferFinalize ( unsigned long  tid)
inherited

Wraps up the buffering of a shared memory data page.

Registers the data page on the track index page as well

Parameters
tidThe trackid of the page to finalize
bool Mist::Input::bufferFrame ( unsigned int  track,
unsigned int  keyNum 
)
protected
void Mist::InOutBase::bufferLivePacket ( JSON::Value packet)
inherited

Buffers a live packet to a page.

Handles both buffering and creation of new pages

Initiates/continues negotiation with the buffer as well

Parameters
packetThe packet to buffer
void Mist::InOutBase::bufferLivePacket ( DTSC::Packet packet)
inherited

Buffers a live packet to a page.

Handles both buffering and creation of new pages

Initiates/continues negotiation with the buffer as well

Parameters
packetThe packet to buffer
void Mist::InOutBase::bufferNext ( DTSC::Packet pack)
inherited

Buffers the next packet on the currently opened page.

Parameters
packThe packet to buffer
void Mist::InOutBase::bufferNext ( JSON::Value pack)
inherited

Buffers the next packet on the currently opened page.

Parameters
packThe packet to buffer
Note
Internally calls bufferNext(DTSC::Packet & pack)
void Mist::InOutBase::bufferRemove ( unsigned long  tid,
unsigned long  pageNumber 
)
inherited

Removes a fully buffered page.

Does not do anything if the process is not standalone, in this case the master process will have an overloaded version of this function.

Parameters
tidThe trackid to remove the page from
pageNumberThe number of the page to remove
bool Mist::InOutBase::bufferStart ( unsigned long  tid,
unsigned long  pageNumber 
)
inherited
void Mist::Input::callbackWrapper ( char *  data,
size_t  len,
unsigned int  id 
)
staticprotected
void Mist::Input::checkHeaderTimes ( std::string  streamFile)
protected
void Mist::InOutBase::continueNegotiate ( unsigned long  tid)
protectedinherited
void Mist::Input::convert ( )
protectedvirtual
void Mist::Input::finish ( )
protectedvirtual

Reimplemented in Mist::inputBuffer.

virtual void Mist::Input::getNext ( bool  smart = true)
inlineprotectedvirtual
void Mist::InOutBase::initiateMeta ( )
inherited

Opens a shared memory page for the stream metadata.

Assumes myMeta contains the metadata to write.

void Mist::Input::parseHeader ( )
protectedvirtual
void Mist::Input::play ( int  until = 0)
protected
void Mist::Input::playOnce ( )
protected
void Mist::Input::quitPlay ( )
protected
virtual bool Mist::Input::readHeader ( )
protectedpure virtual
void Mist::Input::removeUnused ( )
protectedvirtual

Reimplemented in Mist::inputBuffer.

int Mist::Input::run ( )
virtual
virtual void Mist::Input::seek ( int  seekTime)
inlineprotectedvirtual
void Mist::Input::serve ( )
protectedvirtual

The main loop for inputs in stream serving mode.

Trigger:
The "STREAM_READY" trigger is stream-specific, and is ran whenever an input finished loading and started serving a stream. If cancelled, the input is immediately shut down again. Its payload is:
streamname
input name
The "STREAM_UNLOAD" trigger is stream-specific, and is ran right before an input shuts down and stops serving a stream. If cancelled, the shut down is delayed. Its payload is:
streamname
input name
virtual bool Mist::Input::setup ( )
protectedpure virtual
virtual void Mist::Input::trackSelect ( std::string  trackSpec)
inlineprotectedvirtual
void Mist::Input::userCallback ( char *  data,
size_t  len,
unsigned int  id 
)
protectedvirtual

Reimplemented in Mist::inputBuffer.

Field Documentation

unsigned int Mist::Input::benchMark
protected
JSON::Value Mist::Input::capa
protected
Util::Config * Mist::InOutBase::config = NULL
staticprotectedinherited
int Mist::Input::initialTime
protected

Timestamp of the last time we received or sent something.

bool Mist::Input::isBuffer
protected
std::map<int,std::set<int> > Mist::Input::keyTimes
protected
int Mist::Input::lastActive
protected

Media-timestamp of the last packet.

DTSC::Meta Mist::InOutBase::myMeta
protectedinherited

Stores either the input or output metadata.

negotiationProxy Mist::InOutBase::nProxy
protectedinherited
unsigned int Mist::Input::packTime
protected
std::map<unsigned int, std::map<unsigned int, unsigned int> > Mist::Input::pageCounter
protected
int Mist::Input::playing
protected
unsigned int Mist::Input::playUntil
protected
std::set<unsigned long> Mist::InOutBase::selectedTracks
protectedinherited

Stores the track id's that are either selected for playback or input.

Input * Mist::Input::singleton = NULL
staticprotected
bool Mist::InOutBase::standAlone
protectedinherited
std::string Mist::InOutBase::streamName
protectedinherited
DTSC::Packet Mist::InOutBase::thisPacket
protectedinherited
IPC::sharedServer Mist::Input::userPage
protected

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