RealtimePacketQueue
RealtimePacketQueue
#include <icy/av/realtimepacketqueue.h>Inherits:
AsyncPacketQueue< PacketT >
Queue that emits media packets in presentation-timestamp order relative to a realtime clock.
Packets are sorted by their time field on insertion. On each pop attempt the queue checks whether the wall-clock time since stream activation has reached the next packet's timestamp; if not, the packet is held back. This provides a soft realtime playback scheduler.
Public Methods
| Return | Name | Description |
|---|---|---|
RealtimePacketQueue inline | Construct the queue with a maximum capacity. | |
void | push virtual inline | Insert a packet into the queue and re-sort by presentation timestamp. |
int64_t | realTime inline | Return the elapsed time since stream activation in microseconds. |
RealtimePacketQueue
inline
inline RealtimePacketQueue(int maxSize)Construct the queue with a maximum capacity.
Parameters
maxSizeThe maximum number of packets the queue will hold.
push
virtual inline
virtual inline void push(PacketT * item)Insert a packet into the queue and re-sort by presentation timestamp.
Parameters
itemThe packet to enqueue; ownership is transferred.
realTime
inline
inline int64_t realTime()Return the elapsed time since stream activation in microseconds.
Protected Attributes
| Return | Name | Description |
|---|---|---|
int64_t | _startTime |
_startTime
int64_t _startTimeProtected Methods
| Return | Name | Description |
|---|---|---|
PacketT * | popNext virtual inline | Return the next packet whose timestamp is <= realTime(), or nullptr if none is ready. |
void | onStreamStateChange virtual inline | Record the stream start time when the stream becomes active. |
popNext
virtual inline
virtual inline PacketT * popNext()Return the next packet whose timestamp is <= realTime(), or nullptr if none is ready.
onStreamStateChange
virtual inline
virtual inline void onStreamStateChange(const PacketStreamState & state)Record the stream start time when the stream becomes active.
Public Types
| Name | Description |
|---|---|
BaseQueue |
BaseQueue
AsyncPacketQueue< PacketT > BaseQueue()