TSDuck v3.46-4930
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::SpliceSchedule Class Reference

#include <tsSpliceSchedule.h>

Inheritance diagram for ts::SpliceSchedule:
Collaboration diagram for ts::SpliceSchedule:

Classes

class  Event

Public Types

using EventList = std::list<Event>
using UTCByComponent = std::map<uint8_t, uint32_t>

Public Member Functions

 SpliceSchedule ()
virtual void clear ()
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
int deserialize (const uint8_t *data, size_t size)
void display (TablesDisplay &display, const UString &margin) const
virtual void fromXML (DuckContext &duck, const xml::Element *element)
void invalidate ()
bool isValid () const
void serialize (ByteBlock &data) const
virtual xml::Element * toXML (DuckContext &duck, xml::Element *parent) const
UString xmlName () const

Static Public Member Functions

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 uint32_t FromUTCTime (const DuckContext &duck, const Time &value)
static Time ToUTCTime (const DuckContext &duck, uint32_t value)

Public Attributes

EventList events {}
 The events in the SpliceSchedule command.

Static Public Attributes

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

virtual bool analyzeXML (DuckContext &, const xml::Element *) override
virtual void buildXML (DuckContext &, xml::Element *) const override
virtual void clearContent () override

Detailed Description

Representation of an SCTE 35 SpliceSchedule command.

See also
ANSI/SCTE 35, 9.3.2.

Member Typedef Documentation

◆ UTCByComponent

using ts::SpliceSchedule::UTCByComponent = std::map<uint8_t, uint32_t>

A map of 32-bit UTC time values, indexed by 8-bit component tags. Used when the program is splice component by component, not as a whole.

◆ EventList

A list of splice Event structures.

Constructor & Destructor Documentation

◆ SpliceSchedule()

ts::SpliceSchedule::SpliceSchedule ( )

Default constructor.

Member Function Documentation

◆ display()

void ts::SpliceSchedule::display ( TablesDisplay & display,
const UString & margin ) const

Display the splice insert command.

Parameters
[in,out]displayDisplay engine.
[in]marginLeft margin content.

◆ deserialize()

int ts::SpliceSchedule::deserialize ( const uint8_t * data,
size_t size )

Deserialize a SpliceSchedule command from binary data.

Parameters
[in]dataAddress of data to deserialize.
[in]sizeSize of data buffer, possibly larger than the SpliceSchedule command.
Returns
Deserialized size, -1 on incorrect data.

◆ serialize()

void ts::SpliceSchedule::serialize ( ByteBlock & data) const

Serialize the SpliceSchedule command.

Parameters
[in,out]dataThe SpliceSchedule command is serialized at the end of this byte block.

◆ ToUTCTime()

Time ts::SpliceSchedule::ToUTCTime ( const DuckContext & duck,
uint32_t value )
static

Convert a 32-bit SCTE 35 utc_splice_time to an actual UTC time.

Parameters
[in]duckTSDuck execution context.
[in]valueA 32-bit SCTE 35 utc_splice_time.
Returns
The corresponding UTC time.

◆ FromUTCTime()

uint32_t ts::SpliceSchedule::FromUTCTime ( const DuckContext & duck,
const Time & value )
static

Convert a UTC time into a 32-bit SCTE 35 utc_splice_time.

Parameters
[in]duckTSDuck execution context.
[in]valueA UTC time.
Returns
The corresponding 32-bit SCTE 35 utc_splice_time.

◆ clearContent()

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

◆ buildXML()

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

◆ 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.

◆ clear()

virtual void ts::AbstractSignalization::clear ( )
virtualinherited

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 in ts::AbstractLongTable, and ts::AbstractTable.

◆ xmlName()

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

Get the XMl node name representing this table or descriptor.

Returns
The XML node name.

◆ toXML()

virtual xml::Element * ts::AbstractSignalization::toXML ( DuckContext & duck,
xml::Element * parent ) const
virtualinherited

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

◆ fromXML()

virtual void ts::AbstractSignalization::fromXML ( DuckContext & duck,
const xml::Element * element )
virtualinherited

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

◆ 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

◆ 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: