Continuity counters analysis and repair.
More...
#include <tsContinuityAnalyzer.h>
|
static size_t | MissingPackets (int cc1, int cc2) |
| Compute the number of missing packets between two continuity counters.
|
|
Continuity counters analysis and repair.
◆ ContinuityAnalyzer() [1/2]
ts::ContinuityAnalyzer::ContinuityAnalyzer |
( |
const PIDSet & |
pid_filter = NoPID , |
|
|
Report * |
report = nullptr |
|
) |
| |
|
explicit |
Constructor.
- Parameters
-
[in] | pid_filter | The set of PID's to analyze or fix. |
[in] | report | Where to report discontinuity errors. Drop errors if null. |
◆ ContinuityAnalyzer() [2/2]
Copy constructor.
- Parameters
-
[in] | other | Other instance to copy. |
◆ operator=()
Assignment operator.
- Parameters
-
[in] | other | Other instance to copy. |
- Returns
- A reference to this instance.
◆ reset()
void ts::ContinuityAnalyzer::reset |
( |
| ) |
|
Reset all collected information.
Do not change processing options (display and/or fix errors).
◆ feedPacket() [1/2]
bool ts::ContinuityAnalyzer::feedPacket |
( |
const TSPacket & |
pkt | ) |
|
|
inline |
Process a constant TS packet.
Can be used only to report discontinuity errors.
- Parameters
-
[in] | pkt | A transport stream packet. |
- Returns
- True if the packet has no discontinuity error. False if it has an error.
◆ feedPacket() [2/2]
bool ts::ContinuityAnalyzer::feedPacket |
( |
TSPacket & |
pkt | ) |
|
|
inline |
Process or modify a TS packet.
- Parameters
-
[in,out] | pkt | A transport stream packet. It can be modified only when error fixing or generator mode is activated. |
- Returns
- True if the packet had no discontinuity error and is unmodified. False if the packet had an error or was modified.
◆ totalPackets()
Get the total number of TS packets.
- Returns
- The total number of TS packets.
◆ processedPackets()
Get the number of processed TS packets.
Only packets from selected PID's are counted.
- Returns
- The number of processed TS packets.
◆ fixCount()
Get the number of fixed (modified) TS packets.
- Returns
- The number of fixed (modified) TS packets.
◆ errorCount()
Get the number of discontinuity errors.
- Returns
- The number of discontinuity errors.
◆ setReport()
void ts::ContinuityAnalyzer::setReport |
( |
Report * |
report | ) |
|
Change the output device to report errors.
- Parameters
-
[in] | report | Where to report discontinuity errors. Drop errors if null. |
◆ setDisplay()
void ts::ContinuityAnalyzer::setDisplay |
( |
bool |
display | ) |
|
|
inline |
Change error reporting.
- Parameters
-
[in] | display | When true, display discontinuity errors. |
◆ setFix()
void ts::ContinuityAnalyzer::setFix |
( |
bool |
fix | ) |
|
|
inline |
Change error fixing.
- Parameters
-
[in] | fix | When true, fix discontinuity errors. |
◆ setReplicateDuplicated()
void ts::ContinuityAnalyzer::setReplicateDuplicated |
( |
bool |
on | ) |
|
|
inline |
When fixing errors, specify how to handle duplicated packets.
Two successive packets in the same PID are considered as duplicated if they have the same continuity counter and same content (except PCR, if any).
- Parameters
-
[in] | on | When true (the default), duplicated input packets are replicated as duplicated on output (the corresponding output packets have the same continuity counters). When false, the input packets are not considered as duplicated and the output packets have incremented countinuity counters. |
◆ setGenerator()
void ts::ContinuityAnalyzer::setGenerator |
( |
bool |
gen | ) |
|
|
inline |
Set generator mode.
When the generator mode is on, the input continuity counters are always ignored. The output continuity counters are updated to create a continuous stream. No error is reported.
- Parameters
-
[in] | gen | When true, activate generator mode. |
◆ setMessageSeverity()
void ts::ContinuityAnalyzer::setMessageSeverity |
( |
int |
level | ) |
|
|
inline |
Define the severity of messages.
The default severity is Severity::Info.
- Parameters
-
[in] | level | The severity of each message. |
◆ setMessagePrefix()
void ts::ContinuityAnalyzer::setMessagePrefix |
( |
const UString & |
prefix | ) |
|
|
inline |
Define a prefix string to be displayed with each message.
- Parameters
-
[in] | prefix | The prefix string to be displayed with each message. |
◆ setJSON()
void ts::ContinuityAnalyzer::setJSON |
( |
bool |
on | ) |
|
|
inline |
Specify to log messages in JSON format.
If a message prefix is set, it is logged just before the JSON structure and can be used to locate the appropriate JSON messages in a flow of logs.
- Parameters
-
[in] | on | Set the JSON mode on or off. |
◆ setPIDFilter()
void ts::ContinuityAnalyzer::setPIDFilter |
( |
const PIDSet & |
pid_filter | ) |
|
Replace the list of PID's to process.
- Parameters
-
[in] | pid_filter | The list of PID's to process. |
◆ addPID()
void ts::ContinuityAnalyzer::addPID |
( |
PID |
pid | ) |
|
Add one PID to process.
- Parameters
-
[in] | pid | The new PID to process. |
◆ addPIDs()
void ts::ContinuityAnalyzer::addPIDs |
( |
const PIDSet & |
pids | ) |
|
Add several PID's to process.
- Parameters
-
[in] | pids | The list of new PID's to process. |
◆ removePID()
void ts::ContinuityAnalyzer::removePID |
( |
PID |
pid | ) |
|
Remove one PID to process.
- Parameters
-
[in] | pid | The PID to no longer process. |
◆ pidCount()
size_t ts::ContinuityAnalyzer::pidCount |
( |
| ) |
const |
|
inline |
Get the current number of PID's being processed.
- Returns
- The current number of PID's being processed.
◆ hasPID()
bool ts::ContinuityAnalyzer::hasPID |
( |
PID |
pid | ) |
const |
Check if a PID is processed.
- Parameters
-
- Returns
- True if pid is processed.
◆ firstCC()
uint8_t ts::ContinuityAnalyzer::firstCC |
( |
PID |
pid | ) |
const |
Get the first CC in a PID.
- Parameters
-
- Returns
- The first CC value in the PID or ts::INVALID_CC when the PID is not filtered. The first CC in a PID is never modified.
◆ lastCC()
uint8_t ts::ContinuityAnalyzer::lastCC |
( |
PID |
pid | ) |
const |
Get the last CC in a PID.
- Parameters
-
- Returns
- The last CC value in the PID or ts::INVALID_CC when the PID is not filtered. This is the output CC value, possibly modified.
◆ dupCount()
size_t ts::ContinuityAnalyzer::dupCount |
( |
PID |
pid | ) |
const |
Get the last duplicate packet count for a PID.
- Parameters
-
- Returns
- The last duplicate packet count for the PID or ts::NPOS when the PID is not filtered.
◆ lastPacket()
TSPacket ts::ContinuityAnalyzer::lastPacket |
( |
PID |
pid | ) |
const |
Get the last transport stream packet that was passed to feedPacket() for a PID.
- Parameters
-
- Returns
- The last packet for the PID or ts::NullPacket when the PID is not filtered.
◆ getLastPacket()
void ts::ContinuityAnalyzer::getLastPacket |
( |
PID |
pid, |
|
|
TSPacket & |
packet |
|
) |
| const |
Get the last transport stream packet that was passed to feedPacket() for a PID.
- Parameters
-
[in] | pid | The PID to check. |
[out] | packet | The last packet for the PID or ts::NullPacket when the PID is not filtered. |
◆ MissingPackets()
static size_t ts::ContinuityAnalyzer::MissingPackets |
( |
int |
cc1, |
|
|
int |
cc2 |
|
) |
| |
|
static |
Compute the number of missing packets between two continuity counters.
- Parameters
-
[in] | cc1 | First continuity counter. |
[in] | cc2 | Second continuity counter. |
- Returns
- Number of missing packets between cc1 and cc2.
The documentation for this class was generated from the following file: