TSDuck v3.46-4930
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches

#include <tsEIT.h>

Inheritance diagram for ts::EIT:
Collaboration diagram for ts::EIT:

Classes

class  Event

Public Types

using EventList = AttachedEntryList<Event>
enum  FixMode {
  FILL_SEGMENTS ,
  ADD_MISSING ,
  FIX_EXISTING
}

Public Member Functions

 EIT (bool is_actual=true, bool is_pf=true, uint8_t eits_index=0, uint8_t version=0, bool is_current=true, uint16_t service_id=0, uint16_t ts_id=0, uint16_t onetw_id=0)
 EIT (const EIT &other)
 EIT (DuckContext &duck, const BinaryTable &table)
const UString & attribute () const
virtual void clear () override final
template<typename T1, typename T2 = Names::uint_t>
requires ts::int_enum<T1> && ts::int_enum<T2>
UString dataName (const UChar *section, T1 value, NamesFlags flags=NamesFlags::NAME, T2 alternate=0, size_t bits=0)
virtual Standards definingStandards (Standards current_standards=Standards::NONE) const override
bool deserialize (DuckContext &duck, const BinaryTable &bin)
virtual void fromXML (DuckContext &duck, const xml::Element *element) override final
void incrementVersion (uint8_t increment=1)
void invalidate ()
bool isActual () const
virtual bool isCurrent () const
bool isPresentFollowing () const
virtual bool isPrivate () const
bool isValid () const
EIT & operator= (const EIT &other)=default
bool serialize (DuckContext &duck, BinaryTable &bin) const
void setActual (bool is_actual)
void setAttribute (const UString &attr)
virtual void setCurrent (bool is_current)
virtual void setVersion (uint8_t version)
TID tableId () const
virtual uint16_t tableIdExtension () const override
virtual DescriptorList * topLevelDescriptorList ()
virtual const DescriptorList * topLevelDescriptorList () const
virtual xml::Element * toXML (DuckContext &duck, xml::Element *parent) const override final
virtual uint8_t version () const
UString xmlName () const

Static Public Member Functions

static TID ComputeTableId (bool is_actual, bool is_pf, uint8_t eits_index=0)
template<typename T1, typename T2 = Names::uint_t>
requires ts::int_enum<T1> && ts::int_enum<T2>
static UString DataName (const UChar *xml_name, const UChar *section, T1 value, NamesFlags flags=NamesFlags::NAME, T2 alternate=0, size_t bits=0)
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 void Fix (BinaryTable &table, FixMode mode)
static xml::Element * GetOrCreateMetadata (xml::Element *element)
static ServiceIdTriplet GetService (const Section &section, bool include_version=false)
static bool IsActual (TID tid)
static bool IsEIT (TID tid)
static bool IsOther (TID tid)
static bool IsPresentFollowing (TID tid)
static bool IsSchedule (TID tid)
static void ReorganizeSections (DuckContext &duck, SectionPtrVector &sections, const Time &reftime=Time(), EITOptions options=EITOptions::GEN_ALL)
static Time SegmentStartTime (const Time &event_start_time)
static uint8_t SegmentToSection (size_t segment)
static TID SegmentToTableId (bool is_actual, size_t segment)
static bool SetStandaloneSchedule (Section &section)
static Time TableStartTime (const Time &last_midnight, const Time &event_start_time)
static size_t TimeToSegment (const Time &last_midnight, const Time &event_start_time)
static TID TimeToTableId (bool is_actual, const Time &last_midnight, const Time &event_start_time)
static TID ToggleActual (TID tid, bool is_actual)

Public Attributes

EventList events
 List of events.
TID last_table_id = TID_NULL
 Last table id.
uint16_t onetw_id = 0
 Original network id.
uint16_t service_id = 0
 Service_id.
uint16_t ts_id = 0
 Transport stream_id.

Static Public Attributes

static constexpr size_t EIT_EVENT_FIXED_SIZE = 12
static constexpr size_t EIT_HEADER_SIZE = LONG_SECTION_HEADER_SIZE
static constexpr size_t EIT_PAYLOAD_FIXED_SIZE = 6
static constexpr size_t SECTIONS_PER_SEGMENT = 8
static constexpr cn::milliseconds SEGMENT_DURATION = cn::hours(3)
static constexpr size_t SEGMENTS_PER_DAY = 8
static constexpr size_t SEGMENTS_PER_TABLE = 32
static constexpr cn::milliseconds TABLE_DURATION = SEGMENTS_PER_TABLE * SEGMENT_DURATION
static constexpr cn::days TOTAL_DAYS = cn::days(64)
static constexpr cn::milliseconds TOTAL_DURATION = TOTAL_SEGMENTS_COUNT * SEGMENT_DURATION
static constexpr size_t TOTAL_SEGMENTS_COUNT = 512
static constexpr size_t TOTAL_TABLES_COUNT = 16
static constexpr const UChar * XML_GENERIC_DESCRIPTOR = u"generic_descriptor"
static constexpr const UChar * XML_GENERIC_LONG_TABLE = u"generic_long_table"
static constexpr const UChar * XML_GENERIC_SHORT_TABLE = u"generic_short_table"

Protected Member Functions

bool addOneSection (BinaryTable &table, PSIBuffer &payload) const
virtual void addOneSectionImpl (BinaryTable &, PSIBuffer &) const override
virtual bool analyzeXML (DuckContext &, const xml::Element *) override
virtual void buildXML (DuckContext &, xml::Element *) const override
virtual void clearContent () override
virtual void deserializePayload (PSIBuffer &, const Section &) override
virtual void deserializePayloadWrapper (PSIBuffer &, const Section &) override
virtual bool isValidTableId (TID) const override
virtual size_t maxPayloadSize () const override
virtual void serializePayload (BinaryTable &, PSIBuffer &) const override
virtual bool useTrailingCRC32 () const override

Protected Attributes

bool _is_current = true
TID _table_id = TID_NULL
uint8_t _version = 0

Detailed Description

Representation of a DVB Event Information Table (EIT).

EIT's are very special tables. In fact, EIT's are not "tables" in the MPEG-TS sense. A valid "table" contains all sections from number zero to last_section_number. EIT's, on the contrary, are organized in "segments" as described in ETSI TS 101 211, with missing sections between segments.

An instance of the C++ class named EIT (and its XML counterpart) logically contains the same information as an EIT as defined in ETSI EN 300 468, ie. a service identification and a list of events in that service. Serializing such an object produces a set of contiguous sections which are syntactically correct according to ETSI EN 300 468. However, the organization of events and sections is generally not compatible with the rules from ETSI TS 101 211 (especially EIT-schedule). The static method ReorganizeSections() can be used to transform a set of EIT sections and reorganize events and sections to produce a set of sections which are compatible with the rules from ETSI TS 101 211. The resulting sections can be directly injected in PID 18 of a transport stream.

Consequently, the correct way to produce conformant EIT sections is the following:

  • From C++ applications: Build instances of class EIT, serialize them in instances of class BinaryTable. Then, collect all sections from all BinaryTable instances in a vector of sections or SectionPtrVector. Finally, invoke the static method EIT::ReorganizeSections() over the complete vector of EIT sections.
  • From scripts and command lines: Create XML files containing <EIT> structures. The organization of events over <EIT> XML structures does not matter. Load these XML files with the option --eit-normalization (in plugin inject for instance). This option has the effect of invoking EIT::ReorganizeSections() over all sections which are created from each XML file.
See also
ETSI EN 300 468, 5.2.4
ETSI TS 101 211, 4.1.4

Member Typedef Documentation

◆ EventList

List of events.

Member Enumeration Documentation

◆ FixMode

EIT fixing modes as used by Fix().

Enumerator
FILL_SEGMENTS 

Add empty sections at end of segments, after segment_last_section_number.

ADD_MISSING 

Add empty sections for all missing sections, not only end of segment.

FIX_EXISTING 

Add empty sections and fix segment_last_section_number and last_table_id in all existing sections.

Constructor & Destructor Documentation

◆ EIT() [1/3]

ts::EIT::EIT ( bool is_actual = true,
bool is_pf = true,
uint8_t eits_index = 0,
uint8_t version = 0,
bool is_current = true,
uint16_t service_id = 0,
uint16_t ts_id = 0,
uint16_t onetw_id = 0 )

Default constructor.

Parameters
[in]is_actualTrue for EIT Actual TS, false for EIT Other TS.
[in]is_pfTrue for EIT present/following, false for EIT schedule.
[in]eits_indexFor EIT schedule, index from 0x00 to 0x0F, ignored for EIT present/following.
[in]versionTable version number.
[in]is_currentTrue if table is current, false if table is next.
[in]service_ididentifier.
[in]ts_idTransport stream identifier.
[in]onetw_idOriginal network id.

◆ EIT() [2/3]

ts::EIT::EIT ( DuckContext & duck,
const BinaryTable & table )

Constructor from a binary table.

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

◆ EIT() [3/3]

ts::EIT::EIT ( const EIT & other)

Copy constructor.

Parameters
[in]otherOther instance to copy.

Member Function Documentation

◆ ComputeTableId()

TID ts::EIT::ComputeTableId ( bool is_actual,
bool is_pf,
uint8_t eits_index = 0 )
static

Compute an EIT table id.

Parameters
[in]is_actualTrue for EIT Actual TS, false for EIT Other TS.
[in]is_pfTrue for EIT present/following, false for EIT schedule.
[in]eits_indexFor EIT schedule, index from 0x00 to 0x0F, ignored for EIT present/following.
Returns
The corresponding table id.

◆ SegmentToTableId()

TID ts::EIT::SegmentToTableId ( bool is_actual,
size_t segment )
static

Compute an EIT schedule table id from segment number.

Parameters
[in]is_actualTrue for EIT Actual TS, false for EIT Other TS.
[in]segmentThe segment number, from 0 to SEGMENTS_COUNT - 1.
Returns
The corresponding table id.

◆ SegmentToSection()

uint8_t ts::EIT::SegmentToSection ( size_t segment)
inlinestatic

Compute the first section number in an EIT schedule table id from segment number.

Parameters
[in]segmentThe segment number, from 0 to SEGMENTS_COUNT - 1.
Returns
The first section number for the segment in the EIT.

◆ TimeToTableId()

TID ts::EIT::TimeToTableId ( bool is_actual,
const Time & last_midnight,
const Time & event_start_time )
inlinestatic

Compute an EIT schedule table id from event time.

Parameters
[in]is_actualTrue for EIT Actual TS, false for EIT Other TS.
[in]last_midnightReference time of "last midnight".
[in]event_start_timeUTC start time of event.
Returns
The corresponding table id.

◆ TimeToSegment()

size_t ts::EIT::TimeToSegment ( const Time & last_midnight,
const Time & event_start_time )
static

Compute the segment of an event in an EIT schedule.

Parameters
[in]last_midnightReference time of "last midnight".
[in]event_start_timeUTC start time of event.
Returns
The corresponding segment number, from 0 to SEGMENTS_COUNT - 1.

◆ SegmentStartTime()

Time ts::EIT::SegmentStartTime ( const Time & event_start_time)
static

Compute the segment start time of an event in an EIT schedule.

Parameters
[in]event_start_timeUTC start time of event.
Returns
The starting time of the corresponding segment.

◆ TableStartTime()

Time ts::EIT::TableStartTime ( const Time & last_midnight,
const Time & event_start_time )
static

Compute the start time of EIT schedule table id for an event.

Parameters
[in]last_midnightReference time of "last midnight".
[in]event_start_timeUTC start time of event.
Returns
The starting time of the first segment in the table id of the event.

◆ ToggleActual()

TID ts::EIT::ToggleActual ( TID tid,
bool is_actual )
static

Toggle an EIT table id between Actual and Other.

Parameters
[in]tidInitial table id.
[in]is_actualTrue for EIT Actual TS, false for EIT Other TS.
Returns
The corresponding table id.

◆ IsEIT()

bool ts::EIT::IsEIT ( TID tid)
inlinestatic

Check if a table id is an EIT.

Parameters
[in]tidTable id to test.
Returns
True for EIT, false otherwise.

◆ IsActual()

bool ts::EIT::IsActual ( TID tid)
inlinestatic

Check if a table id is an EIT Actual.

Parameters
[in]tidTable id to test.
Returns
True for EIT Actual, false otherwise.

◆ IsOther()

bool ts::EIT::IsOther ( TID tid)
inlinestatic

Check if a table id is an EIT Other.

Parameters
[in]tidTable id to test.
Returns
True for EIT Actual, false otherwise.

◆ IsPresentFollowing()

bool ts::EIT::IsPresentFollowing ( TID tid)
inlinestatic

Check if a table id is an EIT present/following.

Parameters
[in]tidTable id to test.
Returns
True for EIT present/following, false otherwise.

◆ IsSchedule()

bool ts::EIT::IsSchedule ( TID tid)
inlinestatic

Check if a table id is an EIT schedule.

Parameters
[in]tidTable id to test.
Returns
True for EIT schedule, false otherwise.

◆ GetService()

ServiceIdTriplet ts::EIT::GetService ( const Section & section,
bool include_version = false )
static

Extract the service id triplet from an EIT section.

Parameters
[in]sectionAn EIT section.
[in]include_versionIf true, include the version of the EIT section in the ServiceIdTriplet. If false, set the version field of the ServiceIdTriplet to zero.
Returns
The service id triplet.

◆ operator=()

EIT & ts::EIT::operator= ( const EIT & other)
default

Assignment operator.

Parameters
[in]otherOther instance to copy.
Returns
A reference to this object.

◆ isActual()

bool ts::EIT::isActual ( ) const
inline

Check if this is an "actual" EIT.

Returns
True for EIT Actual TS, false for EIT Other TS.

◆ setActual()

void ts::EIT::setActual ( bool is_actual)

Set if this is an "actual" EIT.

Parameters
[in]is_actualTrue for EIT Actual TS, false for EIT Other TS.

◆ isPresentFollowing()

bool ts::EIT::isPresentFollowing ( ) const
inline

Check if this is an EIT present/following.

Returns
True for EIT present/following, false for EIT schedume.

◆ Fix()

void ts::EIT::Fix ( BinaryTable & table,
FixMode mode )
static

Static method to fix the segmentation of a binary EIT.

Warning: This method is legacy and should no longer be used. Now preferably use the method ReorganizeSections(). The method Fix() works on a BinaryTable object. Such an object contains a "valid" table, ie. containing all sections, from zero to last_section_number. But in practice, EIT's are never complete tables. They are a set of sections which are organized in segments as described in ETSI TS 101 211, with missing sections between segments. As a consequence, attempting to reorganize EIT sections inside a valid BinaryTable object is not possible in the general case.

The method ReorganizeSections(), on the contrary, works on a set or sections, without any attempt to keep valid full tables.

Parameters
[in,out]tableThe table to fix. Ignored if it is not valid or not an EIT.
[in]modeThe type of fix to apply.
See also
ReorganizeSections()
EITGenerator

◆ ReorganizeSections()

void ts::EIT::ReorganizeSections ( DuckContext & duck,
SectionPtrVector & sections,
const Time & reftime = Time(),
EITOptions options = EITOptions::GEN_ALL )
static

Static method to reorganize a set of EIT sections according to ETSI TS 101 211.

Warning: This method is no longer the preferred way to generate clean and organized EIT's. It is recommended to use the more generic class EITGenerator.

Only one EITp/f subtable is kept per service. It is split in two sections if two events (present and following) are specified.

All EIT schedule are kept. But they are completely reorganized. All events are extracted and spread over new EIT sections according to ETSI TS 101 211 rules.

Non-EIT sections are left unmodified.

Parameters
[in,out]duckTSDuck execution context.
[in,out]sectionsA vector of safe pointers to sections. Only valid EIT sections are used. On output, a completely new list of sections is built.
[in]reftimeReference UTC time for EIT schedule. Only the date part is used. This is the "last midnight" according to which EIT segments are assigned. By default, the oldest event start time is used.
[in]optionsGeneration options for EIT (p/f and/or schedule, actual and/or other).
See also
ETSI TS 101 211, 4.1.4
EITGenerator
EITOption

◆ SetStandaloneSchedule()

bool ts::EIT::SetStandaloneSchedule ( Section & section)
static

Modify an EIT-schedule section to make it "standalone", outside any other table. Its section number and last section number are set to zero.

Parameters
[in,out]sectionThe section to update.
Returns
True if the section was modified, false otherwise (not an EIT-scheduled or not modified).

◆ tableIdExtension()

virtual uint16_t ts::EIT::tableIdExtension ( ) const
overridevirtual

Get the table id extension. The table id extension is a 16-bit field which usually contains one of the table fields (service id, transport stream id, etc.) For each subclass, the table id extension is usually directly available in the corresponding public field. This virtual method is a generic way to access the table id extension.

Returns
The table id extension.

Implements ts::AbstractLongTable.

◆ DisplaySection()

void ts::EIT::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.

◆ clearContent()

virtual void ts::EIT::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.

◆ isValidTableId()

virtual bool ts::EIT::isValidTableId ( TID tid) const
overrideprotectedvirtual

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 from ts::AbstractTable.

◆ serializePayload()

virtual void ts::EIT::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::EIT::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::EIT::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::EIT::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.

◆ version()

virtual uint8_t ts::AbstractLongTable::version ( ) const
virtualinherited

Get the table version.

Returns
The table version.

Reimplemented in ts::MPEFECTable, and ts::MPEIFECTable.

◆ setVersion()

virtual void ts::AbstractLongTable::setVersion ( uint8_t version)
virtualinherited

Set the table version.

Parameters
[in]versionNew version number. The value is reduced modulo 32.

Reimplemented in ts::MPEFECTable, and ts::MPEIFECTable.

◆ incrementVersion()

void ts::AbstractLongTable::incrementVersion ( uint8_t increment = 1)
inlineinherited

Increment the table version.

Parameters
[in]incrementIncrement the version by this value, by default 1.

◆ isCurrent()

virtual bool ts::AbstractLongTable::isCurrent ( ) const
virtualinherited

Check if the table is current.

Returns
True if the table is current, false if the table is next.

Reimplemented in ts::DST, ts::MPEFECTable, ts::MPEIFECTable, and ts::NRT.

◆ setCurrent()

virtual void ts::AbstractLongTable::setCurrent ( bool is_current)
virtualinherited

Set the current/next status of the table.

Parameters
[in]is_currentTrue if the table is current, false if the table is next.

Reimplemented in ts::DST, ts::MPEFECTable, ts::MPEIFECTable, and ts::NRT.

◆ clear()

virtual void ts::AbstractLongTable::clear ( )
finaloverridevirtualinherited

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::AbstractTable.

◆ maxPayloadSize()

virtual size_t ts::AbstractLongTable::maxPayloadSize ( ) const
overrideprotectedvirtualinherited

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 from ts::AbstractTable.

Reimplemented in ts::AIT, ts::BAT, ts::CableEmergencyAlertTable, ts::DSMCCDownloadDataMessage, ts::DSMCCUserToNetworkMessage, ts::NIT, ts::RRT, ts::SAT, ts::SDT, ts::STT, and ts::VCT.

◆ useTrailingCRC32()

virtual bool ts::AbstractLongTable::useTrailingCRC32 ( ) const
overrideprotectedvirtualinherited

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.

◆ deserializePayloadWrapper()

virtual void ts::AbstractLongTable::deserializePayloadWrapper ( PSIBuffer & buf,
const Section & section )
overrideprotectedvirtualinherited

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 from ts::AbstractTable.

◆ addOneSectionImpl()

virtual void ts::AbstractLongTable::addOneSectionImpl ( BinaryTable & table,
PSIBuffer & payload ) const
overrideprotectedvirtualinherited

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 from ts::AbstractTable.

◆ 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::CableEmergencyAlertTable, ts::CAT, ts::DSMCCDownloadDataMessage, ts::DSMCCStreamDescriptorsTable, ts::DSMCCUserToNetworkMessage, ts::MPEFECTable, ts::MPEIFECTable, ts::PAT, ts::PMT, ts::SpliceInformationTable, and ts::TSDT.

◆ 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::AbstractDescriptorsTable, ts::AbstractTransportListTable, ts::AIT, ts::BIT, ts::CableEmergencyAlertTable, ts::CDT, ts::DCCSCT, ts::DCCT, ts::DST, ts::INT, ts::ITT, ts::MGT, ts::PMT, ts::RCT, ts::RNT, ts::RRT, ts::SelectionInformationTable, ts::SGT, ts::SpliceInformationTable, ts::STT, ts::SVCT, ts::TOT, ts::UNT, and ts::VCT.

◆ 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::AbstractDescriptorsTable, ts::AbstractTransportListTable, ts::AIT, ts::BIT, ts::CableEmergencyAlertTable, ts::CDT, ts::DCCSCT, ts::DCCT, ts::DST, ts::INT, ts::ITT, ts::MGT, ts::PMT, ts::RCT, ts::RNT, ts::RRT, ts::SelectionInformationTable, ts::SGT, ts::SpliceInformationTable, ts::STT, ts::SVCT, ts::TOT, ts::UNT, and ts::VCT.

◆ 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()

◆ 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()

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.

◆ addOneSection()

bool 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.
Returns
True on success, false on error, especially when trying to create more sections than allowed.

◆ 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 ( Standards current_standards = Standards::NONE) const
overridevirtualinherited

Get the list of standards which define this object.

Parameters
[in]current_standardsCurrent standards in the stream so far. This is a hint which may help the object to determine to which standard it belongs. This can be used by objects with slightly different semantics depending on the standard.
Returns
A bit mask of standards.

Implements ts::AbstractDefinedByStandards.

Reimplemented in ts::AbstractDescriptor.

◆ DataName()

template<typename T1, typename T2 = Names::uint_t>
requires ts::int_enum<T1> && ts::int_enum<T2>
UString ts::AbstractSignalization::DataName ( const UChar * xml_name,
const UChar * section,
T1 value,
NamesFlags flags = NamesFlags::NAME,
T2 alternate = 0,
size_t bits = 0 )
inlinestaticinherited

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

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 T1, typename T2 = Names::uint_t>
requires ts::int_enum<T1> && ts::int_enum<T2>
UString ts::AbstractSignalization::dataName ( const UChar * section,
T1 value,
NamesFlags flags = NamesFlags::NAME,
T2 alternate = 0,
size_t bits = 0 )
inlineinherited

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

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.

Member Data Documentation

◆ SEGMENTS_PER_TABLE

size_t ts::EIT::SEGMENTS_PER_TABLE = 32
staticconstexpr

Number of logical segments per EIT schedule. EIT schedule are logically divided into 32 segments of up to 8 sections each.

◆ SEGMENTS_PER_DAY

size_t ts::EIT::SEGMENTS_PER_DAY = 8
staticconstexpr

Number of logical segments per day. Each segment covers 3 hours.

◆ SECTIONS_PER_SEGMENT

size_t ts::EIT::SECTIONS_PER_SEGMENT = 8
staticconstexpr

Number of sections per logical segment in EIT schedule. EIT schedule are logically divided into 32 segments of up to 8 sections each.

◆ TOTAL_TABLES_COUNT

size_t ts::EIT::TOTAL_TABLES_COUNT = 16
staticconstexpr

Number of EIT schedule tables of one type (actual or other). There are 16 different table ids for EIT schedule (0x50-0x5F for actual, 0x60-0x6F for other).

◆ TOTAL_SEGMENTS_COUNT

size_t ts::EIT::TOTAL_SEGMENTS_COUNT = 512
staticconstexpr

Number of logical segments over all EIT schedule of one type (actual or other). There are 16 different table ids for EIT schedule (0x50-0x5F for actual, 0x60-0x6F for other). Each table id can have up to 256 sections, i.e. 32 segments.

◆ TOTAL_DAYS

cn::days ts::EIT::TOTAL_DAYS = cn::days(64)
staticconstexpr

Number of days for all EIT schedule of one type (actual or other). All EIT schedule cover events for 64 complete days max.

◆ SEGMENT_DURATION

cn::milliseconds ts::EIT::SEGMENT_DURATION = cn::hours(3)
staticconstexpr

Number of milliseconds per logical segments in EIT schedule. EIT schedule are logically divided into 32 segments. Each segment contains the events for a duration of 3 hours.

◆ TABLE_DURATION

cn::milliseconds ts::EIT::TABLE_DURATION = SEGMENTS_PER_TABLE * SEGMENT_DURATION
staticconstexpr

Number of milliseconds per EIT schedule table id. EIT schedule are logically divided into 32 segments of 3 hours each. One table id consequently covers events for 4 complete days.

◆ TOTAL_DURATION

cn::milliseconds ts::EIT::TOTAL_DURATION = TOTAL_SEGMENTS_COUNT * SEGMENT_DURATION
staticconstexpr

Number of milliseconds for all EIT schedule of one type (actual or other). All EIT schedule cover events for 64 complete days max.

◆ EIT_HEADER_SIZE

size_t ts::EIT::EIT_HEADER_SIZE = LONG_SECTION_HEADER_SIZE
staticconstexpr

Section header size of an EIT section.

◆ EIT_PAYLOAD_FIXED_SIZE

size_t ts::EIT::EIT_PAYLOAD_FIXED_SIZE = 6
staticconstexpr

Minimum payload size of an EIT section before event loop.

◆ EIT_EVENT_FIXED_SIZE

size_t ts::EIT::EIT_EVENT_FIXED_SIZE = 12
staticconstexpr

Minimum size of an event structure in an EIT section before descriptor loop.

◆ _version

uint8_t ts::AbstractLongTable::_version = 0
protectedinherited

The table version number field is directly accessible to subclasses only. Some table subclasses may want to enforce specific behaviors.

◆ _is_current

bool ts::AbstractLongTable::_is_current = true
protectedinherited

The table current/next field is directly accessible to subclasses only. Some table subclasses may want to enforce specific behaviors.

◆ _table_id

TID ts::AbstractTable::_table_id = TID_NULL
protectedinherited

The table id can be modified by subclasses only.

◆ XML_GENERIC_DESCRIPTOR

const UChar* ts::AbstractSignalization::XML_GENERIC_DESCRIPTOR = u"generic_descriptor"
staticconstexprinherited

XML tag name for generic descriptors.

◆ XML_GENERIC_SHORT_TABLE

const UChar* ts::AbstractSignalization::XML_GENERIC_SHORT_TABLE = u"generic_short_table"
staticconstexprinherited

XML tag name for generic short sections.

◆ XML_GENERIC_LONG_TABLE

const UChar* ts::AbstractSignalization::XML_GENERIC_LONG_TABLE = u"generic_long_table"
staticconstexprinherited

XML tag name for generic tables with long sections.


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