TSDuck v3.40-3963
MPEG Transport Stream Toolkit
|
This class merges PSI/SI tables from two TS, replacing TS packets. More...
#include <tsPSIMerger.h>
Public Types | |
enum | Options : uint32_t { NONE = 0x00000000 , MERGE_PAT = 0x00000001 , MERGE_CAT = 0x00000002 , MERGE_NIT = 0x00000004 , MERGE_SDT = 0x00000008 , MERGE_BAT = 0x00000010 , MERGE_EIT = 0x00000020 , KEEP_MAIN_TDT = 0x00000040 , KEEP_MERGE_TDT = 0x00000080 , NULL_MERGED = 0x00000100 , NULL_UNMERGED = 0x00000200 , DEFAULT = MERGE_PAT | MERGE_CAT | MERGE_NIT | MERGE_SDT | MERGE_BAT | MERGE_EIT | NULL_MERGED | NULL_UNMERGED } |
Merging options. More... | |
Public Member Functions | |
PSIMerger (DuckContext &duck, Options options=DEFAULT) | |
Constructor. | |
bool | feedMainPacket (TSPacket &pkt) |
Feed a packet from the main stream. | |
bool | feedMergedPacket (TSPacket &pkt) |
Feed a packet from the merged stream. | |
void | reset () |
Reset the PSI merger. | |
void | reset (Options options) |
Reset the PSI merger with new options. | |
This class merges PSI/SI tables from two TS, replacing TS packets.
Definitions:
The packets from the two streams are passed using two distinct methods: feedMainPacket() and feedMergedPacket(). The packets from the main stream can be modified to overwrite PSI/SI packets. Packets from the merged stream may be overwritten when they carry EIT's, depending on settings.
The following tables can be merged: PAT, SDT, BAT, NIT. The EIT can also be merged, but in a different way. The PAT, SDT, BAT, NIT are fully merged. The two PAT, for instance, are merged into one single PAT containing all services from the two PAT's. The new PAT is cycled in replacement of the packets from the main stream containing the main PAT. All EIT's for the two streams are left unmodified but are mixed into one single PID. The mixed stream of EIT's is written in replacement of the EIT streams from the two streams.
enum ts::PSIMerger::Options : uint32_t |
Merging options.
Can be used as bitmasks.
Enumerator | |
---|---|
NONE | Do not merge anything. |
MERGE_PAT | Merge the two PAT's into one. |
MERGE_CAT | Merge the two CAT's into one. |
MERGE_NIT | Merge the two NIT's Actual into one. The NIT Others are mixed in the NIT PID. |
MERGE_SDT | Merge the two SDT's Actual into one. The SDT Others are mixed in the SDT/BAT PID. |
MERGE_BAT | Merge the BAT's from the same bouquet into one. |
MERGE_EIT | Mix the EIT's from the two streams. |
KEEP_MAIN_TDT | Keep TDT/TOT from main stream. |
KEEP_MERGE_TDT | Keep TDT/TOT from merge stream. It is dangerous to use KEEP_MAIN_TDT and KEEP_MERGE_TDT at the same time. |
NULL_MERGED | Nullify packets from the merged stream when they carried merged PSI (PAT, NIT, SDT, BAT). EIT are merged, not nullified. |
NULL_UNMERGED | Nullify packets from the merged stream when they carry unmerged PSI (PAT, NIT, SDT, BAT, EIT). |
DEFAULT | Default options: merge all. |
|
explicit |
Constructor.
[in,out] | duck | TSDuck execution context. The reference is kept inside the demux. Contextual information (such as standards) are accumulated in the context from demuxed sections, from both streams. |
[in] | options | Bitmask of option values. |
bool ts::PSIMerger::feedMainPacket | ( | TSPacket & | pkt | ) |
Feed a packet from the main stream.
[in,out] | pkt | A packet from the first stream. When the packet contains tables to merge, it is replaced. |
bool ts::PSIMerger::feedMergedPacket | ( | TSPacket & | pkt | ) |
Feed a packet from the merged stream.
[in,out] | pkt | A packet from the first stream. When the packet contains tables which can be merged, it can be replaced by null packets or EIT sections, depending on options. |
void ts::PSIMerger::reset | ( | ) |
Reset the PSI merger.
All contexts are erased. The options are left unchanged.
void ts::PSIMerger::reset | ( | Options | options | ) |
Reset the PSI merger with new options.
All contexts are erased.
[in] | options | Bitmask of option values. |