MythTV
master
|
#include <libmythtv/recorders/rtp/packetbuffer.h>
Public Member Functions | |
PacketBuffer (unsigned int bitrate) | |
virtual | ~PacketBuffer ()=default |
virtual void | PushDataPacket (const UDPPacket &)=0 |
virtual void | PushFECPacket (const UDPPacket &, unsigned int)=0 |
bool | HasAvailablePacket (void) const |
Returns true if there are ordered packets ready for processing. More... | |
UDPPacket | PopDataPacket (void) |
Fetches a data packet for processing. More... | |
UDPPacket | GetEmptyPacket (void) |
Gets a packet for use in PushDataPacket/PushFECPacket. More... | |
void | FreePacket (const UDPPacket &packet) |
Frees an RTPDataPacket returned by PopDataPacket. More... | |
Protected Attributes | |
uint | m_bitrate |
uint64_t | m_next_empty_packet_key |
Packets key to use for next empty packet. More... | |
QMap< uint64_t, UDPPacket > | m_empty_packets |
Packets ready for reuse. More... | |
QList< UDPPacket > | m_available_packets |
Ordered list of available packets. More... | |
Definition at line 15 of file packetbuffer.h.
|
explicit |
Definition at line 13 of file packetbuffer.cpp.
|
virtualdefault |
|
pure virtual |
Implemented in RTPPacketBuffer, and UDPPacketBuffer.
Referenced by IPTVStreamHandlerReadHelper::ReadPending().
|
pure virtual |
Implemented in UDPPacketBuffer, and RTPPacketBuffer.
Referenced by IPTVStreamHandlerReadHelper::ReadPending().
bool PacketBuffer::HasAvailablePacket | ( | void | ) | const |
Returns true if there are ordered packets ready for processing.
Definition at line 19 of file packetbuffer.cpp.
Referenced by IPTVStreamHandlerWriteHelper::timerEvent().
UDPPacket PacketBuffer::PopDataPacket | ( | void | ) |
Fetches a data packet for processing.
Call FreePacket() when done with the packet.
Definition at line 24 of file packetbuffer.cpp.
Referenced by IPTVStreamHandlerWriteHelper::timerEvent().
UDPPacket PacketBuffer::GetEmptyPacket | ( | void | ) |
Gets a packet for use in PushDataPacket/PushFECPacket.
Definition at line 35 of file packetbuffer.cpp.
Referenced by IPTVStreamHandlerReadHelper::ReadPending().
void PacketBuffer::FreePacket | ( | const UDPPacket & | packet | ) |
Frees an RTPDataPacket returned by PopDataPacket.
Definition at line 49 of file packetbuffer.cpp.
Referenced by UDPPacketBuffer::PushFECPacket(), RTPPacketBuffer::PushFECPacket(), and IPTVStreamHandlerWriteHelper::timerEvent().
|
protected |
Definition at line 44 of file packetbuffer.h.
|
protected |
Packets key to use for next empty packet.
The upper 32 bits are random and the lower 32 bits are incremented from 0.
Definition at line 49 of file packetbuffer.h.
Referenced by FreePacket(), and GetEmptyPacket().
|
protected |
Packets ready for reuse.
Definition at line 52 of file packetbuffer.h.
Referenced by FreePacket(), and GetEmptyPacket().
|
protected |
Ordered list of available packets.
Definition at line 55 of file packetbuffer.h.
Referenced by HasAvailablePacket(), PopDataPacket(), UDPPacketBuffer::PushDataPacket(), and RTPPacketBuffer::PushDataPacket().