TSDuck Version 3.32-2769 (TSDuck - The MPEG Transport Stream Toolkit)
ts::T2MIPacket Class Reference

Representation of a DVB T2-MI (DVB-T2 Modulator Interface) packet. More...

Inheritance diagram for ts::T2MIPacket:
Collaboration diagram for ts::T2MIPacket:

Public Types

typedef DemuxedData SuperClass
 Explicit identification of super class.
 

Public Member Functions

 T2MIPacket ()
 Default constructor. More...
 
 T2MIPacket (const ByteBlock &content, PID source_pid=PID_NULL)
 Constructor from full binary content. More...
 
 T2MIPacket (const ByteBlockPtr &content_ptr, PID source_pid=PID_NULL)
 Constructor from full binary content. More...
 
 T2MIPacket (const T2MIPacket &other, ShareMode mode)
 Copy constructor. More...
 
 T2MIPacket (const void *content, size_t content_size, PID source_pid=PID_NULL)
 Constructor from full binary content. More...
 
 T2MIPacket (T2MIPacket &&other) noexcept
 Move constructor. More...
 
const uint8_t * basebandFrame () const
 Access to the baseband frame inside the packet. More...
 
size_t basebandFrameSize () const
 Size of the baseband frame in bytes. More...
 
virtual void clear () override
 Clear data content.
 
virtual const uint8_t * content () const
 Access to the full binary content of the data. More...
 
DemuxedDatacopy (const DemuxedData &other)
 Duplication. More...
 
T2MIPacketcopy (const T2MIPacket &other)
 Duplication. More...
 
PacketCounter firstTSPacketIndex () const
 Index of first TS packet of the data in the demultiplexed stream. More...
 
uint8_t frameIndex () const
 Get the T2-MI frame index. More...
 
bool interleavingFrameStart () const
 Get the interleaving frame start flag. More...
 
bool isValid () const
 Check if the packet has valid content. More...
 
PacketCounter lastTSPacketIndex () const
 Index of last TS packet of the data in the demultiplexed stream. More...
 
bool matchContent (const ByteBlock &pattern, const ByteBlock &mask=ByteBlock()) const
 Check if the start of the data matches a given pattern. More...
 
bool operator!= (const DemuxedData &other) const
 Unequality operator. More...
 
bool operator!= (const T2MIPacket &other) const
 Unequality operator. More...
 
T2MIPacketoperator= (const T2MIPacket &other)
 Assignment operator. More...
 
T2MIPacketoperator= (T2MIPacket &&other) noexcept
 Move assignment operator. More...
 
bool operator== (const DemuxedData &other) const
 Equality operator. More...
 
bool operator== (const T2MIPacket &other) const
 Equality operator. More...
 
uint8_t packetCount () const
 Get the T2-MI packet count (from the packet header). More...
 
T2MIPacketType packetType () const
 Get the T2-MI packet type. More...
 
const uint8_t * payload () const
 Access to the payload of the packet. More...
 
size_t payloadSize () const
 Size of the payload of the packet in bytes. More...
 
size_t payloadSizeInBits () const
 Size of the payload of the packet in bits. More...
 
uint8_t plp () const
 Get the PLP (Physical Layer Pipe) identifier. More...
 
bool plpValid () const
 Check if the packet has a valid PLP (Physical Layer Pipe) identifier. More...
 
virtual void reload (const ByteBlock &content, PID source_pid=PID_NULL) override
 Reload from full binary content. More...
 
virtual void reload (const ByteBlockPtr &content_ptr, PID source_pid=PID_NULL) override
 Reload from full binary content. More...
 
virtual void reload (const void *content, size_t content_size, PID source_pid=PID_NULL) override
 Reload from full binary content. More...
 
void setFirstTSPacketIndex (PacketCounter i)
 Set the first TS packet of the data in the demultiplexed stream. More...
 
void setLastTSPacketIndex (PacketCounter i)
 Set the last TS packet of the data in the demultiplexed stream. More...
 
void setSourcePID (PID pid)
 Set the source PID. More...
 
virtual size_t size () const
 Size of the binary content of the data. More...
 
PID sourcePID () const
 Get the source PID. More...
 
uint8_t superframeIndex () const
 Get the T2-MI superframe index (from the packet header). More...
 

Protected Member Functions

void rwAppend (const void *data, size_t dsize)
 Append raw data to the full binary content of the data for subclasses. More...
 
uint8_t * rwContent ()
 Read/write access to the full binary content of the data for subclasses. More...
 
void rwResize (size_t s)
 Resize the full binary content of the data for subclasses. More...
 

Detailed Description

Representation of a DVB T2-MI (DVB-T2 Modulator Interface) packet.

Constructor & Destructor Documentation

◆ T2MIPacket() [1/6]

ts::T2MIPacket::T2MIPacket ( )

Default constructor.

The T2MIPacket is initially marked invalid.

◆ T2MIPacket() [2/6]

ts::T2MIPacket::T2MIPacket ( const T2MIPacket other,
ShareMode  mode 
)

Copy constructor.

Parameters
[in]otherAnother instance to copy.
[in]modeThe packet's data are either shared (ShareMode::SHARE) between the two instances or duplicated (ShareMode::COPY).

◆ T2MIPacket() [3/6]

ts::T2MIPacket::T2MIPacket ( T2MIPacket &&  other)
noexcept

Move constructor.

Parameters
[in,out]otherAnother instance to move.

◆ T2MIPacket() [4/6]

ts::T2MIPacket::T2MIPacket ( const void *  content,
size_t  content_size,
PID  source_pid = PID_NULL 
)

Constructor from full binary content.

The content is copied into the packet if valid.

Parameters
[in]contentAddress of the binary packet data.
[in]content_sizeSize in bytes of the packet.
[in]source_pidPID from which the packet was read.

◆ T2MIPacket() [5/6]

ts::T2MIPacket::T2MIPacket ( const ByteBlock content,
PID  source_pid = PID_NULL 
)

Constructor from full binary content.

The content is copied into the packet if valid.

Parameters
[in]contentBinary packet data.
[in]source_pidPID from which the packet was read.

◆ T2MIPacket() [6/6]

ts::T2MIPacket::T2MIPacket ( const ByteBlockPtr content_ptr,
PID  source_pid = PID_NULL 
)

Constructor from full binary content.

The content is copied into the packet if valid.

Parameters
[in]content_ptrSafe pointer to the binary packet data. The content is referenced, and thus shared. Do not modify the referenced ByteBlock from outside the T2MIPacket.
[in]source_pidPID from which the packet was read.

Member Function Documentation

◆ reload() [1/3]

virtual void ts::T2MIPacket::reload ( const void *  content,
size_t  content_size,
PID  source_pid = PID_NULL 
)
overridevirtual

Reload from full binary content.

Parameters
[in]contentAddress of the binary packet data.
[in]content_sizeSize in bytes of the packet.
[in]source_pidPID from which the data were read.

Reimplemented from ts::DemuxedData.

◆ reload() [2/3]

virtual void ts::T2MIPacket::reload ( const ByteBlock content,
PID  source_pid = PID_NULL 
)
overridevirtual

Reload from full binary content.

Parameters
[in]contentBinary packet data.
[in]source_pidPID from which the data were read.

Reimplemented from ts::DemuxedData.

◆ reload() [3/3]

virtual void ts::T2MIPacket::reload ( const ByteBlockPtr content_ptr,
PID  source_pid = PID_NULL 
)
overridevirtual

Reload from full binary content.

Parameters
[in]content_ptrSafe pointer to the binary packet data. The content is referenced, and thus shared. Do not modify the referenced ByteBlock from outside the DemuxedData.
[in]source_pidPID from which the data were read.

Reimplemented from ts::DemuxedData.

◆ operator=() [1/2]

T2MIPacket& ts::T2MIPacket::operator= ( const T2MIPacket other)

Assignment operator.

The packets are referenced, and thus shared between the two packet objects.

Parameters
[in]otherOther packet to assign to this object.
Returns
A reference to this object.

◆ operator=() [2/2]

T2MIPacket& ts::T2MIPacket::operator= ( T2MIPacket &&  other)
noexcept

Move assignment operator.

Parameters
[in,out]otherOther packet to move into this object.
Returns
A reference to this object.

◆ copy() [1/2]

T2MIPacket& ts::T2MIPacket::copy ( const T2MIPacket other)

Duplication.

Similar to assignment but the packets are duplicated.

Parameters
[in]otherOther packet to duplicate into this object.
Returns
A reference to this object.

◆ isValid()

bool ts::T2MIPacket::isValid ( ) const
inline

Check if the packet has valid content.

Returns
True if the packet has valid content.

◆ operator==() [1/2]

bool ts::T2MIPacket::operator== ( const T2MIPacket other) const

Equality operator.

The source PID's are ignored, only the packet contents are compared. Invalid packets are never identical.

Parameters
[in]otherOther packet to compare.
Returns
True if the two packets are identical. False otherwise.

◆ operator!=() [1/2]

bool ts::T2MIPacket::operator!= ( const T2MIPacket other) const
inline

Unequality operator.

The source PID's are ignored, only the packet contents are compared. Invalid packets are never identical.

Parameters
[in]otherOther packet to compare.
Returns
True if the two packets are different. False otherwise.

◆ payload()

const uint8_t* ts::T2MIPacket::payload ( ) const
inline

Access to the payload of the packet.

Returns
Address of the payload of the packet.

◆ payloadSizeInBits()

size_t ts::T2MIPacket::payloadSizeInBits ( ) const
inline

Size of the payload of the packet in bits.

A T2-MI packet may stop in the middle of a byte. The payload size in bytes is rounded to the next byte.

Returns
Size of the payload of the packet in bits.

◆ payloadSize()

size_t ts::T2MIPacket::payloadSize ( ) const

Size of the payload of the packet in bytes.

Returns
Size of the payload of the packet in bytes.

◆ packetType()

T2MIPacketType ts::T2MIPacket::packetType ( ) const
inline

Get the T2-MI packet type.

Returns
The T2-MI packet type or T2MI_INVALID_TYPE if the packet is invalid.

◆ packetCount()

uint8_t ts::T2MIPacket::packetCount ( ) const
inline

Get the T2-MI packet count (from the packet header).

Returns
The T2-MI packet count.

◆ superframeIndex()

uint8_t ts::T2MIPacket::superframeIndex ( ) const
inline

Get the T2-MI superframe index (from the packet header).

Returns
The T2-MI superframe index (4 bits).

◆ frameIndex()

uint8_t ts::T2MIPacket::frameIndex ( ) const
inline

Get the T2-MI frame index.

This is valid only for some packet types (see ETSI TS 102 773, section 5.2).

Returns
The T2-MI frame index.

◆ plpValid()

bool ts::T2MIPacket::plpValid ( ) const
inline

Check if the packet has a valid PLP (Physical Layer Pipe) identifier.

Returns
True if the packet has a valid PLP.

◆ plp()

uint8_t ts::T2MIPacket::plp ( ) const
inline

Get the PLP (Physical Layer Pipe) identifier.

This is valid only for baseband frames (packet type T2MI_BASEBAND_FRAME).

Returns
The PLP identifier.

◆ interleavingFrameStart()

bool ts::T2MIPacket::interleavingFrameStart ( ) const

Get the interleaving frame start flag.

This is valid only for baseband frames (packet type T2MI_BASEBAND_FRAME).

Returns
True if the T2-MI packet contains the first baseband frame of an interleaving frame for a particular PLP.

◆ basebandFrame()

const uint8_t* ts::T2MIPacket::basebandFrame ( ) const

Access to the baseband frame inside the packet.

This is valid only for baseband frames (packet type T2MI_BASEBAND_FRAME).

Returns
Address of the baseband frame in the packet or zero if invalid.

◆ basebandFrameSize()

size_t ts::T2MIPacket::basebandFrameSize ( ) const

Size of the baseband frame in bytes.

This is valid only for baseband frames (packet type T2MI_BASEBAND_FRAME).

Returns
Size of the baseband frame in bytes.

◆ copy() [2/2]

DemuxedData& ts::DemuxedData::copy ( const DemuxedData other)
inherited

Duplication.

Similar to assignment but the data are duplicated.

Parameters
[in]otherOther data to duplicate into this object.
Returns
A reference to this object.

◆ operator==() [2/2]

bool ts::DemuxedData::operator== ( const DemuxedData other) const
inherited

Equality operator.

The source PID's are ignored, only the data contents are compared.

Parameters
[in]otherOther packet to compare.
Returns
True if the two packets are identical. False otherwise.

◆ operator!=() [2/2]

bool ts::DemuxedData::operator!= ( const DemuxedData other) const
inlineinherited

Unequality operator.

The source PID's are ignored, only the packet contents are compared.

Parameters
[in]otherOther packet to compare.
Returns
True if the two packets are different. False otherwise.

◆ sourcePID()

PID ts::DemuxedData::sourcePID ( ) const
inlineinherited

Get the source PID.

Returns
The source PID.

◆ setSourcePID()

void ts::DemuxedData::setSourcePID ( PID  pid)
inlineinherited

Set the source PID.

Parameters
[in]pidThe source PID.

◆ firstTSPacketIndex()

PacketCounter ts::DemuxedData::firstTSPacketIndex ( ) const
inlineinherited

Index of first TS packet of the data in the demultiplexed stream.

Usually valid only if the data were extracted by a demux.

Returns
The first TS packet of the data in the demultiplexed stream.

◆ lastTSPacketIndex()

PacketCounter ts::DemuxedData::lastTSPacketIndex ( ) const
inlineinherited

Index of last TS packet of the data in the demultiplexed stream.

Usually valid only if the data were extracted by a demux.

Returns
The last TS packet of the data in the demultiplexed stream.

◆ setFirstTSPacketIndex()

void ts::DemuxedData::setFirstTSPacketIndex ( PacketCounter  i)
inlineinherited

Set the first TS packet of the data in the demultiplexed stream.

Parameters
[in]iThe first TS packet of the data in the demultiplexed stream.

◆ setLastTSPacketIndex()

void ts::DemuxedData::setLastTSPacketIndex ( PacketCounter  i)
inlineinherited

Set the last TS packet of the data in the demultiplexed stream.

Parameters
[in]iThe last TS packet of the data in the demultiplexed stream.

◆ content()

virtual const uint8_t* ts::DemuxedData::content ( ) const
virtualinherited

Access to the full binary content of the data.

Do not modify content.

Returns
Address of the full binary content of the data. May be invalidated after modification.

◆ size()

virtual size_t ts::DemuxedData::size ( ) const
virtualinherited

Size of the binary content of the data.

Returns
Size of the binary content of the data.

Reimplemented in ts::PESPacket.

◆ matchContent()

bool ts::DemuxedData::matchContent ( const ByteBlock pattern,
const ByteBlock mask = ByteBlock() 
) const
inherited

Check if the start of the data matches a given pattern.

Parameters
[in]patternA byte block to compare with the start of the data.
[in]maskOptional mask to select meaningful bits in pattern.
Returns
Size of the binary content of the data.

◆ rwContent()

uint8_t* ts::DemuxedData::rwContent ( )
inlineprotectedinherited

Read/write access to the full binary content of the data for subclasses.

Returns
Address of the full binary content of the data.

◆ rwResize()

void ts::DemuxedData::rwResize ( size_t  s)
protectedinherited

Resize the full binary content of the data for subclasses.

Parameters
[in]sNew size in bytes of the full binary content of the data.

◆ rwAppend()

void ts::DemuxedData::rwAppend ( const void *  data,
size_t  dsize 
)
protectedinherited

Append raw data to the full binary content of the data for subclasses.

Parameters
[in]dataAddress of the new area to append.
[in]dsizeSize of the area to append.

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