TSDuck v3.46-4964
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::PacketDecapsulation Class Reference

#include <tsPacketDecapsulation.h>

Public Member Functions

 PacketDecapsulation (Report &report, PID pid=PID_NULL)
bool hasError () const
PID inputPID () const
const UString & lastError () const
bool processPacket (TSPacket &pkt)
void reset (PID pid=PID_NULL)
void resetError ()

Detailed Description

An efficient TSDuck-specific TS packets decapsulation from a PID. This class extract packets which were encapsulated using PacketEncapsulation.

See also
PacketEncapsulation

Constructor & Destructor Documentation

◆ PacketDecapsulation()

ts::PacketDecapsulation::PacketDecapsulation ( Report & report,
PID pid = PID_NULL )

Constructor.

Parameters
[in,out]reportWhere to log error or debug messages.
[in]pidThe PID containing encapsulated packets. When PID_NULL, no decapsulation is done.

Member Function Documentation

◆ reset()

void ts::PacketDecapsulation::reset ( PID pid = PID_NULL)

Reset the decapsulation.

Parameters
[in]pidThe PID containing encapsulated packets. When PID_NULL, no decapsulation is done.

◆ processPacket()

bool ts::PacketDecapsulation::processPacket ( TSPacket & pkt)

Process a TS packet from the input stream.

Parameters
[in,out]pktA TS packet. If the packet belongs to the encapsulated PID, it is replaced by an decapsulating packet.
Returns
True on success, false on error (PID conflict). In case of error, use lastError().

◆ lastError()

const UString & ts::PacketDecapsulation::lastError ( ) const
inline

Get the last error message.

Returns
The last error message.

◆ hasError()

bool ts::PacketDecapsulation::hasError ( ) const
inline

Check if a previous error is pending.

Returns
True if a previous error is pending.
See also
resetError()

◆ resetError()

void ts::PacketDecapsulation::resetError ( )
inline

Reset the last error.

◆ inputPID()

PID ts::PacketDecapsulation::inputPID ( ) const
inline

Get the input PID.

Returns
The input PID.

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