Abstract base class for RTP payload type handlers. More...
#include <rtppayload.h>

Public Member Functions | |
| virtual | ~RtpPayload ()=default |
| Destructor. | |
| virtual uint8_t | payloadType () const =0 |
| Returns the RTP payload type number. | |
| virtual uint32_t | clockRate () const =0 |
| Returns the RTP timestamp clock rate in Hz. | |
| virtual RtpPacket::List | pack (const void *mediaData, size_t size)=0 |
| Fragments media data into RTP payload packets. | |
| virtual Buffer | unpack (const RtpPacket::List &packets)=0 |
| Reassembles RTP payload packets into media data. | |
| virtual size_t | maxPayloadSize () const |
| Returns the maximum payload size per packet. | |
Protected Member Functions | |
| RtpPayload ()=default | |
| Default constructor (protected; use a concrete subclass). | |
Abstract base class for RTP payload type handlers.
RtpPayload defines the interface for packing media data into RTP payload packets and unpacking packets back into media data. Packing produces a list of RtpPackets that share a single buffer allocation for efficiency.
Concrete subclasses implement specific payload formats:
Returns the RTP timestamp clock rate in Hz.
Implemented in RtpPayloadL24, RtpPayloadL16, RtpPayloadRawVideo, and RtpPayloadJpeg.
Returns the maximum payload size per packet.
Default is 1200 bytes (MTU-safe, accounts for IP/UDP headers within a 1500-byte Ethernet MTU).
|
pure virtual |
Fragments media data into RTP payload packets.
Each returned RtpPacket includes space for the 12-byte RTP header at the start, followed by any payload-specific header, followed by the media data fragment. All returned packets share a single Buffer::Ptr.
| mediaData | Pointer to the media data. |
| size | Size of the media data in bytes. |
Implemented in RtpPayloadL24, RtpPayloadL16, RtpPayloadRawVideo, and RtpPayloadJpeg.
Returns the RTP payload type number.
Implemented in RtpPayloadL24, RtpPayloadL16, RtpPayloadRawVideo, and RtpPayloadJpeg.
|
pure virtual |
Reassembles RTP payload packets into media data.
| packets | The list of packets to reassemble. |
Implemented in RtpPayloadL24, RtpPayloadL16, RtpPayloadRawVideo, and RtpPayloadJpeg.