Packetization of PES data into Transport Stream packets in one shot.
More...
#include <tsPESOneShotPacketizer.h>
|
| PESOneShotPacketizer (const DuckContext &duck, PID pid=PID_NULL) |
| Constructor.
|
|
virtual | ~PESOneShotPacketizer () override |
| Destructor.
|
|
bool | addPES (const PESPacket &pes, ShareMode mode) |
| Add a PES packet to packetize.
|
|
bool | addPES (const PESPacketPtr &pes) |
| Add a PES packet to packetize.
|
|
bool | atPESBoundary () const |
| Check if the TS packet stream is exactly at a PES packet boundary.
|
|
virtual std::ostream & | display (std::ostream &strm) const override |
| Display the internal state of the packetizer, mainly for debug.
|
|
const DuckContext & | duck () const |
| Get a reference to the TSDuck execution context.
|
|
bool | empty () const |
| Check if the packetizer is empty (no more TS packet to produce).
|
|
void | getPackets (TSPacketVector &packets) |
| Get all enqueued PES packets as one list of TS packets.
|
|
PID | getPID () const |
| Get the default PID for subsequent MPEG packets.
|
|
uint8_t | nextContinuityCounter () const |
| Get the continuity counter value for next MPEG packet.
|
|
PacketCounter | packetCount () const |
| Get the number of generated TS packets so far.
|
|
PacketCounter | pesCount () const |
| Get the number of completely packetized PES packets so far.
|
|
PESProviderInterface * | pesProvider () const |
| Get the object which provides PES packets when the packetizer needs more data.
|
|
Report & | report () const |
| Get a reference to the debugging report.
|
|
virtual void | reset () override |
| Reset the packetizer.
|
|
void | setMaxQueuedPackets (size_t count) |
| Set a limit to the number of internally queued PES packets.
|
|
void | setNextContinuityCounter (uint8_t cc) |
| Set the continuity counter value for next MPEG packet.
|
|
void | setPID (PID pid) |
| Set the default PID for subsequent MPEG packets.
|
|
Packetization of PES data into Transport Stream packets in one shot.
◆ PESOneShotPacketizer()
Constructor.
- Parameters
-
[in] | duck | TSDuck execution context. The reference is kept inside the packetizer. |
[in] | pid | PID for generated TS packets. |
◆ getPackets()
Get all enqueued PES packets as one list of TS packets.
- Parameters
-
[out] | packets | Returned list of TS packets containing all TS packets. |
◆ setMaxQueuedPackets()
void ts::PESStreamPacketizer::setMaxQueuedPackets |
( |
size_t |
count | ) |
|
|
inlineinherited |
Set a limit to the number of internally queued PES packets.
This is a way to limit the internal memory which is used by this instance.
- Parameters
-
[in] | count | Maximum number of internally queued PES packets. If the number of already queued packets is already higher, none is dropped. If count is zero, there is no limit (this is the initial default). |
◆ addPES() [1/2]
bool ts::PESStreamPacketizer::addPES |
( |
const PESPacketPtr & |
pes | ) |
|
|
inherited |
Add a PES packet to packetize.
- Parameters
-
[in] | pes | A safe pointer to the PES packet. |
- Returns
- True on success, false if the enqueue limit is reached.
◆ addPES() [2/2]
Add a PES packet to packetize.
- Parameters
-
[in] | pes | The PES packet. |
[in] | mode | The enqueue PES packet's data are either shared (ShareMode::SHARE) between the provided pes or duplicated (ShareMode::COPY). |
- Returns
- True on success, false if the enqueue limit is reached.
◆ empty()
bool ts::PESStreamPacketizer::empty |
( |
| ) |
const |
|
inlineinherited |
Check if the packetizer is empty (no more TS packet to produce).
- Returns
- True if the packetizer is empty, false otherwise.
◆ reset()
virtual void ts::PESStreamPacketizer::reset |
( |
| ) |
|
|
overridevirtualinherited |
Reset the packetizer.
All unfinished items (sections or PES packets) are dropped.
Reimplemented from ts::PESPacketizer.
◆ display()
virtual std::ostream & ts::PESStreamPacketizer::display |
( |
std::ostream & |
strm | ) |
const |
|
overridevirtualinherited |
Display the internal state of the packetizer, mainly for debug.
- Parameters
-
[in,out] | strm | Output text stream. |
- Returns
- A reference to strm.
Reimplemented from ts::PESPacketizer.
◆ pesProvider()
Get the object which provides PES packets when the packetizer needs more data.
- Returns
- The object which will be called each time a PES packet is required.
◆ atPESBoundary()
bool ts::PESPacketizer::atPESBoundary |
( |
| ) |
const |
|
inlineinherited |
Check if the TS packet stream is exactly at a PES packet boundary.
- Returns
- True if the last returned TS packet contained the end of a PES packet.
◆ pesCount()
Get the number of completely packetized PES packets so far.
- Returns
- The number of completely packetized PES packets so far.
◆ setPID()
void ts::AbstractPacketizer::setPID |
( |
PID |
pid | ) |
|
|
inlineinherited |
Set the default PID for subsequent MPEG packets.
- Parameters
-
[in] | pid | PID for generated TS packets. |
◆ getPID()
PID ts::AbstractPacketizer::getPID |
( |
| ) |
const |
|
inlineinherited |
Get the default PID for subsequent MPEG packets.
- Returns
- PID for generated TS packets.
◆ setNextContinuityCounter()
void ts::AbstractPacketizer::setNextContinuityCounter |
( |
uint8_t |
cc | ) |
|
|
inlineinherited |
Set the continuity counter value for next MPEG packet.
This counter is automatically incremented at each packet. It is usually never a good idea to change this, except maybe before generating the first packet if the continuity must be preserved with the previous content of the PID.
- Parameters
-
[in] | cc | Next continuity counter. |
◆ nextContinuityCounter()
uint8_t ts::AbstractPacketizer::nextContinuityCounter |
( |
| ) |
const |
|
inlineinherited |
Get the continuity counter value for next MPEG packet.
- Returns
- Next continuity counter.
◆ packetCount()
Get the number of generated TS packets so far.
- Returns
- The number of generated TS packets so far.
◆ report()
Report & ts::AbstractPacketizer::report |
( |
| ) |
const |
|
inlineinherited |
Get a reference to the debugging report.
- Returns
- A reference to the debugging report.
◆ duck()
const DuckContext & ts::AbstractPacketizer::duck |
( |
| ) |
const |
|
inlineinherited |
Get a reference to the TSDuck execution context.
- Returns
- A reference to the TSDuck execution context.
◆ configurePacket()
void ts::AbstractPacketizer::configurePacket |
( |
TSPacket & |
pkt, |
|
|
bool |
nullify |
|
) |
| |
|
protectedinherited |
Configure a TS packet with continuity and PID.
Also increment the number of generated packet. So this method must be called exactly once per packet.
- Parameters
-
[in,out] | pkt | TS packet to configure |
[in] | nullify | Return a null packet instead (no data to return for now). |
The documentation for this class was generated from the following file: