This class logs sections and tables.
More...
#include <tsTablesLogger.h>
This class logs sections and tables.
◆ TablesLogger()
Constructor.
- Parameters
-
[in,out] | display | Object to display tables and sections. |
◆ defineArgs()
void ts::TablesLogger::defineArgs |
( |
Args & |
args | ) |
|
Add command line option definitions in an Args.
- Parameters
-
[in,out] | args | Command line arguments to update. |
◆ loadArgs()
Load arguments from command line.
Args error indicator is set in case of incorrect arguments.
- Parameters
-
[in,out] | duck | TSDuck execution context. |
[in,out] | args | Command line arguments. |
- Returns
- True on success, false on error in argument line.
◆ setTableHandler()
Set a table handler which is called for each complete table in addition to logging.
When the table handler or the section handler is not null, there is no default logging. To have the tables or sections displayed, you must explicitly specify --text-output -.
- Parameters
-
[in] | h | The new table handler. |
◆ setSectionHandler()
Set a section handler which is called for each section in addition to logging.
When the table handler or the section handler is not null, there is no default logging. To have the tables or sections displayed, you must explicitly specify --text-output -.
- Parameters
-
◆ feedPacket()
void ts::TablesLogger::feedPacket |
( |
const TSPacket & |
pkt | ) |
|
The following method feeds the logger with a TS packet.
- Parameters
-
[in] | pkt | A new transport stream packet. |
◆ open()
bool ts::TablesLogger::open |
( |
| ) |
|
Open files, start operations.
The options must have been loaded first.
- Returns
- True on success, false on error.
◆ close()
void ts::TablesLogger::close |
( |
| ) |
|
Close all operations, flush tables if required, close files and sockets.
No longer accept packets. Automatically done in destructor.
◆ hasErrors()
bool ts::TablesLogger::hasErrors |
( |
| ) |
const |
|
inline |
Check if an error was found.
- Returns
- True when an error was found.
◆ completed()
bool ts::TablesLogger::completed |
( |
| ) |
const |
|
inline |
Check if the operation is complete.
- Returns
- True when the operation is complete (eg. max number of logged tables reached).
◆ reportDemuxErrors() [1/2]
void ts::TablesLogger::reportDemuxErrors |
( |
std::ostream & |
strm | ) |
|
Report the demux errors (if any).
- Parameters
-
[in,out] | strm | Output text stream. |
◆ reportDemuxErrors() [2/2]
Report the demux errors (if any).
- Parameters
-
[in,out] | report | Output Report object. |
[in] | level | Severity level to report. |
◆ AnalyzeUDPMessage()
static bool ts::TablesLogger::AnalyzeUDPMessage |
( |
const duck::Protocol & |
protocol, |
|
|
const uint8_t * |
data, |
|
|
size_t |
size, |
|
|
bool |
no_encapsulation, |
|
|
SectionPtrVector & |
sections, |
|
|
Time & |
timestamp |
|
) |
| |
|
static |
Static routine to analyze UDP messages as sent by the table logger (option –ip-udp).
- Parameters
-
[in] | protocol | Instance of TLV protocol to analyze UDP message. |
[in] | data | Address of UDP message. |
[in] | size | Size in bytes of UDP message. |
[in] | no_encapsulation | When true, the UDP message contains raw sections. When false, the UDP message contains a TLV structure. |
[out] | sections | List of sections in the message. |
[out] | timestamp | Time of the collection of the table. Available only in TLV message. Contains Time::Epoch if not available. |
- Returns
- True on success, false on invalid message.
◆ handleTable()
This hook is invoked when a complete table is available.
Tables with long sections are reported only when a new version is available.
- Parameters
-
[in,out] | demux | A reference to the section demux. |
[in] | table | A reference to the demultiplexed table. |
Implements ts::TableHandlerInterface.
◆ handleSection()
This hook is invoked when a complete section is available.
- Parameters
-
[in,out] | demux | The demux which sends the section. |
[in] | section | The new section from the demux. |
Implements ts::SectionHandlerInterface.
◆ handleInvalidSection()
This hook is invoked when an invalid section is detected.
- Parameters
-
[in,out] | demux | The demux which sends the section. |
[in] | data | The invalid section from the demux. |
Implements ts::InvalidSectionHandlerInterface.
◆ DEFAULT_LOG_SIZE
constexpr size_t ts::TablesLogger::DEFAULT_LOG_SIZE = 8 |
|
staticconstexpr |
Default table log size.
With option --log, specify how many bytes are displayed at the beginning of the table payload (the header is not displayed). The default is 8 bytes.
The documentation for this class was generated from the following file: