![]() |
TSDuck v3.46-4930
MPEG Transport Stream Toolkit
|
#include <tsTSPacketWindow.h>
Public Member Functions | |
| TSPacketWindow ()=default | |
| void | addPacketsReference (TSPacket *packet, TSPacketMetadata *metadata, size_t count) |
| void | clear () |
| void | drop (size_t index) |
| size_t | dropCount () const |
| bool | get (size_t index, TSPacket *&packet, TSPacketMetadata *&metadata) const |
| bool | isNullPacket (size_t index) const |
| TSPacketMetadata * | metadata (size_t index) const |
| void | nullify (size_t index) |
| size_t | nullifyCount () const |
| TSPacket * | packet (size_t index) const |
| size_t | packetIndexInBuffer (size_t index, const TSPacket *buffer, size_t buffer_size) const |
| size_t | segmentCount () const |
| size_t | size () const |
A view over a window of a buffer of TS packets.
An instance of this class encapsulates a view over a logical buffer of TS packets. The logical view is a set of N packets with associated metadata. The physical implementation of the packets can be non-contiguous (scattered buffer).
The typical usage of this class is a logically contiguous view of a window over a circular buffer and/or a buffer with unused entries. This is the case of the TSProcessor global buffer.
|
default |
Constructor.
| void ts::TSPacketWindow::clear | ( | ) |
Clear the content of the packet window.
| void ts::TSPacketWindow::addPacketsReference | ( | TSPacket * | packet, |
| TSPacketMetadata * | metadata, | ||
| size_t | count ) |
Add the address of a range of packets and their metadata inside the window.
| [in] | packet | The address of the first packet. |
| [in] | metadata | The address of the first corresponding packet metadata. |
| [in] | count | Number of contiguous packets and metadata. |
|
inline |
Get the number of packets in this window.
| TSPacket * ts::TSPacketWindow::packet | ( | size_t | index | ) | const |
Get the address of a packet inside the window.
| [in] | index | Index of the packet inside the window, from 0 to size()-1. |
| TSPacketMetadata * ts::TSPacketWindow::metadata | ( | size_t | index | ) | const |
Get the address of the metadata of a packet inside the window.
| [in] | index | Index of the packet inside the window, from 0 to size()-1. |
| bool ts::TSPacketWindow::isNullPacket | ( | size_t | index | ) | const |
Check if a packet inside the window is a null packet.
| [in] | index | Index of the packet inside the window, from 0 to size()-1. |
| bool ts::TSPacketWindow::get | ( | size_t | index, |
| TSPacket *& | packet, | ||
| TSPacketMetadata *& | metadata ) const |
Get the address of a packet and its metadata inside the window.
| [in] | index | Index of the packet inside the window, from 0 to size()-1. |
| [out] | packet | The address of the corresponding packet. |
| [out] | metadata | The address of the corresponding packet metadata. |
| size_t ts::TSPacketWindow::packetIndexInBuffer | ( | size_t | index, |
| const TSPacket * | buffer, | ||
| size_t | buffer_size ) const |
Get the physical index of a packet inside a buffer.
| [in] | index | Index of the packet inside the window, from 0 to size()-1. |
| [in] | buffer | Base address of a packet buffer. The packet window must be a view over that buffer. |
| [in] | buffer_size | Number of TS packets in the buffer. |
| void ts::TSPacketWindow::nullify | ( | size_t | index | ) |
Nullify the packet at the corresponding index.
| [in] | index | Index of the packet inside the windows, from 0 to size()-1. |
| void ts::TSPacketWindow::drop | ( | size_t | index | ) |
Drop the packet at the corresponding index. Internally, the sync byte of the packet in the buffer is zeroed and the packet is no longer usable.
| [in] | index | Index of the packet inside the windows, from 0 to size()-1. |
|
inline |
|
inline |
Get the number of dropped packets.
|
inline |
Get the number of contiguous segments of packets (informational only).