|
vdr-plugin-softhddevice-drm-gles 1.4.0
|
Buffer that tracks PTS values at specific byte positions. More...
#include <pes.h>
Public Member Functions | |
| cPtsTrackingBuffer (const char *identifier) | |
| void | Push (const uint8_t *, int, int64_t) |
| Push data into the PTS tracking buffer. More... | |
| void | Erase (size_t) |
| Erase data from the beginning of the buffer. More... | |
| int64_t | GetPts () |
| Get the PTS value for the current buffer position. More... | |
| const uint8_t * | Peek () |
| void | Reset () |
| int | GetSize () |
| const char * | GetIdentifier () |
Private Attributes | |
| const char * | m_identifier |
| std::map< size_t, int64_t > | m_pts |
| Map of buffer positions to PTS values. More... | |
| std::vector< uint8_t > | m_data |
| Byte buffer. More... | |
Buffer that tracks PTS values at specific byte positions.
Manages a byte buffer along with a map of PTS (Presentation Time Stamp) values associated with specific positions in the buffer. This is used for maintaining temporal information when reassembling fragmented streams.
|
inline |
| void cPtsTrackingBuffer::Erase | ( | size_t | amount | ) |
Erase data from the beginning of the buffer.
Removes the specified number of bytes from the front of the buffer and adjusts all PTS positions accordingly. The PTS value for the new position 0 is preserved by finding the last PTS value before the erase point.
This ensures that when frames are popped from the buffer, they retain the PTS of the PES packet where the frame started, even if that PES packet has been partially consumed.
| amount | Number of bytes to erase from the beginning |
Definition at line 670 of file pes.cpp.
References AV_NOPTS_VALUE, LOGFATAL, m_data, m_identifier, and m_pts.
Referenced by cReassemblyBufferAudio::FindTwoConsecutiveFramesWithSameSyncWord(), cReassemblyBuffer::PopAvPacket(), TEST_CASE(), and cReassemblyBufferAudio::TruncateBufferUntilFirstValidData().
|
inline |
Definition at line 108 of file pes.h.
References m_identifier.
| int64_t cPtsTrackingBuffer::GetPts | ( | ) |
Get the PTS value for the current buffer position.
Returns the PTS associated with position 0 in the buffer, which represents the presentation timestamp for the data at the front of the buffer.
Definition at line 707 of file pes.cpp.
References AV_NOPTS_VALUE, and m_pts.
Referenced by cReassemblyBuffer::PopAvPacket(), and TEST_CASE().
|
inline |
Definition at line 107 of file pes.h.
References m_data.
Referenced by cReassemblyBufferAudio::FindTwoConsecutiveFramesWithSameSyncWord(), cReassemblyBuffer::GetSize(), cReassemblyBuffer::IsEmpty(), cReassemblyBufferVideo::PopAvPacket(), TEST_CASE(), and cReassemblyBufferAudio::TruncateBufferUntilFirstValidData().
|
inline |
Definition at line 105 of file pes.h.
References m_data.
Referenced by cReassemblyBufferAudio::FindTwoConsecutiveFramesWithSameSyncWord(), cReassemblyBufferAudio::PopAvPacket(), and cReassemblyBuffer::PopAvPacket().
| void cPtsTrackingBuffer::Push | ( | const uint8_t * | data, |
| int | size, | ||
| int64_t | pts | ||
| ) |
Push data into the PTS tracking buffer.
Appends data to the buffer and associates the PTS with the current buffer position if a valid PTS is provided.
| data | Pointer to data to append |
| size | Size of data in bytes |
| pts | Presentation timestamp, or AV_NOPTS_VALUE if not available |
Definition at line 650 of file pes.cpp.
References AV_NOPTS_VALUE, m_data, and m_pts.
Referenced by cReassemblyBuffer::Push(), and TEST_CASE().
|
inline |
Definition at line 106 of file pes.h.
Referenced by cReassemblyBuffer::Reset(), and TEST_CASE().
|
private |
|
private |
Definition at line 110 of file pes.h.
Referenced by Erase(), and GetIdentifier().
|
private |