TSDuck v3.40-3963
MPEG Transport Stream Toolkit
|
Perform various transformations on an EIT PID. More...
#include <tsEITProcessor.h>
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. | |
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.
|
explicit |
Constructor.
[in,out] | duck | TSDuck execution context. The reference is kept inside this object. |
[in] | pid | The PID containing EIT's to process. This PID is used as only input PID and output PID. |
void ts::EITProcessor::setPID | ( | PID | pid | ) |
void ts::EITProcessor::setInputPID | ( | PID | pid | ) |
Set one single input PID without altering the output PID.
[in] | pid | The single input PID. |
void ts::EITProcessor::setOutputPID | ( | PID | pid | ) |
Change the output PID without altering the input PID's.
[in] | pid | The output PID. |
void ts::EITProcessor::addInputPID | ( | PID | pid | ) |
Add an input PID without altering the output PID.
[in] | pid | An input PID to add. |
void ts::EITProcessor::reset | ( | ) |
Reset the EIT processor to default state.
The input and output PID's are unchanged.
void ts::EITProcessor::processPacket | ( | TSPacket & | pkt | ) |
Process one packet from the stream.
[in,out] | pkt | A TS packet from the stream. If the packet belongs to the EIT PID, it is updated with the new content. |
void ts::EITProcessor::removeTS | ( | uint16_t | ts_id | ) |
Remove all EIT's for a given transport stream.
[in] | ts_id | Id of the transport stream to remove (any original network id). |
void ts::EITProcessor::removeTS | ( | const TransportStreamId & | ts | ) |
Remove all EIT's for a given transport stream.
[in] | ts | Transport stream id and original network id to remove. |
void ts::EITProcessor::renameTS | ( | uint16_t | old_ts_id, |
uint16_t | new_ts_id | ||
) |
Rename all EIT's for a given transport stream.
[in] | old_ts_id | Id of the transport stream to rename (any original network id). |
[in] | new_ts_id | New transport stream id (original network id unchanged). |
void ts::EITProcessor::renameTS | ( | const TransportStreamId & | old_ts, |
const TransportStreamId & | new_ts | ||
) |
Rename all EIT's for a given transport stream.
[in] | old_ts | Transport stream id and original network id to rename. |
[in] | new_ts | New transport stream id and original network id. |
void ts::EITProcessor::keepService | ( | uint16_t | service_id | ) |
Keep all EIT's for a given service in the current transport stream (EIT Actual).
[in] | service_id | Id 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.
void ts::EITProcessor::keepService | ( | const Service & | service | ) |
Keep all EIT's for a given service.
[in] | service | Description of the service to keep. |
void ts::EITProcessor::removeService | ( | uint16_t | service_id | ) |
Remove all EIT's for a given service in the current transport stream (EIT Actual).
[in] | service_id | Id of the service to remove in EIT Actual. |
void ts::EITProcessor::removeService | ( | const Service & | service | ) |
Remove all EIT's for a given service.
[in] | service | Description of the service to remove. |
|
inline |
Check if some service filtering is set (keep or remove specific services).
Rename all EIT's for a given service.
[in] | old_service | Description of the service to rename. |
[in] | new_service | New description of the service. |
void ts::EITProcessor::removeTableIds | ( | std::initializer_list< TID > | tids | ) |
Remove all EIT's with a table id in a given list.
[in] | tids | List of all table ids to remove. |
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.
[in] | offset | The number of milliseconds to add to each start time. Can be negative. |
[in] | date_only | If true, update the date field only, do not modify the hour/minute/second. |
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.
[in] | count | New maximum number of buffered sections. |
|
inline |
Get the maximum number of buffered sections.
|
inline |
Get the current number of buffered sections.
|
staticconstexpr |
Minimum number of buffered sections.
|
staticconstexpr |
Default number of buffered sections.