Iterator for common AVC/HEVC/VVC video access units.
More...
#include <tsAccessUnitIterator.h>
Iterator for common AVC/HEVC/VVC video access units.
Some H.26x video coding formats use a common access unit bitstream format. This class is an iterator over the payload of a PES packet (possibly truncated) to locate each access unit.
This class can be used with:
- AVC, Advanced Video Coding, ISO 14496-10, ITU-T Rec. H.264.
- HEVC, High Efficiency Video Coding, ITU-T Rec. H.265.
- VVC, Versatile Video Coding, ITU-T Rec. H.266.
◆ AccessUnitIterator()
Constructor.
The current access unit is set to the first one.
- Parameters
-
[in] | data | Address of data to explore, typically a PES packet payload or the start of one. This data area must not be modified during the lifetime of this object. |
[in] | size | Data size in bytes. |
[in] | stream_type | Optional stream type, as found in the PMT. Used as a hint. |
[in] | default_format | Default encoding format if it cannot be determined from stream_type. If stream_type and default_format are both unspecified, access unit types values cannot be extracted. |
◆ isValid()
bool ts::AccessUnitIterator::isValid |
( |
| ) |
const |
|
inline |
Check if the video format is valid.
- Returns
- True if the video format is valid. False if stream_type and default_format were both unspecified and no usual NALunit header is found.
◆ videoFormat()
CodecType ts::AccessUnitIterator::videoFormat |
( |
| ) |
const |
|
inline |
Get the video format.
- Returns
- The video format.
◆ currentAccessUnit()
const uint8_t * ts::AccessUnitIterator::currentAccessUnit |
( |
| ) |
const |
|
inline |
Get the address of the current access unit.
- Returns
- The address of the current access unit or a null pointer on error or end of data.
◆ currentAccessUnitOffset()
size_t ts::AccessUnitIterator::currentAccessUnitOffset |
( |
| ) |
const |
|
inline |
Get the offset of the current access unit inside the data area.
- Returns
- The offset of the current access unit inside the data area.
◆ currentAccessUnitSize()
size_t ts::AccessUnitIterator::currentAccessUnitSize |
( |
| ) |
const |
|
inline |
Get the size of the current access unit.
- Returns
- The size in bytes of the current access unit.
◆ currentAccessUnitHeaderSize()
size_t ts::AccessUnitIterator::currentAccessUnitHeaderSize |
( |
| ) |
const |
|
inline |
Get the size of the header of the current access unit.
- Returns
- The size in bytes of the header of the current access unit. This is usually 1 or 2 byes, depending on the video codec.
◆ currentAccessUnitIndex()
size_t ts::AccessUnitIterator::currentAccessUnitIndex |
( |
| ) |
const |
|
inline |
Get the index of the current access unit.
- Returns
- The index of the current access unit. This is zero for first access unit and so on. When atEnd() is true, this is the number of access units which were found in the PES packet.
◆ currentAccessUnitType()
uint8_t ts::AccessUnitIterator::currentAccessUnitType |
( |
| ) |
const |
|
inline |
Get the current access unit type.
- Returns
- The current access unit. Return AVC_AUT_INVALID if the video format is undefined.
◆ currentAccessUnitIsSEI()
bool ts::AccessUnitIterator::currentAccessUnitIsSEI |
( |
| ) |
const |
Check if the current access unit is a Supplemental Enhancement Information (SEI).
The syntax of the SEI access unit is common between AVC, HEVC and VVC but the access unit type is different. This method checks if the current access unit is an SEI for the current video format.
- Returns
- True if the current access unit is an SEI.
◆ next()
bool ts::AccessUnitIterator::next |
( |
| ) |
|
Iterate to the next access unit.
- Returns
- True on success, false when the end of the data area is reached.
◆ atEnd()
bool ts::AccessUnitIterator::atEnd |
( |
| ) |
const |
|
inline |
Check if the last access unit was passed.
- Returns
- True if the last access unit was passed.
The documentation for this class was generated from the following file: