|
vdr-plugin-softhddevice-drm-gles 1.6.4-d0291bb
|
PES Packet Parser. More...
#include <pes.h>
Public Member Functions | |
| cPes (const uint8_t *, int) | |
| Create a PES packet parser. | |
| bool | IsValid (void) |
| Check if the PES packet is valid. | |
| bool | HasPts (void) |
| Check if the PES packet contains a Presentation Time Stamp (PTS) | |
| int64_t | GetPts (void) |
| Get the Presentation Time Stamp (PTS) from the PES header. | |
| const uint8_t * | GetPayload (void) |
| Get a pointer to the PES payload data. | |
| int | GetPayloadSize (void) |
| Get the size of the PES payload. | |
| int | GetPacketLength (void) |
| Get the total length of the PES packet. | |
| uint8_t | GetStreamId (void) |
Protected Member Functions | |
| virtual bool | IsStreamIdValid (void)=0 |
| void | Init (void) |
| Initialize and validate the PES packet. | |
| bool | IsHeaderValid (void) |
| Check if the PES header is valid. | |
Protected Attributes | |
| bool | m_valid = false |
| flag indicating if the PES packet is valid | |
| const uint8_t * | m_data |
| pointer to the raw PES packet data | |
| int | m_size |
| size of the PES packet | |
Static Protected Attributes | |
| static constexpr uint32_t | PES_PACKET_START_CODE_PREFIX = 0x00'0001 |
| static constexpr uint32_t | PES_PACKET_START_CODE_PREFIX_LEN = 3 |
PES Packet Parser.
This class parses PES (Packetized Elementary Stream) packets to extract header information, PTS, and payload data.
Get the total length of the PES packet.
Returns the complete size of the PES packet including both header and payload. The length is read from the PES packet header (bytes 4-5).
For packets with a specified length field (common for audio):
For unbounded packets (length field = 0, common for video streams):
Get the Presentation Time Stamp (PTS) from the PES header.
Extracts the PTS value from the PES packet header if present. The PTS indicates when the decoded content should be presented.
Definition at line 288 of file pes.cpp.
References AV_NOPTS_VALUE, HasPts(), and m_data.
Definition at line 39 of file pes.h.
References m_data.
Referenced by Init(), cPesAudio::IsAudioStreamId(), cPesAudio::IsPrivateStreamId(), and cPesVideo::IsStreamIdValid().
Check if the PES packet contains a Presentation Time Stamp (PTS)
Examines the PES header flags to determine if a PTS is present in the packet. The PTS presence is indicated by specific bits in the PES header flags field.
Definition at line 275 of file pes.cpp.
References m_data.
Referenced by GetPts().
Initialize and validate the PES packet.
Performs validation checks on the PES packet structure:
Sets m_valid to true if all checks pass. Called by derived class constructors.
Definition at line 222 of file pes.cpp.
References GetStreamId(), IsHeaderValid(), IsStreamIdValid(), LOGDEBUG, LOGWARNING, m_data, m_size, and m_valid.
Referenced by cPesAudio::cPesAudio(), and cPesVideo::cPesVideo().
Check if the PES header is valid.
Validates that the PES packet has a valid header by checking:
Definition at line 262 of file pes.cpp.
References m_data, m_size, PES_PACKET_START_CODE_PREFIX, and ReadBytes().
Referenced by Init().
Check if the PES packet is valid.
Validates that the PES packet is well-formed and matches the expected stream type by checking:
The stream ID is masked with 0xF0 to check the stream type category (e.g., 0xE0 for video, 0xC0 for audio) while ignoring the low nibble which indicates the specific stream number.
Video streams have stream IDs in the range 0xE0-0xEF according to H.222.0 03/2017 Table 2-22, audio streams have IDs in the range 0xC0-0xCF.
Definition at line 248 of file pes.cpp.
References m_valid.
pointer to the raw PES packet data
Definition at line 47 of file pes.h.
Referenced by GetPacketLength(), GetPayload(), GetPayloadSize(), GetPts(), GetStreamId(), HasPts(), Init(), and IsHeaderValid().
|
protected |
size of the PES packet
Definition at line 48 of file pes.h.
Referenced by GetPacketLength(), GetPayloadSize(), Init(), and IsHeaderValid().
Definition at line 52 of file pes.h.
Referenced by IsHeaderValid().