MistServer  2.5.3-Pro-19-gf5e75b1 ( Generic_64)
Public Member Functions | Static Public Member Functions | Protected Attributes
TS::ProgramMappingTable Class Reference

#include <ts_packet.h>

Inheritance diagram for TS::ProgramMappingTable:
TS::Packet TS::Packet

Public Member Functions

 ProgramMappingTable ()
 
 ProgramMappingTable ()
 
void addStuffing ()
 Adds stuffing to the Packet depending on how much content you want to send. More...
 
void addStuffing ()
 
void calcCRC ()
 
void calcCRC ()
 
const char * checkAndGetBuffer () const
 Checks the size of the internal packet buffer (prints error if size !=188), then returns a pointer to the data. More...
 
const char * checkAndGetBuffer () const
 
void clear ()
 Sets the packet pos to 4, and resets the first 4 fields to defaults (including sync byte on pos 0) More...
 
void clear ()
 
int fillFree (const char *PackageData, int maxLen)
 Fills the free bytes of the Packet. More...
 
int fillFree (const char *PackageData, int maxLen)
 
bool FromFile (FILE *data)
 This function fills a Packet from a file. More...
 
bool FromFile (FILE *data)
 
bool FromPointer (const char *data)
 This funtion fills a Packet from a char array. More...
 
bool FromPointer (const char *data)
 
int getAdaptationField () const
 Gets whether a Packet contains an adaptationfield. More...
 
int getAdaptationField () const
 
int getAdaptationFieldLen () const
 Gets the current length of the adaptationfield. More...
 
int getAdaptationFieldLen () const
 
unsigned int getBytesFree () const
 Gets the amount of bytes that are not written yet in a Packet. More...
 
unsigned int getBytesFree () const
 
int getContinuityCounter () const
 
int getContinuityCounter () const
 Gets the Continuity Counter of a single Packet. More...
 
int getCRC () const
 
int getCRC () const
 
bool getCurrentNextIndicator () const
 
bool getCurrentNextIndicator () const
 Retrieves the "current/next" indicator. More...
 
unsigned int getDataSize () const
 
unsigned int getDataSize () const
 
ProgramMappingEntry getEntry (int index) const
 
ProgramMappingEntry getEntry (int index) const
 
char getLastSectionNumber () const
 Retrieves the last section number. More...
 
char getLastSectionNumber () const
 
char getOffset () const
 
char getOffset () const
 
int64_t getOPCR () const
 Gets the OPCR (Original Program Clock Reference) of a Packet. More...
 
int64_t getOPCR () const
 
const char * getPayload () const
 returns the character buffer with a std::string wrapper More...
 
const char * getPayload () const
 
int getPayloadLength () const
 Gets the length of the payload for this apcket. More...
 
int getPayloadLength () const
 
int64_t getPCR () const
 Gets the PCR (Program Clock Reference) of a Packet. More...
 
int64_t getPCR () const
 
short getPCRPID () const
 
short getPCRPID () const
 
unsigned int getPID () const
 
unsigned int getPID () const
 Gets the PID of a single Packet. More...
 
short getProgramInfoLength () const
 
short getProgramInfoLength () const
 
short getProgramNumber () const
 
short getProgramNumber () const
 
bool getRandomAccess () const
 Gets whether this Packet can be accessed at random (indicates keyframe). More...
 
bool getRandomAccess () const
 
short getSectionLength () const
 
short getSectionLength () const
 
char getSectionNumber () const
 
char getSectionNumber () const
 Retrieves the section number. More...
 
char getTableId () const
 
char getTableId () const
 
unsigned int getTransportScramblingControl () const
 Gets the transport scrambling control of a Packet. More...
 
unsigned int getTransportScramblingControl () const
 
bool getUnitStart () const
 Gets the payload unit start inficator of a Packet. More...
 
bool getUnitStart () const
 
char getVersionNumber () const
 
char getVersionNumber () const
 
bool hasDiscontinuity () const
 
bool hasDiscontinuity () const
 
bool hasESpriority () const
 
bool hasESpriority () const
 Gets the elementary stream priority indicator of a Packet. More...
 
bool hasOPCR () const
 Gets the value of the OPCR flag. More...
 
bool hasOPCR () const
 
bool hasPCR () const
 Gets the value of the PCR flag. More...
 
bool hasPCR () const
 
bool hasPriority () const
 Gets the transport priority of a Packet. More...
 
bool hasPriority () const
 
bool hasSplicingPoint () const
 Gets the value of the splicing point flag. More...
 
bool hasSplicingPoint () const
 
bool hasTransportError () const
 
bool hasTransportError () const
 Gets the transport error inficator of a Packet. More...
 
bool isPMT () const
 Returns true if this PID contains a PMT. More...
 
bool isPMT () const
 
 operator bool () const
 
 operator bool () const
 
ProgramMappingTableoperator= (const Packet &rhs)
 
ProgramMappingTableoperator= (const Packet &rhs)
 
void setAdaptationField (int NewVal)
 Sets the selection value for an adaptationfield of a Packet. More...
 
void setAdaptationField (int NewVal)
 
void setContinuityCounter (int NewContinuity)
 Sets the Continuity Counter of a single Packet. More...
 
void setContinuityCounter (int NewContinuity)
 
void setCurrentNextIndicator (bool newVal)
 Sets the "current/next" indicator. More...
 
void setCurrentNextIndicator (bool newVal)
 
void setDefaultPAT ()
 
void setDefaultPAT ()
 Transforms the Packet into a standard Program Association Table. More...
 
void setDiscontinuity (bool newVal)
 
void setDiscontinuity (bool newVal)
 
void setLastSectionNumber (char newVal)
 Sets the last section number. More...
 
void setLastSectionNumber (char newVal)
 
void setOffset (char newVal)
 
void setOffset (char newVal)
 
void setPCR (int64_t NewVal)
 Sets the PCR (Program Clock Reference) of a Packet. More...
 
void setPCR (int64_t NewVal)
 
void setPCRPID (short newVal)
 
void setPCRPID (short newVal)
 
void setPID (int NewPID)
 Sets the PID of a single Packet. More...
 
void setPID (int NewPID)
 
void setProgramInfoLength (short newVal)
 
void setProgramInfoLength (short newVal)
 
void setProgramNumber (short newVal)
 
void setProgramNumber (short newVal)
 
void setRandomAccess (bool newVal)
 Gets the value of the transport private data point flag. More...
 
void setRandomAccess (bool newVal)
 
void setSectionLength (short newVal)
 
void setSectionLength (short newVal)
 
void setSectionNumber (char newVal)
 Sets the section number. More...
 
void setSectionNumber (char newVal)
 
void setTableId (char newVal)
 
void setTableId (char newVal)
 
void setUnitStart (bool newVal)
 
void setUnitStart (bool newVal)
 Sets the start of a new unit in this Packet. More...
 
void setVersionNumber (char newVal)
 
void setVersionNumber (char newVal)
 
std::string toPrettyString (size_t indent=0, int detailLevel=3) const
 Prints a packet to stdout, for analyser purposes. More...
 
std::string toPrettyString (size_t indent) const
 
std::string toPrettyString (size_t indent) const
 Print all PMT values in a human readable format. More...
 
void updPos (unsigned int newPos)
 update position in character array (pos), More...
 
void updPos (unsigned int newPos)
 

Static Public Member Functions

static std::string & getPESAudioLeadIn (unsigned int len, unsigned long long PTS)
 Generates a PES Lead-in for an audio frame. More...
 
static std::string & getPESAudioLeadIn (unsigned int len, unsigned long long PTS)
 
static std::string & getPESVideoLeadIn (unsigned int len, unsigned long long PTS, unsigned long long offset, bool isAligned)
 Generates a PES Lead-in for a video frame. More...
 
static std::string & getPESVideoLeadIn (unsigned int len, unsigned long long PTS, unsigned long long offset, bool isAligned)
 

Protected Attributes

unsigned int pos
 
char strBuf [189]
 

Constructor & Destructor Documentation

TS::ProgramMappingTable::ProgramMappingTable ( )
TS::ProgramMappingTable::ProgramMappingTable ( )

Member Function Documentation

void TS::Packet::addStuffing ( )
inherited

Adds stuffing to the Packet depending on how much content you want to send.

Parameters
NumBytesthe amount of non-stuffing content bytes you want to send.
Returns
The amount of content bytes that can be send.
Todo:
more stuffing required
void TS::Packet::addStuffing ( )
inherited
void TS::ProgramMappingTable::calcCRC ( )
void TS::ProgramMappingTable::calcCRC ( )
const char * TS::Packet::checkAndGetBuffer ( ) const
inherited

Checks the size of the internal packet buffer (prints error if size !=188), then returns a pointer to the data.

Returns
A character pointer to the internal packet buffer data
const char* TS::Packet::checkAndGetBuffer ( ) const
inherited
void TS::Packet::clear ( )
inherited

Sets the packet pos to 4, and resets the first 4 fields to defaults (including sync byte on pos 0)

void TS::Packet::clear ( )
inherited
int TS::Packet::fillFree ( const char *  PackageData,
int  maxLen 
)
inherited
int TS::Packet::fillFree ( const char *  NewVal,
int  maxLen 
)
inherited

Fills the free bytes of the Packet.

Stores as many bytes from NewVal as possible in the packet. The minimum of Packet::BytesFree and maxLen is used.

Parameters
NewValThe data to store in the packet.
maxLenThe maximum amount of bytes to store.
bool TS::Packet::FromFile ( FILE *  data)
inherited

This function fills a Packet from a file.

It fills the content with the next 188 bytes int he file.

Parameters
DataThe data to be read into the packet.
Returns
true if it was possible to read in a full packet, false otherwise.
bool TS::Packet::FromFile ( FILE *  data)
inherited
bool TS::Packet::FromPointer ( const char *  data)
inherited
bool TS::Packet::FromPointer ( const char *  data)
inherited

This funtion fills a Packet from a char array.

It fills the content with the first 188 characters of a char array

Parameters
DataThe char array that contains the data to be read into the packet
Returns
true if successful (which always happens, or else a segmentation fault should occur)
int TS::Packet::getAdaptationField ( ) const
inherited

Gets whether a Packet contains an adaptationfield.

Returns
The existence of an adaptationfield.
  • 0: No adaptationfield present.
  • 1: Adaptationfield is present.
int TS::Packet::getAdaptationField ( ) const
inherited
int TS::Packet::getAdaptationFieldLen ( ) const
inherited

Gets the current length of the adaptationfield.

Returns
The length of the adaptationfield.
int TS::Packet::getAdaptationFieldLen ( ) const
inherited
unsigned int TS::Packet::getBytesFree ( ) const
inherited

Gets the amount of bytes that are not written yet in a Packet.

Returns
The amount of bytes that can still be written to this packet.
unsigned int TS::Packet::getBytesFree ( ) const
inherited
int TS::Packet::getContinuityCounter ( ) const
inherited

Gets the Continuity Counter of a single Packet.

Returns
The value of the Continuity Counter.
int TS::Packet::getContinuityCounter ( ) const
inherited
int TS::ProgramMappingTable::getCRC ( ) const
int TS::ProgramMappingTable::getCRC ( ) const
bool TS::ProgramMappingTable::getCurrentNextIndicator ( ) const
bool TS::ProgramMappingTable::getCurrentNextIndicator ( ) const

Retrieves the "current/next" indicator.

unsigned int TS::Packet::getDataSize ( ) const
inherited
unsigned int TS::Packet::getDataSize ( ) const
inherited
ProgramMappingEntry TS::ProgramMappingTable::getEntry ( int  index) const
ProgramMappingEntry TS::ProgramMappingTable::getEntry ( int  index) const
char TS::ProgramMappingTable::getLastSectionNumber ( ) const
char TS::ProgramMappingTable::getLastSectionNumber ( ) const

Retrieves the last section number.

char TS::ProgramMappingTable::getOffset ( ) const
char TS::ProgramMappingTable::getOffset ( ) const
int64_t TS::Packet::getOPCR ( ) const
inherited

Gets the OPCR (Original Program Clock Reference) of a Packet.

Returns
The value of the OPCR.
int64_t TS::Packet::getOPCR ( ) const
inherited
const char * TS::Packet::getPayload ( ) const
inherited

returns the character buffer with a std::string wrapper

Returns
The raw TS data as a string Gets the payload of this packet, as a raw char array
The payload of this ts packet as a char pointer
const char* TS::Packet::getPayload ( ) const
inherited
int TS::Packet::getPayloadLength ( ) const
inherited
int TS::Packet::getPayloadLength ( ) const
inherited

Gets the length of the payload for this apcket.

Returns
The amount of bytes payload in this packet
int64_t TS::Packet::getPCR ( ) const
inherited

Gets the PCR (Program Clock Reference) of a Packet.

Returns
The value of the PCR.
int64_t TS::Packet::getPCR ( ) const
inherited
short TS::ProgramMappingTable::getPCRPID ( ) const
short TS::ProgramMappingTable::getPCRPID ( ) const
std::string & TS::Packet::getPESAudioLeadIn ( unsigned int  len,
unsigned long long  PTS 
)
staticinherited

Generates a PES Lead-in for an audio frame.

Prepends the lead-in to variable toSend, assumes toSend's length is all other data.

Parameters
lenThe length of this frame.
PTSThe timestamp of the frame.
static std::string& TS::Packet::getPESAudioLeadIn ( unsigned int  len,
unsigned long long  PTS 
)
staticinherited
std::string & TS::Packet::getPESVideoLeadIn ( unsigned int  len,
unsigned long long  PTS,
unsigned long long  offset,
bool  isAligned 
)
staticinherited

Generates a PES Lead-in for a video frame.

Prepends the lead-in to variable toSend, assumes toSend's length is all other data.

Parameters
lenThe length of this frame.
PTSThe timestamp of the frame.
static std::string& TS::Packet::getPESVideoLeadIn ( unsigned int  len,
unsigned long long  PTS,
unsigned long long  offset,
bool  isAligned 
)
staticinherited
unsigned int TS::Packet::getPID ( ) const
inherited

Gets the PID of a single Packet.

Returns
The value of the PID.
unsigned int TS::Packet::getPID ( ) const
inherited
short TS::ProgramMappingTable::getProgramInfoLength ( ) const
short TS::ProgramMappingTable::getProgramInfoLength ( ) const
short TS::ProgramMappingTable::getProgramNumber ( ) const
short TS::ProgramMappingTable::getProgramNumber ( ) const
bool TS::Packet::getRandomAccess ( ) const
inherited

Gets whether this Packet can be accessed at random (indicates keyframe).

Returns
Whether or not this Packet contains a keyframe.
bool TS::Packet::getRandomAccess ( ) const
inherited
short TS::ProgramMappingTable::getSectionLength ( ) const
short TS::ProgramMappingTable::getSectionLength ( ) const
char TS::ProgramMappingTable::getSectionNumber ( ) const
char TS::ProgramMappingTable::getSectionNumber ( ) const

Retrieves the section number.

char TS::ProgramMappingTable::getTableId ( ) const
char TS::ProgramMappingTable::getTableId ( ) const
unsigned int TS::Packet::getTransportScramblingControl ( ) const
inherited

Gets the transport scrambling control of a Packet.

Returns
The transport scrambling control of a Packet
unsigned int TS::Packet::getTransportScramblingControl ( ) const
inherited
bool TS::Packet::getUnitStart ( ) const
inherited

Gets the payload unit start inficator of a Packet.

Returns
The payload unit start inficator of a Packet
bool TS::Packet::getUnitStart ( ) const
inherited
char TS::ProgramMappingTable::getVersionNumber ( ) const
char TS::ProgramMappingTable::getVersionNumber ( ) const
bool TS::Packet::hasDiscontinuity ( ) const
inherited
bool TS::Packet::hasDiscontinuity ( ) const
inherited
bool TS::Packet::hasESpriority ( ) const
inherited

Gets the elementary stream priority indicator of a Packet.

Returns
The elementary stream priority indicator of a Packet
bool TS::Packet::hasESpriority ( ) const
inherited
bool TS::Packet::hasOPCR ( ) const
inherited

Gets the value of the OPCR flag.

Returns
true if there is an OPCR, false otherwise
bool TS::Packet::hasOPCR ( ) const
inherited
bool TS::Packet::hasPCR ( ) const
inherited

Gets the value of the PCR flag.

Returns
true if there is a PCR, false otherwise
bool TS::Packet::hasPCR ( ) const
inherited
bool TS::Packet::hasPriority ( ) const
inherited

Gets the transport priority of a Packet.

Returns
The transport priority of a Packet
bool TS::Packet::hasPriority ( ) const
inherited
bool TS::Packet::hasSplicingPoint ( ) const
inherited
bool TS::Packet::hasSplicingPoint ( ) const
inherited

Gets the value of the splicing point flag.

Returns
the value of the splicing point flag
bool TS::Packet::hasTransportError ( ) const
inherited

Gets the transport error inficator of a Packet.

Returns
The transport error inficator of a Packet
bool TS::Packet::hasTransportError ( ) const
inherited
bool TS::Packet::isPMT ( ) const
inherited

Returns true if this PID contains a PMT.

Important caveat: only works if the corresponding PAT has been pretty-printed earlier!

bool TS::Packet::isPMT ( ) const
inherited
TS::Packet::operator bool ( ) const
inherited
TS::Packet::operator bool ( ) const
inherited
ProgramMappingTable & TS::ProgramMappingTable::operator= ( const Packet rhs)
ProgramMappingTable& TS::ProgramMappingTable::operator= ( const Packet rhs)
void TS::Packet::setAdaptationField ( int  NewSelector)
inherited

Sets the selection value for an adaptationfield of a Packet.

Parameters
NewSelectorThe new value of the selection bits.
  • 1: No AdaptationField.
  • 2: AdaptationField Only.
  • 3: AdaptationField followed by Data.
void TS::Packet::setAdaptationField ( int  NewVal)
inherited
void TS::Packet::setContinuityCounter ( int  NewContinuity)
inherited
void TS::Packet::setContinuityCounter ( int  NewContinuity)
inherited

Sets the Continuity Counter of a single Packet.

Parameters
NewContinuityThe new Continuity Counter of the packet.
void TS::ProgramMappingTable::setCurrentNextIndicator ( bool  newVal)

Sets the "current/next" indicator.

void TS::ProgramMappingTable::setCurrentNextIndicator ( bool  newVal)
void TS::Packet::setDefaultPAT ( )
inherited

Transforms the Packet into a standard Program Association Table.

void TS::Packet::setDefaultPAT ( )
inherited
void TS::Packet::setDiscontinuity ( bool  newVal)
inherited
void TS::Packet::setDiscontinuity ( bool  newVal)
inherited
void TS::ProgramMappingTable::setLastSectionNumber ( char  newVal)
void TS::ProgramMappingTable::setLastSectionNumber ( char  newVal)

Sets the last section number.

void TS::ProgramMappingTable::setOffset ( char  newVal)
void TS::ProgramMappingTable::setOffset ( char  newVal)
void TS::Packet::setPCR ( int64_t  NewVal)
inherited
void TS::Packet::setPCR ( int64_t  NewVal)
inherited

Sets the PCR (Program Clock Reference) of a Packet.

Parameters
NewValThe new PCR Value.
void TS::ProgramMappingTable::setPCRPID ( short  newVal)
void TS::ProgramMappingTable::setPCRPID ( short  newVal)
void TS::Packet::setPID ( int  NewPID)
inherited

Sets the PID of a single Packet.

Parameters
NewPIDThe new PID of the packet.
void TS::Packet::setPID ( int  NewPID)
inherited
void TS::ProgramMappingTable::setProgramInfoLength ( short  newVal)
void TS::ProgramMappingTable::setProgramInfoLength ( short  newVal)
void TS::ProgramMappingTable::setProgramNumber ( short  newVal)
void TS::ProgramMappingTable::setProgramNumber ( short  newVal)
void TS::Packet::setRandomAccess ( bool  newVal)
inherited
void TS::Packet::setRandomAccess ( bool  NewVal)
inherited

Gets the value of the transport private data point flag.

Returns
the value of the transport private data point flag
void TS::ProgramMappingTable::setSectionLength ( short  newVal)
void TS::ProgramMappingTable::setSectionLength ( short  newVal)
void TS::ProgramMappingTable::setSectionNumber ( char  newVal)
void TS::ProgramMappingTable::setSectionNumber ( char  newVal)

Sets the section number.

void TS::ProgramMappingTable::setTableId ( char  newVal)
void TS::ProgramMappingTable::setTableId ( char  newVal)
void TS::Packet::setUnitStart ( bool  NewVal)
inherited

Sets the start of a new unit in this Packet.

Parameters
NewValThe new value for the start of a unit.
void TS::Packet::setUnitStart ( bool  newVal)
inherited
void TS::ProgramMappingTable::setVersionNumber ( char  newVal)
void TS::ProgramMappingTable::setVersionNumber ( char  newVal)
std::string TS::Packet::toPrettyString ( size_t  indent = 0,
int  detailLevel = 3 
) const
inherited

Prints a packet to stdout, for analyser purposes.

std::string TS::ProgramMappingTable::toPrettyString ( size_t  indent) const

Print all PMT values in a human readable format.

Parameters
indentThe indentation of the string printed as wanted by the user
Returns
The string with human readable data from a PMT table
std::string TS::ProgramMappingTable::toPrettyString ( size_t  indent) const
void TS::Packet::updPos ( unsigned int  newPos)
inherited
void TS::Packet::updPos ( unsigned int  newPos)
inherited

update position in character array (pos),

Field Documentation

unsigned int TS::Packet::pos
protectedinherited
char TS::Packet::strBuf
protectedinherited

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