#include <tsOneShotPacketizer.h>
|
| | OneShotPacketizer (const DuckContext &duck, PID pid=PID_NULL, bool do_stuffing=false, const BitRate &bitrate=0) |
| virtual | ~OneShotPacketizer () override |
| void | addSection (const SectionPtr §ion, cn::milliseconds repetition_rate=cn::milliseconds::zero()) |
| void | addSections (const SectionPtrVector §ions, cn::milliseconds repetition_rate=cn::milliseconds::zero()) |
| void | addTable (const BinaryTable &table, cn::milliseconds repetition_rate=cn::milliseconds::zero()) |
| void | addTable (DuckContext &duck, const AbstractTable &table, cn::milliseconds repetition_rate=cn::milliseconds::zero()) |
| void | allowHeaderSplit (bool allow) |
| bool | atCycleBoundary () const |
| bool | atSectionBoundary () const |
| BitRate | bitRate () const |
| virtual std::ostream & | display (std::ostream &strm) const override |
| const DuckContext & | duck () const |
| void | getPackets (TSPacketVector &packets) |
| PID | getPID () const |
| bool | headerSplitAllowed () const |
| uint8_t | nextContinuityCounter () const |
| PacketCounter | packetCount () const |
| void | removeAll () |
| void | removeSections (TID tid) |
| void | removeSections (TID tid, uint16_t tid_ext) |
| void | removeSections (TID tid, uint16_t tid_ext, uint8_t sec_number) |
| Report & | report () const |
| virtual void | reset () override |
| SectionCounter | sectionCount () const |
| SectionProviderInterface * | sectionProvider () const |
| void | setBitRate (const BitRate &bitrate) |
| void | setNextContinuityCounter (uint8_t cc) |
| void | setPID (PID pid) |
| void | setStuffingPolicy (bool do_stuffing) |
| SectionCounter | storedSectionCount () const |
| StuffingPolicy | stuffingPolicy () const |
Packetization of MPEG sections into Transport Stream packets in one shot.
◆ StuffingPolicy
Specify where stuffing applies.
| Enumerator |
|---|
| NEVER | No stuffing, always pack sections.
|
| AT_END | Stuffing at end of cycle, pack sections inside cycle.
|
| ALWAYS | Always stuffing, never pack sections.
|
◆ OneShotPacketizer()
Default constructor.
- Parameters
-
| [in] | duck | TSDuck execution context. The reference is kept inside the packetizer. |
| [in] | pid | PID for generated TS packets. |
| [in] | do_stuffing | TS packet stuffing at end of section. |
| [in] | bitrate | Output bitrate, zero if undefined. Useful only when using specific repetition rates for sections |
◆ ~OneShotPacketizer()
| virtual ts::OneShotPacketizer::~OneShotPacketizer |
( |
| ) |
|
|
overridevirtual |
◆ setStuffingPolicy()
| void ts::OneShotPacketizer::setStuffingPolicy |
( |
bool | do_stuffing | ) |
|
|
inline |
Set the stuffing policy.
- Parameters
-
| [in] | do_stuffing | TS packet stuffing at end of section. |
◆ getPackets()
Get a complete cycle as one list of TS packets.
- Parameters
-
| [out] | packets | Returned list of TS packets containing a complete cycle. |
◆ stuffingPolicy()
Get the TS packet stuffing policy at end of packet.
- Returns
- TS packet stuffing policy at end of packet.
◆ setBitRate()
| void ts::CyclingPacketizer::setBitRate |
( |
const BitRate & | bitrate | ) |
|
|
inherited |
Set the bitrate of the generated PID. Useful only when using specific repetition rates for sections
- Parameters
-
| [in] | bitrate | Output bitrate, zero if undefined. |
◆ bitRate()
| BitRate ts::CyclingPacketizer::bitRate |
( |
| ) |
const |
|
inlineinherited |
Get the bitrate of the generated PID.
- Returns
- Output bitrate, zero if undefined.
◆ addSection()
| void ts::CyclingPacketizer::addSection |
( |
const SectionPtr & | section, |
|
|
cn::milliseconds | repetition_rate = cn::milliseconds::zero() ) |
|
inherited |
Add one section into the packetizer. The contents of the sections are shared.
- Parameters
-
| [in] | section | A smart pointer to the section to packetize. |
| [in] | repetition_rate | Repetition rate of the section in milliseconds. If zero, simply packetize sections one after the other. |
◆ addSections()
| void ts::CyclingPacketizer::addSections |
( |
const SectionPtrVector & | sections, |
|
|
cn::milliseconds | repetition_rate = cn::milliseconds::zero() ) |
|
inherited |
Add some sections into the packetizer. The contents of the sections are shared.
- Parameters
-
| [in] | sections | A vector of smart pointer to the sections to packetize. |
| [in] | repetition_rate | Repetition rate of the sections in milliseconds. If zero, simply packetize sections one after the other. |
◆ addTable() [1/2]
| void ts::CyclingPacketizer::addTable |
( |
const BinaryTable & | table, |
|
|
cn::milliseconds | repetition_rate = cn::milliseconds::zero() ) |
|
inherited |
Add all sections of a binary table into the packetizer. The contents of the sections are shared. If the table is not complete (there are missing sections), the sections which are present are individually added.
- Parameters
-
| [in] | table | A binary table to packetize. |
| [in] | repetition_rate | Repetition rate of the sections in milliseconds. If zero, simply packetize sections one after the other. |
◆ addTable() [2/2]
| void ts::CyclingPacketizer::addTable |
( |
DuckContext & | duck, |
|
|
const AbstractTable & | table, |
|
|
cn::milliseconds | repetition_rate = cn::milliseconds::zero() ) |
|
inherited |
Add all sections of a typed table into the packetizer.
- Parameters
-
| [in,out] | duck | TSDuck execution context. |
| [in] | table | A table to packetize. |
| [in] | repetition_rate | Repetition rate of the sections in milliseconds. If zero, simply packetize sections one after the other. |
◆ removeSections() [1/3]
| void ts::CyclingPacketizer::removeSections |
( |
TID | tid | ) |
|
|
inherited |
Remove all sections with the specified table id. If one such section is currently being packetized, the rest of the section will be packetized.
- Parameters
-
| [in] | tid | The table id of the sections to remove. |
◆ removeSections() [2/3]
| void ts::CyclingPacketizer::removeSections |
( |
TID | tid, |
|
|
uint16_t | tid_ext ) |
|
inherited |
Remove all sections with the specified table id and table id extension. If one such section is currently being packetized, the rest of the section will be packetized.
- Parameters
-
| [in] | tid | The table id of the sections to remove. |
| [in] | tid_ext | The table id extension of the sections to remove. |
◆ removeSections() [3/3]
| void ts::CyclingPacketizer::removeSections |
( |
TID | tid, |
|
|
uint16_t | tid_ext, |
|
|
uint8_t | sec_number ) |
|
inherited |
Remove all sections with the specified table id, table id extension and section number. If one such section is currently being packetized, the rest of the section will be packetized.
- Parameters
-
| [in] | tid | The table id of the sections to remove. |
| [in] | tid_ext | The table id extension of the sections to remove. |
| [in] | sec_number | The section number of the sections to remove. |
◆ removeAll()
| void ts::CyclingPacketizer::removeAll |
( |
| ) |
|
|
inherited |
Remove all sections in the packetizer. If a section is currently being packetized, the rest of the section will be packetized.
◆ storedSectionCount()
Get the number of stored sections to packetize.
- Returns
- The number of stored sections to packetize.
◆ atCycleBoundary()
| bool ts::CyclingPacketizer::atCycleBoundary |
( |
| ) |
const |
|
inherited |
Check if the last generated packet was the last packet in the cycle. Note that if the stuffing policy is NEVER, this is not reliable since it is unlikely that a packet actually terminates a cycle.
- Returns
- True when the last generated packet was the last packet in the cycle.
◆ reset()
| virtual void ts::CyclingPacketizer::reset |
( |
| ) |
|
|
overridevirtualinherited |
Reset the packetizer. All unfinished items (sections or PES packets) are dropped.
Reimplemented from ts::Packetizer.
◆ display()
| virtual std::ostream & ts::CyclingPacketizer::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::Packetizer.
◆ sectionProvider()
Get the object which provides MPEG sections when the packetizer needs a new section.
- Returns
- The object which will be called each time a section is required.
◆ atSectionBoundary()
| bool ts::Packetizer::atSectionBoundary |
( |
| ) |
const |
|
inlineinherited |
Check if the packet stream is exactly at a section boundary.
- Returns
- True if the last returned packet contained the end of a section and no unfinished section.
◆ sectionCount()
Get the number of completely packetized sections so far.
- Returns
- The number of completely packetized sections so far.
◆ allowHeaderSplit()
| void ts::Packetizer::allowHeaderSplit |
( |
bool | allow | ) |
|
|
inlineinherited |
Allow or disallow splitting section headers across TS packets. By default, a Packetizer never splits a section header between two TS packets. This is not required by the MPEG standard but some STB are known to have problems with that.
- Parameters
-
| [in] | allow | If true, splitting section headers across TS packets is allowed. |
◆ headerSplitAllowed()
| bool ts::Packetizer::headerSplitAllowed |
( |
| ) |
const |
|
inlineinherited |
Check if splitting section headers across TS packets is allowed.
- Returns
- True if splitting section headers across TS packets is allowed.
◆ 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: