TSDuck v3.38-3699
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::EITProcessor Class Reference

Perform various transformations on an EIT PID. More...

#include <tsEITProcessor.h>

Inheritance diagram for ts::EITProcessor:
Collaboration diagram for ts::EITProcessor:

Public Member Functions

 EITProcessor (DuckContext &duck, PID pid=PID_EIT)
 Constructor.
 
void addInputPID (PID pid)
 Add an input PID without altering the output PID.
 
void addStartTimeOffet (cn::milliseconds offset, bool date_only=false)
 Add an offset to all start times of all events in all EIT's.
 
void clearInputPIDs ()
 Clear the set of input PID's.
 
bool filterServices () const
 Check if some service filtering is set (keep or remove specific services).
 
size_t getCurrentBufferedSections () const
 Get the current number of buffered sections.
 
size_t getMaxBufferedSections () const
 Get the maximum number of buffered sections.
 
void keepService (const Service &service)
 Keep all EIT's for a given service.
 
void keepService (uint16_t service_id)
 Keep all EIT's for a given service in the current transport stream (EIT Actual).
 
void processPacket (TSPacket &pkt)
 Process one packet from the stream.
 
void removeActual ()
 Remove all EIT Actual.
 
void removeOther ()
 Remove all EIT Other.
 
void removePresentFollowing ()
 Remove all EIT Present/Following.
 
void removeSchedule ()
 Remove all EIT Schedule.
 
void removeService (const Service &service)
 Remove all EIT's for a given service.
 
void removeService (uint16_t service_id)
 Remove all EIT's for a given service in the current transport stream (EIT Actual).
 
void removeTableIds (std::initializer_list< TID > tids)
 Remove all EIT's with a table id in a given list.
 
void removeTS (const TransportStreamId &ts)
 Remove all EIT's for a given transport stream.
 
void removeTS (uint16_t ts_id)
 Remove all EIT's for a given transport stream.
 
void renameService (const Service &old_service, const Service &new_service)
 Rename all EIT's for a given service.
 
void renameTS (const TransportStreamId &old_ts, const TransportStreamId &new_ts)
 Rename all EIT's for a given transport stream.
 
void renameTS (uint16_t old_ts_id, uint16_t new_ts_id)
 Rename all EIT's for a given transport stream.
 
void reset ()
 Reset the EIT processor to default state.
 
void setInputPID (PID pid)
 Set one single input PID without altering the output PID.
 
void setMaxBufferedSections (size_t count)
 Set the maximum number of buffered sections.
 
void setOutputPID (PID pid)
 Change the output PID without altering the input PID's.
 
void setPID (PID pid)
 Change the single PID containing EIT's to process.
 

Static Public Attributes

static constexpr size_t DEFAULT_BUFFERED_SECTIONS = 1000
 Default number of buffered sections.
 
static constexpr size_t MIN_BUFFERED_SECTIONS = 10
 Minimum number of buffered sections.
 

Detailed Description

Perform various transformations on an EIT PID.

The object is continuously invoked for all packets in a TS. Packets from one specific PID, the EIT PID, are replaced. The various required transformations on the EIT's are performed.

More generally, there are several input PID's and one output PID. All EIT sections from any input PID are merged into one single output PID. All input PID's are overwritten by packets for the output PID (or null packets).

By default, there is only one input PID which is also used as output PID. This is PID 0x12, the standard DVB PID for EIT's.

Constructor & Destructor Documentation

◆ EITProcessor()

ts::EITProcessor::EITProcessor ( DuckContext duck,
PID  pid = PID_EIT 
)
explicit

Constructor.

Parameters
[in,out]duckTSDuck execution context. The reference is kept inside this object.
[in]pidThe PID containing EIT's to process. This PID is used as only input PID and output PID.

Member Function Documentation

◆ setPID()

void ts::EITProcessor::setPID ( PID  pid)

Change the single PID containing EIT's to process.

Parameters
[in]pidThe PID containing EIT's to process. This PID is used as only input PID and output PID.

◆ setInputPID()

void ts::EITProcessor::setInputPID ( PID  pid)

Set one single input PID without altering the output PID.

Parameters
[in]pidThe single input PID.

◆ setOutputPID()

void ts::EITProcessor::setOutputPID ( PID  pid)

Change the output PID without altering the input PID's.

Parameters
[in]pidThe output PID.

◆ addInputPID()

void ts::EITProcessor::addInputPID ( PID  pid)

Add an input PID without altering the output PID.

Parameters
[in]pidAn input PID to add.

◆ reset()

void ts::EITProcessor::reset ( )

Reset the EIT processor to default state.

The input and output PID's are unchanged.

◆ processPacket()

void ts::EITProcessor::processPacket ( TSPacket pkt)

Process one packet from the stream.

Parameters
[in,out]pktA TS packet from the stream. If the packet belongs to the EIT PID, it is updated with the new content.

◆ removeTS() [1/2]

void ts::EITProcessor::removeTS ( uint16_t  ts_id)

Remove all EIT's for a given transport stream.

Parameters
[in]ts_idId of the transport stream to remove (any original network id).

◆ removeTS() [2/2]

void ts::EITProcessor::removeTS ( const TransportStreamId ts)

Remove all EIT's for a given transport stream.

Parameters
[in]tsTransport stream id and original network id to remove.

◆ renameTS() [1/2]

void ts::EITProcessor::renameTS ( uint16_t  old_ts_id,
uint16_t  new_ts_id 
)

Rename all EIT's for a given transport stream.

Parameters
[in]old_ts_idId of the transport stream to rename (any original network id).
[in]new_ts_idNew transport stream id (original network id unchanged).

◆ renameTS() [2/2]

void ts::EITProcessor::renameTS ( const TransportStreamId old_ts,
const TransportStreamId new_ts 
)

Rename all EIT's for a given transport stream.

Parameters
[in]old_tsTransport stream id and original network id to rename.
[in]new_tsNew transport stream id and original network id.

◆ keepService() [1/2]

void ts::EITProcessor::keepService ( uint16_t  service_id)

Keep all EIT's for a given service in the current transport stream (EIT Actual).

Parameters
[in]service_idId of the service to keep in EIT Actual.

Note: Keeping services always prevails over removing them. This means that if keepService() is called once or more, all services are removed except the explicitly kept ones and removeService() is ignored.

◆ keepService() [2/2]

void ts::EITProcessor::keepService ( const Service service)

Keep all EIT's for a given service.

Parameters
[in]serviceDescription of the service to keep.
See also
keepService(uint16_t)

◆ removeService() [1/2]

void ts::EITProcessor::removeService ( uint16_t  service_id)

Remove all EIT's for a given service in the current transport stream (EIT Actual).

Parameters
[in]service_idId of the service to remove in EIT Actual.
See also
keepService(uint16_t)

◆ removeService() [2/2]

void ts::EITProcessor::removeService ( const Service service)

Remove all EIT's for a given service.

Parameters
[in]serviceDescription of the service to remove.
See also
keepService(uint16_t)

◆ filterServices()

bool ts::EITProcessor::filterServices ( ) const
inline

Check if some service filtering is set (keep or remove specific services).

Returns
True if some service filtering is set (keep or remove specific services).

◆ renameService()

void ts::EITProcessor::renameService ( const Service old_service,
const Service new_service 
)

Rename all EIT's for a given service.

Parameters
[in]old_serviceDescription of the service to rename.
[in]new_serviceNew description of the service.

◆ removeTableIds()

void ts::EITProcessor::removeTableIds ( std::initializer_list< TID tids)

Remove all EIT's with a table id in a given list.

Parameters
[in]tidsList of all table ids to remove.

◆ addStartTimeOffet()

void ts::EITProcessor::addStartTimeOffet ( cn::milliseconds  offset,
bool  date_only = false 
)

Add an offset to all start times of all events in all EIT's.

Parameters
[in]offsetThe number of milliseconds to add to each start time. Can be negative.
[in]date_onlyIf true, update the date field only, do not modify the hour/minute/second.

◆ setMaxBufferedSections()

void ts::EITProcessor::setMaxBufferedSections ( size_t  count)

Set the maximum number of buffered sections.

A few number of EIT sections may be temporarily buffered.

Each EIT section is completely loaded, modified and reinjected, replacing input packets. If the currently reinjected EIT section is very large and, at the same time, a lot of small EIT sections are received, they must be buffered. This is normally a transient situation. Since the number of reinjected sections is at most identical to the input number and since EIT sections are never enlarged, there is no global overflow.

This method is used to adjust the maximum number of buffered sections.

Parameters
[in]countNew maximum number of buffered sections.

◆ getMaxBufferedSections()

size_t ts::EITProcessor::getMaxBufferedSections ( ) const
inline

Get the maximum number of buffered sections.

Returns
The maximum number of buffered sections.
See also
setMaxBufferedSections()

◆ getCurrentBufferedSections()

size_t ts::EITProcessor::getCurrentBufferedSections ( ) const
inline

Get the current number of buffered sections.

Returns
The current number of buffered sections.
See also
setMaxBufferedSections()

Member Data Documentation

◆ MIN_BUFFERED_SECTIONS

constexpr size_t ts::EITProcessor::MIN_BUFFERED_SECTIONS = 10
staticconstexpr

Minimum number of buffered sections.

See also
setMaxBufferedSections()

◆ DEFAULT_BUFFERED_SECTIONS

constexpr size_t ts::EITProcessor::DEFAULT_BUFFERED_SECTIONS = 1000
staticconstexpr

Default number of buffered sections.

See also
setMaxBufferedSections()

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