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

An efficient TSDuck-specific TS packets decapsulation from a PID. More...

#include <tsPacketDecapsulation.h>

Public Member Functions

 PacketDecapsulation (PID pid=PID_NULL)
 Constructor.
 
bool hasError () const
 Check if a previous error is pending.
 
PID inputPID () const
 Get the input PID.
 
const UStringlastError () const
 Get the last error message.
 
bool processPacket (TSPacket &pkt)
 Process a TS packet from the input stream.
 
void reset (PID pid=PID_NULL)
 Reset the decapsulation.
 
void resetError ()
 Reset the last error.
 

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 ( PID  pid = PID_NULL)

Constructor.

Parameters
[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()

◆ 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: