|
| 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.
|
|
| EIT (const EIT &other) |
| Copy constructor.
|
|
| EIT (DuckContext &duck, const BinaryTable &table) |
| Constructor from a binary table.
|
|
const UString & | attribute () const |
| Get the generic user-defined "attribute" string of the table.
|
|
virtual void | clear () override final |
| This method clears the content of the table or descriptor.
|
|
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) |
| 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.
|
|
bool | isActual () const |
| Check if this is an "actual" EIT.
|
|
bool | isPresentFollowing () const |
| Check if this is an EIT present/following.
|
|
virtual bool | isPrivate () const |
| Check if the table is a private one (ie.
|
|
bool | isValid () const |
| Check if this object is valid.
|
|
EIT & | operator= (const EIT &other)=default |
| Assignment operator.
|
|
bool | serialize (DuckContext &duck, BinaryTable &bin) const |
| This method serializes a table.
|
|
void | setActual (bool is_actual) |
| Set if this is an "actual" EIT.
|
|
void | setAttribute (const UString &attr) |
| Set a generic user-defined string as "attribute" of the table.
|
|
TID | tableId () const |
| Get the table_id.
|
|
virtual uint16_t | tableIdExtension () const override |
| Get the table id extension.
|
|
virtual DescriptorList * | topLevelDescriptorList () |
| Get the address of the "top-level descriptor list" of the table.
|
|
virtual const DescriptorList * | topLevelDescriptorList () const |
| Get the address of the "top-level descriptor list" of the table (constant).
|
|
virtual xml::Element * | toXML (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 TID | ComputeTableId (bool is_actual, bool is_pf, uint8_t eits_index=0) |
| Compute an EIT table id.
|
|
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) |
| Get a name from a specified section in the DVB names file.
|
|
static void | DisplaySection (ts::TablesDisplay &display, const ts::Section §ion, ts::PSIBuffer &payload, const ts::UString &margin) |
| A static method to display a section.
|
|
static void | Fix (BinaryTable &table, FixMode mode) |
| Static method to fix the segmentation of a binary EIT.
|
|
static xml::Element * | GetOrCreateMetadata (xml::Element *element) |
| Get the <metadata> structure inside a XML element representing a table.
|
|
static ServiceIdTriplet | GetService (const Section §ion, bool include_version=false) |
| Extract the service id triplet from an EIT section.
|
|
static bool | IsActual (TID tid) |
| Check if a table id is an EIT Actual.
|
|
static bool | IsEIT (TID tid) |
| Check if a table id is an EIT.
|
|
static bool | IsOther (TID tid) |
| Check if a table id is an EIT Other.
|
|
static bool | IsPresentFollowing (TID tid) |
| Check if a table id is an EIT present/following.
|
|
static bool | IsSchedule (TID tid) |
| Check if a table id is an EIT schedule.
|
|
static void | ReorganizeSections (DuckContext &duck, SectionPtrVector §ions, const Time &reftime=Time(), EITOptions options=EITOptions::GEN_ALL) |
| Static method to reorganize a set of EIT sections according to ETSI TS 101 211.
|
|
static Time | SegmentStartTime (const Time &event_start_time) |
| Compute the segment start time of an event in an EIT schedule.
|
|
static uint8_t | SegmentToSection (size_t segment) |
| Compute the first section number in an EIT schedule table id from segment number.
|
|
static TID | SegmentToTableId (bool is_actual, size_t segment) |
| Compute an EIT schedule table id from segment number.
|
|
static bool | SetStandaloneSchedule (Section §ion) |
| Modify an EIT-schedule section to make it "standalone", outside any other table.
|
|
static Time | TableStartTime (const Time &last_midnight, const Time &event_start_time) |
| Compute the start time of EIT schedule table id for an event.
|
|
static size_t | TimeToSegment (const Time &last_midnight, const Time &event_start_time) |
| Compute the segment of an event in an EIT schedule.
|
|
static TID | TimeToTableId (bool is_actual, const Time &last_midnight, const Time &event_start_time) |
| Compute an EIT schedule table id from event time.
|
|
static TID | ToggleActual (TID tid, bool is_actual) |
| Toggle an EIT table id between Actual and Other.
|
|
|
static constexpr size_t | EIT_EVENT_FIXED_SIZE = 12 |
| Minimum size of an event structure in an EIT section before descriptor loop.
|
|
static constexpr size_t | EIT_HEADER_SIZE = LONG_SECTION_HEADER_SIZE |
| Section header size of an EIT section.
|
|
static constexpr size_t | EIT_PAYLOAD_FIXED_SIZE = 6 |
| Minimum payload size of an EIT section before event loop.
|
|
static constexpr size_t | SECTIONS_PER_SEGMENT = 8 |
| Number of sections per logical segment in EIT schedule.
|
|
static constexpr cn::milliseconds | SEGMENT_DURATION = cn::hours(3) |
| Number of milliseconds per logical segments in EIT schedule.
|
|
static constexpr size_t | SEGMENTS_PER_DAY = 8 |
| Number of logical segments per day.
|
|
static constexpr size_t | SEGMENTS_PER_TABLE = 32 |
| Number of logical segments per EIT schedule.
|
|
static constexpr cn::milliseconds | TABLE_DURATION = SEGMENTS_PER_TABLE * SEGMENT_DURATION |
| Number of milliseconds per EIT schedule table id.
|
|
static constexpr cn::days | TOTAL_DAYS = cn::days(64) |
| Number of days for all EIT schedule of one type (actual or other).
|
|
static constexpr cn::milliseconds | TOTAL_DURATION = TOTAL_SEGMENTS_COUNT * SEGMENT_DURATION |
| Number of milliseconds for all EIT schedule of one type (actual or other).
|
|
static constexpr size_t | TOTAL_SEGMENTS_COUNT = 512 |
| Number of logical segments over all EIT schedule of one type (actual or other).
|
|
static constexpr size_t | TOTAL_TABLES_COUNT = 16 |
| Number of EIT schedule tables of one type (actual or other).
|
|
static constexpr const UChar * | XML_GENERIC_DESCRIPTOR = u"generic_descriptor" |
| XML tag name for generic descriptors.
|
|
static constexpr const UChar * | XML_GENERIC_LONG_TABLE = u"generic_long_table" |
| XML tag name for generic tables with long sections.
|
|
static constexpr const UChar * | XML_GENERIC_SHORT_TABLE = u"generic_short_table" |
| XML tag name for generic short sections.
|
|
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
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] | table | The table to fix. Ignored if it is not valid or not an EIT. |
[in] | mode | The type of fix to apply. |
- See also
- ReorganizeSections()
-
EITGenerator
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] | duck | TSDuck execution context. |
[in,out] | sections | A vector of safe pointers to sections. Only valid EIT sections are used. On output, a completely new list of sections is built. |
[in] | reftime | Reference 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] | options | Generation options for EIT (p/f and/or schedule, actual and/or other). |
- See also
- ETSI TS 101 211, 4.1.4
-
EITGenerator
-
EITOption
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.
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
-
Implements ts::AbstractTable.
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.
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.
|
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] | duck | TSDuck execution context. |
[in] | element | XML element to convert. |
Reimplemented from ts::AbstractSignalization.