TSDuck v3.40-3963
MPEG Transport Stream Toolkit
|
Representation of an SCTE 18 Cable Emergency Alert Table. More...
#include <tsCableEmergencyAlertTable.h>
Classes | |
class | Exception |
Description of a service exception for the alert. More... | |
class | Location |
Description of a geographical location for the alert. More... | |
Public Member Functions | |
CableEmergencyAlertTable (const CableEmergencyAlertTable &other) | |
Copy constructor. | |
CableEmergencyAlertTable (DuckContext &duck, const BinaryTable &table) | |
Constructor from a binary table. | |
CableEmergencyAlertTable (uint8_t sequence_number=0) | |
Default constructor. | |
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 INT , typename std::enable_if< std::is_integral< INT >::value, int >::type = 0> | |
UString | dataName (const UChar *section, INT value, NamesFlags flags=NamesFlags::NAME, size_t bits=0, INT alternate=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 override |
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 uint16_t | tableIdExtension () const override |
Get the table id extension. | |
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 Public Member Functions | |
template<typename INT , typename std::enable_if< std::is_integral< INT >::value, int >::type = 0> | |
static UString | DataName (const UChar *xml_name, const UChar *section, INT value, NamesFlags flags=NamesFlags::NAME, size_t bits=0, INT alternate=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 xml::Element * | GetOrCreateMetadata (xml::Element *element) |
Get the <metadata> structure inside a XML element representing a table. | |
Public Attributes | |
uint8_t | alert_message_time_remaining = 0 |
Remaining number of seconds, 0 to 120. | |
uint8_t | alert_priority = 0 |
4 bits, alert priority | |
ATSCMultipleString | alert_text {} |
Alert text. | |
uint16_t | audio_OOB_source_ID = 0 |
0 or id of channel carrying audio. | |
DescriptorList | descs |
Descriptor list. | |
uint16_t | details_major_channel_number = 0 |
0 or major number of channel carrying details. | |
uint16_t | details_minor_channel_number = 0 |
0 or minor number of channel carrying details. | |
uint16_t | details_OOB_source_ID = 0 |
0 or id of channel carrying details. | |
UString | EAS_event_code {} |
Event code, usually a 3-character code but not required. | |
uint16_t | EAS_event_ID = 0 |
EAS event id. | |
UString | EAS_originator_code {} |
Originator code, a 3-character code (usually one of "PEP", "WXR", "CIV", "EAS"). | |
uint16_t | event_duration = 0 |
Event duration in minutes 0 or 15 to 6000. | |
Time | event_start_time {} |
Event start time or Time::Epoch if immediate. | |
std::list< Exception > | exceptions {} |
List of service exceptions. Up to 255 elements. | |
bool | is_current = true |
True if table is current, false if table is next. | |
std::list< Location > | locations {} |
List of location descriptions. Must be 1 to 31 elements. | |
ATSCMultipleString | nature_of_activation_text {} |
Event short description. | |
uint8_t | protocol_version = 0 |
SCTE 18 protocol version, should be zero. | |
uint8_t | version = 0 |
Table version number. | |
Static Public Attributes | |
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 &, PSIBuffer &) const override |
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 &, const Section &) override |
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 override |
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. | |
Representation of an SCTE 18 Cable Emergency Alert Table.
Note that the so-called "sequence_number" in the SCTE 18 standard is in fact the "version" of the table, in MPEG parlance.
ts::CableEmergencyAlertTable::CableEmergencyAlertTable | ( | uint8_t | sequence_number = 0 | ) |
Default constructor.
[in] | sequence_number | The EAS sequence number. Same as table version in MPEG parlance |
ts::CableEmergencyAlertTable::CableEmergencyAlertTable | ( | const CableEmergencyAlertTable & | other | ) |
Copy constructor.
[in] | other | Other instance to copy. |
ts::CableEmergencyAlertTable::CableEmergencyAlertTable | ( | DuckContext & | duck, |
const BinaryTable & | table | ||
) |
Constructor from a binary table.
[in,out] | duck | TSDuck execution context. |
[in] | table | Binary table to deserialize. |
|
overridevirtual |
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.
Reimplemented from ts::AbstractTable.
|
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.
Implements ts::AbstractLongTable.
|
static |
A static method to display a section.
[in,out] | display | Display engine. |
[in] | section | The section to display. |
[in,out] | payload | A PSIBuffer over the payload. |
[in] | margin | Left margin content. |
|
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.
|
overrideprotectedvirtual |
Get the maximum size in bytes of the payload of sections of this table.
Reimplemented from ts::AbstractLongTable.
|
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.
[in,out] | table | The binary table into which this object shall be serialized. The table is initially empty when serialize() calls serializePayload(). |
[in,out] | buf | A PSIBuffer with the appropriate size for the section payload. The payload buffer is initially empty when serialize() calls serializePayload(). |
Implements ts::AbstractTable.
|
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.
[in,out] | buf | Deserialization 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] | section | A reference to the section. Can be used to access values in the section header (typically for long sections). |
Implements ts::AbstractTable.
|
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.
[in,out] | root | The root node for the new XML tree. |
[in,out] | duck | TSDuck execution context. |
Implements ts::AbstractSignalization.
|
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.
[in,out] | duck | TSDuck execution context. |
[in] | element | XML element to convert. |
Implements ts::AbstractSignalization.
|
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.
|
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.
Reimplemented from ts::AbstractTable.
|
overrideprotectedvirtualinherited |
Wrapper for deserializePayload().
This is a method to overload in intermediate classes to avoid using "call superclass" to all tables.
[in,out] | buf | Deserialization buffer. |
[in] | section | A reference to the section. |
Reimplemented from ts::AbstractTable.
|
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.
[in,out] | table | The binary table into which the new section shall be added. |
[in,out] | payload | A PSIBuffer containing the section payload between the read and the write pointer. |
Reimplemented from ts::AbstractTable.
|
inlineinherited |
Get the table_id.
|
inherited |
This method serializes a table.
[in,out] | duck | TSDuck execution context. |
[out] | bin | A binary table object. Its content is replaced with a binary representation of this object. |
|
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.
[in,out] | duck | TSDuck execution context. |
[in] | bin | A binary table to interpret according to the table subclass. |
|
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.
[in] | attr | Generic string to set as attribute. |
|
inlineinherited |
Get the generic user-defined "attribute" string of the table.
|
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.
[in,out] | duck | TSDuck execution context. |
[in,out] | parent | The parent node for the new XML tree. |
Reimplemented from ts::AbstractSignalization.
|
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.
[in,out] | duck | TSDuck execution context. |
[in] | element | XML element to convert. |
Reimplemented from ts::AbstractSignalization.
|
staticinherited |
Get the <metadata> structure inside a XML element representing a table.
If the <metadata> structure does not exist, it is created.
[in,out] | element | The XML element representing a table. |
|
protectedvirtualinherited |
This method checks if a table id is valid for this object.
[in] | tid | A table id to check. |
|
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:
[in,out] | table | The binary table into which the new section shall be added. |
[in,out] | payload | A PSIBuffer containing the section payload between the read and the write pointer. |
|
inlineinherited |
Check if this object is valid.
|
inlineinherited |
Invalidate this object.
This object must be rebuilt.
|
inherited |
Get the XMl node name representing this table or descriptor.
|
overridevirtualinherited |
Get the list of standards which define this object.
Implements ts::AbstractDefinedByStandards.
|
inlinestaticinherited |
Get a name from a specified section in the DVB names file.
INT | An integer type. |
[in] | xml_name | Table or descriptor name, as used in XML structures. |
[in] | section | Name 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] | value | Value to get the name for. |
[in] | flags | Presentation flags. |
[in] | bits | Nominal size in bits of the data, optional. |
[in] | alternate | Display this integer value if flags ALTERNATE is set. |
|
inlineinherited |
Get a name from a specified section in the DVB names file for that signalization structure.
INT | An integer type. |
[in] | section | Name 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] | value | Value to get the name for. |
[in] | flags | Presentation flags. |
[in] | bits | Nominal size in bits of the data, optional. |
[in] | alternate | Display this integer value if flags ALTERNATE is set. |