OpenDaVINCI  4.16.0
odtools::player::Player Class Reference

#include <Player.h>

Public Member Functions

 Player (const odcore::io::URL &url, const bool &autoRewind, const uint32_t &memorySegmentSize, const uint32_t &numberOfMemorySegments, const bool &threading)
 
virtual ~Player ()
 
odcore::data::Container getNextContainerToBeSent () throw (odcore::exceptions::ArrayIndexOutOfBoundsException)
 
uint32_t getDelay () const
 
uint32_t getCorrectedDelay () const
 
bool hasMoreData () const
 
void rewind ()
 
uint32_t getTotalNumberOfContainersInRecFile () const
 
void registerPlayerDelegate (const uint32_t &containerID, PlayerDelegate *p)
 
void setPlayerListener (PlayerListener *l)
 

Detailed Description

This class can be used to replay previously recorded data and return the contained containers to be relayed into a ContainerConference.

Constructor & Destructor Documentation

odtools::player::Player::Player ( const odcore::io::URL url,
const bool &  autoRewind,
const uint32_t &  memorySegmentSize,
const uint32_t &  numberOfMemorySegments,
const bool &  threading 
)

Constructor.

Parameters
urlResource to play.
autoRewindTrue if the file should be rewind at EOF.
memorySegmentSizeSize of the memory segment to be used for buffering.
numberOfMemorySegmentsNumber of memory segments to be used for buffering.
threadingIf set to true, player will load new containers from the files in background.

References odcore::io::URL::getResource().

odtools::player::Player::~Player ( )
virtual

Member Function Documentation

uint32_t odtools::player::Player::getCorrectedDelay ( ) const

This method returns the delay to be waited before the next container should be delivered correct by the internal processing time.

Returns
delay to the next container in real time microseconds (us).
uint32_t odtools::player::Player::getDelay ( ) const

This method returns the real delay to be waited before the next container should be delivered.

Returns
delay to the next container in real time microseconds (us).
Container odtools::player::Player::getNextContainerToBeSent ( )
throw (odcore::exceptions::ArrayIndexOutOfBoundsException
)

This method returns the next container to be replayed.

Returns
Next container to be replayed.

References odcore::data::Container::getDataType(), odcore::data::Container::getSampleTimeStamp(), and odcore::data::TimeStamp::toMicroseconds().

uint32_t odtools::player::Player::getTotalNumberOfContainersInRecFile ( ) const

This method returns the total amount of containers in the .rec file.

Returns
Total amount of containers in .rec file.
bool odtools::player::Player::hasMoreData ( ) const

This method returns true if there is more data to replay.

Returns
true if there is more data to replay.
void odtools::player::Player::registerPlayerDelegate ( const uint32_t &  containerID,
PlayerDelegate p 
)

This method (un)registers a PlayerDelegate to process a specific Container differently.

Parameters
containerIDContainer ID to listen for.
pPlayerDelegate or NULL to unregister.
void odtools::player::Player::rewind ( )

This method rewinds the iterators.

void odtools::player::Player::setPlayerListener ( PlayerListener l)