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

Representation of an ISDB DownLoad Table (DLT). More...

#include <tsDLT.h>

Inheritance diagram for ts::DLT:
Collaboration diagram for ts::DLT:

Public Member Functions

 DLT ()
 Default constructor.
 
 DLT (DuckContext &duck, const BinaryTable &table)
 Constructor from a binary table.
 
const UStringattribute () const
 Get the generic user-defined "attribute" string of the table.
 
virtual void clear () override
 This method clears the content of the table or descriptor.
 
template<typename INT >
requires std::integral<INT>
UString dataName (const UChar *section, INT value, NamesFlags flags=NamesFlags::NAME, INT alternate=0, size_t bits=0)
 Get a name from a specified section in the DVB names file for that signalization structure.
 
virtual Standards definingStandards () const override
 Get the list of standards which define this object.
 
bool deserialize (DuckContext &duck, const BinaryTable &bin)
 This method deserializes a binary table.
 
virtual void fromXML (DuckContext &duck, const xml::Element *element) override final
 This method converts an XML structure to a table or descriptor in this object.
 
void invalidate ()
 Invalidate this object.
 
virtual bool isPrivate () const
 Check if the table is a private one (ie.
 
bool isValid () const
 Check if this object is valid.
 
bool serialize (DuckContext &duck, BinaryTable &bin) const
 This method serializes a table.
 
void setAttribute (const UString &attr)
 Set a generic user-defined string as "attribute" of the table.
 
TID tableId () const
 Get the table_id.
 
virtual DescriptorListtopLevelDescriptorList ()
 Get the address of the "top-level descriptor list" of the table.
 
virtual const DescriptorListtopLevelDescriptorList () const
 Get the address of the "top-level descriptor list" of the table (constant).
 
virtual xml::ElementtoXML (DuckContext &duck, xml::Element *parent) const override final
 This method converts this object to XML.
 
UString xmlName () const
 Get the XMl node name representing this table or descriptor.
 

Static Public Member Functions

template<typename INT >
requires std::integral<INT>
static UString DataName (const UChar *xml_name, const UChar *section, INT value, NamesFlags flags=NamesFlags::NAME, INT alternate=0, size_t bits=0)
 Get a name from a specified section in the DVB names file.
 
static void DisplaySection (ts::TablesDisplay &display, const ts::Section &section, ts::PSIBuffer &payload, const ts::UString &margin)
 A static method to display a section.
 
static xml::ElementGetOrCreateMetadata (xml::Element *element)
 Get the <metadata> structure inside a XML element representing a table.
 

Public Attributes

ByteBlock code_data {}
 Downloaded software fragment. Padded with FF to 2048 bytes in binary section.
 
uint16_t last_Lsection_number = 0
 DLT last section number (recreated on 16 bits).
 
uint16_t Lsection_number = 0
 DLT section number (recreated on 16 bits).
 
uint8_t maker_id = 0
 Manufacturer id.
 
uint8_t model_id = 0
 Model id within manufacturer.
 
ByteBlock model_info {}
 Model information. Padded with FF to 145 bytes in binary section.
 
uint8_t version_id = 0
 Downloaded software id.
 

Static Public Attributes

static constexpr size_t CODE_DATA_SIZE = 2048
 Fixed size in bytes of code_data in binary section.
 
static constexpr size_t MODEL_INFO_SIZE = 145
 Fixed size in bytes of model_info in binary section.
 
static const UChar *const XML_GENERIC_DESCRIPTOR
 XML tag name for generic descriptors.
 
static const UChar *const XML_GENERIC_LONG_TABLE
 XML tag name for generic tables with long sections.
 
static const UChar *const XML_GENERIC_SHORT_TABLE
 XML tag name for generic short sections.
 

Protected Member Functions

void addOneSection (BinaryTable &table, PSIBuffer &payload) const
 Helper method for serializePayload(): add a section in a binary table.
 
virtual void addOneSectionImpl (BinaryTable &table, PSIBuffer &payload) const
 Actual implementation of adding one section in a binary table.
 
virtual bool analyzeXML (DuckContext &, const xml::Element *) override
 Helper method to convert this object from XML.
 
virtual void buildXML (DuckContext &, xml::Element *) const override
 Helper method to convert this object to XML.
 
virtual void clearContent () override
 Helper method to clear the content of the table or descriptor.
 
virtual void deserializePayload (PSIBuffer &, const Section &) override
 This abstract method deserializes the payload of one section.
 
virtual void deserializePayloadWrapper (PSIBuffer &buf, const Section &section)
 Wrapper for deserializePayload().
 
virtual bool isValidTableId (TID tid) const
 This method checks if a table id is valid for this object.
 
virtual size_t maxPayloadSize () const
 Get the maximum size in bytes of the payload of sections of this table.
 
virtual void serializePayload (BinaryTable &, PSIBuffer &) const override
 This abstract method serializes the payload of all sections in the table.
 
virtual bool useTrailingCRC32 () const override
 Check if the sections of this table have a trailing CRC32.
 

Protected Attributes

TID _table_id = TID_NULL
 The table id can be modified by subclasses only.
 

Detailed Description

Representation of an ISDB DownLoad Table (DLT).

See also
ARIB STD-B16, 4.4

Note: the ARIB STD-B16 is only in available in Japanese version and not generally available for download. The following is a summary of the structure of the DLT for the purpose of its implementation.

The DLT indicates the software to be downloaded. PID is operated by the operator and is indicated by DCT. It is transmitted in part (or all) of the transport_stream of the network. It is scrambled to ensure security. The frequency of transmission is set arbitrarily by the operator.

The DLT is a short section. However, the ARIB standard recreates 16-bit extended versions of section_number and last_section_number in the form of Lsection_number and last_Lsection_number. A CRC-32 is also explicitly added at the end of the section (just like a TOT).

Syntax Bits Identifier
------------------------------- ---- -------------
Download_section() {
table_id 8 uimsbf = 0xC1
section_syntax_indicator 1 bslbf = 0
private_indicator 1 bslbf = 1
reserved 2 bslbf
section_length 12 uimsbf
maker_id 8 uimsbf
model_id 8 uimsbf
version_id 8 uimsbf
Lsection_number 16 uimsbf
for (i=0;i<145;i++) {
model_info 8 bslbf
}
for (i=0;i<2048;i++) {
code_data_byte 8 bslbf
}
CRC_32 32 rpchof
}
uint8_t model_id
Model id within manufacturer.
Definition tsDLT.h:102
uint16_t last_Lsection_number
DLT last section number (recreated on 16 bits).
Definition tsDLT.h:105
ByteBlock model_info
Model information. Padded with FF to 145 bytes in binary section.
Definition tsDLT.h:106
uint8_t version_id
Downloaded software id.
Definition tsDLT.h:103
uint16_t Lsection_number
DLT section number (recreated on 16 bits).
Definition tsDLT.h:104
uint8_t maker_id
Manufacturer id.
Definition tsDLT.h:101

maker_id: This 8-bit field indicates the manufacturer identification of the receiver to which this section applies. This value is managed and operated by the standardization organization.

model_id: This 8-bit field indicates the model identification of the receiver to which this section applies, within the same maker_id. This value is managed and operated by each manufacturer.

version_id (software version identification): This 8-bit field indicates the software version identification of the receiver to which this section applies, within the same maker_id/model_id. This value is managed and operated by each manufacturer. Only one version_id is transmitted at the same time.

Lsection_number (extended section number): This 16-bit field is an extension of section_number to 16 bits, and indicates the number of the extended section. The extended section number of the first section in a subtable is 0x00. The extended section number is incremented by 1 for each additional section with the same table identification/manufacturer identification/model identification/software version identification.

last_Lsection_number (last extended section number): This 16-bit field is an extension of last_section_number to 16 bits, and specifies the number of the last section of the subtable to which the section belongs (i.e., the section with the highest extended section number).

model_info: This 145-byte field can contain any information related to the software.

code_data_byte (downloaded software): This 2048-byte field indicates the software to be downloaded.

CRC_32 (CRC): This 32-bit field is generated according to the CRC generation method section of the ISO/IEC13818-1 standard. It indicates the CRC value for the entire section.

Constructor & Destructor Documentation

◆ DLT()

ts::DLT::DLT ( DuckContext duck,
const BinaryTable table 
)

Constructor from a binary table.

Parameters
[in,out]duckTSDuck execution context.
[in]tableBinary table to deserialize.

Member Function Documentation

◆ DisplaySection()

static void ts::DLT::DisplaySection ( ts::TablesDisplay display,
const ts::Section section,
ts::PSIBuffer payload,
const ts::UString margin 
)
static

A static method to display a section.


Parameters
[in,out]displayDisplay engine.
[in]sectionThe section to display.
[in,out]payloadA PSIBuffer over the payload.
[in]marginLeft margin content.

◆ useTrailingCRC32()

virtual bool ts::DLT::useTrailingCRC32 ( ) const
overrideprotectedvirtual

Check if the sections of this table have a trailing CRC32.

This is usually false for short sections but some short sections such as DVB-TOT use a CRC32.

Returns
True if the sections of this table have a trailing CRC32.

Reimplemented from ts::AbstractTable.

◆ clearContent()

virtual void ts::DLT::clearContent ( )
overrideprotectedvirtual

Helper method to clear the content of the table or descriptor.

It is called by clear(). In clearContent(), the subclass shall simply revert the value of all fields to their original values in the default constructor.

Implements ts::AbstractSignalization.

◆ serializePayload()

virtual void ts::DLT::serializePayload ( BinaryTable table,
PSIBuffer buf 
) const
overrideprotectedvirtual

This abstract method serializes the payload of all sections in the table.

When serialize() is called, the output binary table is cleared and serializePayload() is called. A subclass shall implement serializePayload() which adds all required sections in the binary table.

Note that it is not necessary to explicitly add the last (or only) section. Upon return from serializePayload(), serialize() checks the state of the payload buffer. If the output binary table is still empty or if the payload buffer is not empty (or not empty after the last saved write position), then addOneSection() is automatically called.

Parameters
[in,out]tableThe binary table into which this object shall be serialized. The table is initially empty when serialize() calls serializePayload().
[in,out]bufA PSIBuffer with the appropriate size for the section payload. The payload buffer is initially empty when serialize() calls serializePayload().

Implements ts::AbstractTable.

◆ deserializePayload()

virtual void ts::DLT::deserializePayload ( PSIBuffer buf,
const Section section 
)
overrideprotectedvirtual

This abstract method deserializes the payload of one section.

When deserialize() is called, this object is cleared and validated. Then, deserializePayload() is invoked for each section in the binary table. A subclass shall implement deserializePayload() which adds the content of the binary section to the C++ object. Do not reset the object in deserializePayload() since it is repeatedly called for each section of a single binary table.

Parameters
[in,out]bufDeserialization buffer. The subclass shall read the descriptor payload from buf. The end of read is the end of the binary payload. If any kind of error is reported in the buffer or if the payload is not completely read, the deserialization is considered as invalid.
[in]sectionA reference to the section. Can be used to access values in the section header (typically for long sections).

Implements ts::AbstractTable.

◆ buildXML()

virtual void ts::DLT::buildXML ( DuckContext duck,
xml::Element root 
) const
overrideprotectedvirtual

Helper method to convert this object to XML.

It is called by toXML() only when the object is valid. The root element is already built with the appropriate XML node name. In buildXML(), the subclass shall simply populate the XML node.

Parameters
[in,out]rootThe root node for the new XML tree.
[in,out]duckTSDuck execution context.

Implements ts::AbstractSignalization.

◆ analyzeXML()

virtual bool ts::DLT::analyzeXML ( DuckContext duck,
const xml::Element element 
)
overrideprotectedvirtual

Helper method to convert this object from XML.

It is called by fromXML() after checking the validity of the XML node name. In analyzeXML(), the subclass shall populate the C++ object from the content of the XML node. If analyzeXML() returns false, this table or descriptor object is then invalidated and cleared.

Parameters
[in,out]duckTSDuck execution context.
[in]elementXML element to convert.
Returns
True if the analysis is correct, false otherwise.

Implements ts::AbstractSignalization.

◆ tableId()

TID ts::AbstractTable::tableId ( ) const
inlineinherited

Get the table_id.

Returns
The table_id.

◆ isPrivate()

virtual bool ts::AbstractTable::isPrivate ( ) const
virtualinherited

Check if the table is a private one (ie.

not MPEG-defined). The default implementation returns true. MPEG-defined tables should override this method to return false.

Returns
True if the table is a private one (ie. not MPEG-defined).

Reimplemented in ts::CAT, ts::DSMCCStreamDescriptorsTable, ts::PAT, ts::PMT, ts::TSDT, ts::CableEmergencyAlertTable, and ts::SpliceInformationTable.

◆ serialize()

bool ts::AbstractTable::serialize ( DuckContext duck,
BinaryTable bin 
) const
inherited

This method serializes a table.

Parameters
[in,out]duckTSDuck execution context.
[out]binA binary table object. Its content is replaced with a binary representation of this object.
Returns
True in case of success, false if the table is invalid.

◆ deserialize()

bool ts::AbstractTable::deserialize ( DuckContext duck,
const BinaryTable bin 
)
inherited

This method deserializes a binary table.

In case of success, this object is replaced with the interpreted content of bin. In case of error, this object is invalidated.

Parameters
[in,out]duckTSDuck execution context.
[in]binA binary table to interpret according to the table subclass.
Returns
True in case of success, false if the table is invalid.

◆ setAttribute()

void ts::AbstractTable::setAttribute ( const UString attr)
inlineinherited

Set a generic user-defined string as "attribute" of the table.

The semantics of this attribute string is not defined. It is used by the application. The attribute string can be found in the <metadata> structure of the XML representation of the table.

Parameters
[in]attrGeneric string to set as attribute.

◆ topLevelDescriptorList() [1/2]

virtual DescriptorList * ts::AbstractTable::topLevelDescriptorList ( )
virtualinherited

Get the address of the "top-level descriptor list" of the table.

Some tables have descriptor lists, and sometimes two levels of descriptor lists. This is the case of the PMT, NIT, BAT, etc. The "top-level descriptor list" is present once in the table. It describes the service (PMT), the network (NIT) or the operator (BAT). At the second level, there is one descriptor list per component (PMT), or per transport stream (NIT, BAT). Sometimes, when exploring a second-level descriptor list, it is useful to also explore the top-level descriptor list. This virtual method returns a pointer to the top-level descriptor list. Thus, when exploring a second-level descriptor list, using the table pointer in that list, we can get a reference to the higher-level list.

The default implementation returns the null pointer.

Returns
The address of the "top-level descriptor list" of the table, if there is one. Return the null pointer if there is no such descriptor list.

Reimplemented in ts::DCCSCT, ts::DCCT, ts::MGT, ts::RRT, ts::STT, ts::VCT, ts::AIT, ts::INT, ts::RCT, ts::RNT, ts::SelectionInformationTable, ts::TOT, ts::UNT, ts::BIT, ts::CDT, ts::ITT, ts::PMT, ts::CableEmergencyAlertTable, ts::SpliceInformationTable, ts::AbstractDescriptorsTable, and ts::AbstractTransportListTable.

◆ topLevelDescriptorList() [2/2]

virtual const DescriptorList * ts::AbstractTable::topLevelDescriptorList ( ) const
virtualinherited

Get the address of the "top-level descriptor list" of the table (constant).

Returns
The address of the "top-level descriptor list" of the table, if there is one. Return the null pointer if there is no such descriptor list.
See also
DescriptorList* topLevelDescriptorList()

Reimplemented in ts::DCCSCT, ts::DCCT, ts::MGT, ts::RRT, ts::STT, ts::VCT, ts::AIT, ts::INT, ts::RCT, ts::RNT, ts::SelectionInformationTable, ts::TOT, ts::UNT, ts::BIT, ts::CDT, ts::ITT, ts::PMT, ts::CableEmergencyAlertTable, ts::SpliceInformationTable, ts::AbstractDescriptorsTable, and ts::AbstractTransportListTable.

◆ attribute()

const UString & ts::AbstractTable::attribute ( ) const
inlineinherited

Get the generic user-defined "attribute" string of the table.

Returns
A constant reference to the attribute string in the object.
See also
setAttribute()

◆ clear()

virtual void ts::AbstractTable::clear ( )
overridevirtualinherited

This method clears the content of the table or descriptor.

Upon return, the object is valid and in the same empty state as after a default constructor.

Reimplemented from ts::AbstractSignalization.

Reimplemented in ts::AbstractLongTable.

◆ toXML()

virtual xml::Element * ts::AbstractTable::toXML ( DuckContext duck,
xml::Element parent 
) const
finaloverridevirtualinherited

This method converts this object to XML.

When this object is valid, this method creates a root node with the default XML name and then invokes buildXML() in the subclass to populate the XML node.

Important: Implementers of signalization classes shall not override this class. Implement the protected method buildXML() instead.

Parameters
[in,out]duckTSDuck execution context.
[in,out]parentThe parent node for the new XML tree.
Returns
The new XML element.

Reimplemented from ts::AbstractSignalization.

◆ fromXML()

virtual void ts::AbstractTable::fromXML ( DuckContext duck,
const xml::Element element 
)
finaloverridevirtualinherited

This method converts an XML structure to a table or descriptor in this object.

In case of success, this object is replaced with the interpreted content of the XML structure. In case of error, this object is invalidated.

This method checks the name of the XML node and then invokes analyzeXML() in the subclass. Depending on the returned values of analyzeXML(), this object is either validated or invalidated.

Important: Implementers of signalization classes shall not override this class. Implement the protected method analyzeXML() instead.

Parameters
[in,out]duckTSDuck execution context.
[in]elementXML element to convert.

Reimplemented from ts::AbstractSignalization.

◆ GetOrCreateMetadata()

static xml::Element * ts::AbstractTable::GetOrCreateMetadata ( xml::Element element)
staticinherited

Get the <metadata> structure inside a XML element representing a table.

If the <metadata> structure does not exist, it is created.

Parameters
[in,out]elementThe XML element representing a table.
Returns
The <metadata> structure inside element. Never null, unless element is null.

◆ isValidTableId()

virtual bool ts::AbstractTable::isValidTableId ( TID  tid) const
protectedvirtualinherited

This method checks if a table id is valid for this object.

Parameters
[in]tidA table id to check.
Returns
True if tid is a valid table id for this object, false otherwise. The default implementation checks that tid is identical to the table id of this object.

Reimplemented in ts::EIT, ts::NIT, ts::SDT, and ts::NBIT.

◆ maxPayloadSize()

virtual size_t ts::AbstractTable::maxPayloadSize ( ) const
protectedvirtualinherited

Get the maximum size in bytes of the payload of sections of this table.

Returns
The maximum size in bytes of the payload of sections of this table.

Reimplemented in ts::RRT, ts::STT, ts::VCT, ts::AIT, ts::BAT, ts::NIT, ts::RST, ts::SAT, ts::SDT, ts::CableEmergencyAlertTable, ts::SpliceInformationTable, and ts::AbstractLongTable.

◆ addOneSection()

void ts::AbstractTable::addOneSection ( BinaryTable table,
PSIBuffer payload 
) const
protectedinherited

Helper method for serializePayload(): add a section in a binary table.

For long tables, the section number is always one more than the current last section in the table.

If the payload buffer has a pushed read/write state, this state is restored and immediately pushed again. The typical use case is the following:

  • A table may create more than one section.
  • The payload of all sections starts with the same fixed data.
  • In the subclass, the method serializePayload() builds the initial fixed data once.
  • The method serializePayload() immediately pushes the read/write state of the buffer.
  • The method serializePayload() builds payloads and call addOneSection().
  • Upon return from addOneSection(), the buffer is back right after the initial fixed data.
Parameters
[in,out]tableThe binary table into which the new section shall be added.
[in,out]payloadA PSIBuffer containing the section payload between the read and the write pointer.

◆ addOneSectionImpl()

virtual void ts::AbstractTable::addOneSectionImpl ( BinaryTable table,
PSIBuffer payload 
) const
protectedvirtualinherited

Actual implementation of adding one section in a binary table.

Do not call directly, it is only called by addOneSection() and is overridden in AbstractLongTable.

Parameters
[in,out]tableThe binary table into which the new section shall be added.
[in,out]payloadA PSIBuffer containing the section payload between the read and the write pointer.

Reimplemented in ts::AbstractLongTable.

◆ deserializePayloadWrapper()

virtual void ts::AbstractTable::deserializePayloadWrapper ( PSIBuffer buf,
const Section section 
)
protectedvirtualinherited

Wrapper for deserializePayload().

This is a method to overload in intermediate classes to avoid using "call superclass" to all tables.

Parameters
[in,out]bufDeserialization buffer.
[in]sectionA reference to the section.

Reimplemented in ts::AbstractLongTable.

◆ isValid()

bool ts::AbstractSignalization::isValid ( ) const
inlineinherited

Check if this object is valid.

Returns
True if this object is valid.

◆ invalidate()

void ts::AbstractSignalization::invalidate ( )
inlineinherited

Invalidate this object.

This object must be rebuilt.

◆ xmlName()

UString ts::AbstractSignalization::xmlName ( ) const
inherited

Get the XMl node name representing this table or descriptor.

Returns
The XML node name.

◆ definingStandards()

virtual Standards ts::AbstractSignalization::definingStandards ( ) const
overridevirtualinherited

Get the list of standards which define this object.

Returns
A bit mask of standards.

Implements ts::AbstractDefinedByStandards.

Reimplemented in ts::AbstractDescriptor.

◆ DataName()

template<typename INT >
requires std::integral<INT>
static UString ts::AbstractSignalization::DataName ( const UChar xml_name,
const UChar section,
INT  value,
NamesFlags  flags = NamesFlags::NAME,
INT  alternate = 0,
size_t  bits = 0 
)
inlinestaticinherited

Get a name from a specified section in the DVB names file.

Template Parameters
INTAn integer type.
Parameters
[in]xml_nameTable or descriptor name, as used in XML structures.
[in]sectionName of section to search. Not case-sensitive. The actual section in the names file is prefixed by the XML name, followed by a dot.
[in]valueValue to get the name for.
[in]flagsPresentation flags.
[in]alternateDisplay this integer value if flags ALTERNATE is set.
[in]bitsOptional size in bits of the displayed data. Used in replacement of the "Bits=XX" directive in the .names file.
Returns
The corresponding name.

◆ dataName()

template<typename INT >
requires std::integral<INT>
UString ts::AbstractSignalization::dataName ( const UChar section,
INT  value,
NamesFlags  flags = NamesFlags::NAME,
INT  alternate = 0,
size_t  bits = 0 
)
inlineinherited

Get a name from a specified section in the DVB names file for that signalization structure.

Template Parameters
INTAn integer type.
Parameters
[in]sectionName of section to search. Not case-sensitive. The actual section in the names file is prefixed by the XML name of the structure, followed by a dot.
[in]valueValue to get the name for.
[in]flagsPresentation flags.
[in]alternateDisplay this integer value if flags ALTERNATE is set.
[in]bitsOptional size in bits of the displayed data. Used in replacement of the "Bits=XX" directive in the .names file.
Returns
The corresponding name.

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