TSDuck Version 3.22-1914 (TSDuck - The MPEG Transport Stream Toolkit)
ts::TablesDisplay Class Reference

A class to display PSI/SI tables. More...

Inheritance diagram for ts::TablesDisplay:
Collaboration diagram for ts::TablesDisplay:

Public Member Functions

 TablesDisplay (DuckContext &d)
 Constructor. More...
 
virtual ~TablesDisplay ()
 Virtual destructor.
 
virtual void defineArgs (Args &args) const override
 Add command line option definitions in an Args. More...
 
virtual std::ostream & displayDescriptor (const Descriptor &desc, int indent=0, TID tid=TID_NULL, PDS pds=0, uint16_t cas=CASID_NULL)
 Display a descriptor on the output stream. More...
 
virtual std::ostream & displayDescriptorData (DID did, const uint8_t *payload, size_t size, int indent=0, TID tid=TID_NULL, PDS pds=0, uint16_t cas=CASID_NULL)
 Display the payload of a descriptor on the output stream. More...
 
virtual std::ostream & displayDescriptorList (const Section &section, const void *data, size_t size, int indent=0, uint16_t cas=CASID_NULL)
 Display a list of descriptors from a memory area. More...
 
virtual std::ostream & displayDescriptorList (const DescriptorList &list, int indent=0, uint16_t cas=CASID_NULL)
 Display a list of descriptors. More...
 
virtual std::ostream & displayExtraData (const void *data, size_t size, int indent=0)
 A utility method to dump extraneous bytes after expected data. More...
 
virtual std::ostream & displayExtraData (PSIBuffer &buf, int indent=0)
 A utility method to dump extraneous bytes after expected data. More...
 
virtual std::ostream & displayPrivateData (const UString &title, const void *data, size_t size, int indent=0, size_t single_line_max=8)
 A utility method to dump private binary data in a descriptor or section. More...
 
virtual std::ostream & displaySection (const Section &section, int indent=0, uint16_t cas=CASID_NULL, bool no_header=false)
 Display a section on the output stream. More...
 
virtual std::ostream & displaySectionData (const Section &section, int indent=0, uint16_t cas=CASID_NULL)
 Display the payload of a section on the output stream. More...
 
virtual std::ostream & displayTable (const BinaryTable &table, int indent=0, uint16_t cas=CASID_NULL)
 Display a table on the output stream. More...
 
void displayTLV (const uint8_t *data, size_t tlvStart, size_t tlvSize, size_t dataOffset, int indent, int innerIndent, const TLVSyntax &tlv)
 Display a memory area containing a list of TLV records. More...
 
void displayUnkownDescriptor (DID did, const uint8_t *payload, size_t size, int indent, TID tid, PDS pds)
 Display the content of an unknown descriptor. More...
 
void displayUnkownSectionData (const ts::Section &section, int indent)
 Display the content of an unknown section. More...
 
DuckContextduck ()
 Get the TSDuck execution context. More...
 
virtual bool loadArgs (DuckContext &duck, Args &args) override
 Load arguments from command line. More...
 
virtual std::ostream & logSectionData (const Section &section, const UString &header=UString(), size_t max_bytes=0, uint16_t cas=CASID_NULL)
 Display the payload of a section on the output stream as a one-line "log" message. More...
 
std::ostream & out ()
 Get the output stream. More...
 

Static Public Member Functions

static UString LogUnknownSectionData (const Section &section, size_t max_bytes)
 Log the content of an unknown section. More...
 

Detailed Description

A class to display PSI/SI tables.

Constructor & Destructor Documentation

◆ TablesDisplay()

ts::TablesDisplay::TablesDisplay ( DuckContext d)
explicit

Constructor.

By default, all displays are done on std::cout. Use redirect() to redirect the output to a file.

Parameters
[in,out]dTSDuck context.

Member Function Documentation

◆ defineArgs()

virtual void ts::TablesDisplay::defineArgs ( Args args) const
overridevirtual

Add command line option definitions in an Args.

Parameters
[in,out]argsCommand line arguments to update.

Implements ts::ArgsSupplierInterface.

◆ loadArgs()

virtual bool ts::TablesDisplay::loadArgs ( DuckContext duck,
Args args 
)
overridevirtual

Load arguments from command line.

Args error indicator is set in case of incorrect arguments.

Parameters
[in,out]duckTSDuck execution context.
[in,out]argsCommand line arguments.
Returns
True on success, false on error in argument line.

Implements ts::ArgsSupplierInterface.

◆ duck()

DuckContext& ts::TablesDisplay::duck ( )
inline

Get the TSDuck execution context.

Returns
A reference to the TSDuck execution context.

◆ out()

std::ostream& ts::TablesDisplay::out ( )
inline

Get the output stream.

Returns
A reference to the output stream.

◆ displayTable()

virtual std::ostream& ts::TablesDisplay::displayTable ( const BinaryTable table,
int  indent = 0,
uint16_t  cas = CASID_NULL 
)
virtual

Display a table on the output stream.

The content of the table is interpreted according to the table id.

Parameters
[in]tableThe table to display.
[in]indentIndentation width.
[in]casCAS id of the table.
Returns
A reference to the output stream.

◆ displaySection()

virtual std::ostream& ts::TablesDisplay::displaySection ( const Section section,
int  indent = 0,
uint16_t  cas = CASID_NULL,
bool  no_header = false 
)
virtual

Display a section on the output stream.

The content of the table is interpreted according to the table id.

Parameters
[in]sectionThe section to display.
[in]indentIndentation width.
[in]casCAS id of the table.
[in]no_headerIf true, do not display the section header.
Returns
A reference to the output stream.

◆ displaySectionData()

virtual std::ostream& ts::TablesDisplay::displaySectionData ( const Section section,
int  indent = 0,
uint16_t  cas = CASID_NULL 
)
virtual

Display the payload of a section on the output stream.

The content of the table is interpreted according to the table id.

Parameters
[in]sectionThe section to display.
[in]indentIndentation width.
[in]casCAS id of the table.
Returns
A reference to the output stream.

◆ logSectionData()

virtual std::ostream& ts::TablesDisplay::logSectionData ( const Section section,
const UString header = UString(),
size_t  max_bytes = 0,
uint16_t  cas = CASID_NULL 
)
virtual

Display the payload of a section on the output stream as a one-line "log" message.

Parameters
[in]sectionThe section to display.
[in]headerHeader string to display as prefix on the line.
[in]max_bytesMaximum number of bytes to log from the section. 0 means unlimited.
[in]casCAS id of the table.
Returns
A reference to the output stream.

◆ displayDescriptor()

virtual std::ostream& ts::TablesDisplay::displayDescriptor ( const Descriptor desc,
int  indent = 0,
TID  tid = TID_NULL,
PDS  pds = 0,
uint16_t  cas = CASID_NULL 
)
virtual

Display a descriptor on the output stream.

Parameters
[in]descThe descriptor to display.
[in]indentIndentation width.
[in]tidTable id of table containing the descriptors. This is optional. Used by some descriptors the interpretation of which may vary depending on the table that they are in.
[in]pdsPrivate Data Specifier. Used to interpret private descriptors.
[in]casCAS id of the table.
Returns
A reference to the output stream.

◆ displayDescriptorData()

virtual std::ostream& ts::TablesDisplay::displayDescriptorData ( DID  did,
const uint8_t *  payload,
size_t  size,
int  indent = 0,
TID  tid = TID_NULL,
PDS  pds = 0,
uint16_t  cas = CASID_NULL 
)
virtual

Display the payload of a descriptor on the output stream.

Parameters
[in]didDescriptor id.
[in]payloadAddress of the descriptor payload.
[in]sizeSize in bytes of the descriptor payload.
[in]indentIndentation width.
[in]tidTable id of table containing the descriptors. This is optional. Used by some descriptors the interpretation of which may vary depending on the table that they are in.
[in]pdsPrivate Data Specifier. Used to interpret private descriptors.
[in]casCAS id of the table.
Returns
A reference to the output stream.

◆ displayDescriptorList() [1/2]

virtual std::ostream& ts::TablesDisplay::displayDescriptorList ( const Section section,
const void *  data,
size_t  size,
int  indent = 0,
uint16_t  cas = CASID_NULL 
)
virtual

Display a list of descriptors from a memory area.

Parameters
[in]sectionSection containing the descriptor list.
[in]dataAddress of the descriptor list.
[in]sizeSize in bytes of the descriptor list.
[in]indentIndentation width.
[in]casCAS id of the table.
Returns
A reference to the output stream.

◆ displayDescriptorList() [2/2]

virtual std::ostream& ts::TablesDisplay::displayDescriptorList ( const DescriptorList list,
int  indent = 0,
uint16_t  cas = CASID_NULL 
)
virtual

Display a list of descriptors.

Parameters
[in]listDescriptor list.
[in]indentIndentation width.
[in]casCAS id of the table.
Returns
A reference to the output stream.

◆ displayExtraData() [1/2]

virtual std::ostream& ts::TablesDisplay::displayExtraData ( const void *  data,
size_t  size,
int  indent = 0 
)
virtual

A utility method to dump extraneous bytes after expected data.

Parameters
[in]dataAddress of extra data to dump.
[in]sizeSize of extra data to dump.
[in]indentIndentation width.
Returns
A reference to the output stream.

◆ displayExtraData() [2/2]

virtual std::ostream& ts::TablesDisplay::displayExtraData ( PSIBuffer buf,
int  indent = 0 
)
virtual

A utility method to dump extraneous bytes after expected data.

Parameters
[in]bufBuffer containing extra data to read.
[in]indentIndentation width.
Returns
A reference to the output stream.

◆ displayPrivateData()

virtual std::ostream& ts::TablesDisplay::displayPrivateData ( const UString title,
const void *  data,
size_t  size,
int  indent = 0,
size_t  single_line_max = 8 
)
virtual

A utility method to dump private binary data in a descriptor or section.

Parameters
[in]titleName of the private data to display.
[in]dataAddress of data to dump.
[in]sizeSize of data to dump.
[in]indentIndentation width.
[in]single_line_maxBelow that size, private data are displayed on one line after the title. Above that size, a multi-line hexa/ascii display is used.
Returns
A reference to the output stream.

◆ displayUnkownSectionData()

void ts::TablesDisplay::displayUnkownSectionData ( const ts::Section section,
int  indent 
)

Display the content of an unknown section.

The command-line formatting options are used to analyze the content.

Parameters
[in]sectionThe section to display.
[in]indentIndentation width.

◆ LogUnknownSectionData()

static UString ts::TablesDisplay::LogUnknownSectionData ( const Section section,
size_t  max_bytes 
)
static

Log the content of an unknown section.

Parameters
[in]sectionThe section to log.
[in]max_bytesMaximum number of bytes to log from the section. 0 means unlimited.
Returns
A one-line brief summary of the table.

◆ displayUnkownDescriptor()

void ts::TablesDisplay::displayUnkownDescriptor ( DID  did,
const uint8_t *  payload,
size_t  size,
int  indent,
TID  tid,
PDS  pds 
)

Display the content of an unknown descriptor.

Parameters
[in]didDescriptor id.
[in]payloadAddress of the descriptor payload.
[in]sizeSize in bytes of the descriptor payload.
[in]indentIndentation width.
[in]tidTable id of table containing the descriptors.
[in]pdsPrivate Data Specifier. Used to interpret private descriptors.

◆ displayTLV()

void ts::TablesDisplay::displayTLV ( const uint8_t *  data,
size_t  tlvStart,
size_t  tlvSize,
size_t  dataOffset,
int  indent,
int  innerIndent,
const TLVSyntax tlv 
)

Display a memory area containing a list of TLV records.

The displayed area extends from data to data + tlvStart + tlvSize.

  • From data to data + tlvStart : Raw data.
  • From data + tlvStart to data + tlvStart + tlvSize : TLV records.
Parameters
[in]dataStarting address of memory area.
[in]tlvStartStarting index of TLV records after data.
[in]tlvSizeSize in bytes of the TLV area.
[in]dataOffsetDisplay offset of data.
[in]indentLeft margin size.
[in]innerIndentInner margin size.
[in]tlvTLV syntax.

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