libpromeki main
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
RtpPayloadRawVideo Class Reference

RTP payload handler for RFC 4175 raw video (ST 2110-20). More...

#include <rtppayload.h>

Inheritance diagram for RtpPayloadRawVideo:
Collaboration diagram for RtpPayloadRawVideo:

Public Member Functions

 RtpPayloadRawVideo (int width, int height, int bitsPerPixel)
 Constructs a raw video payload handler.
 
uint8_t payloadType () const override
 Returns the RTP payload type number.
 
uint32_t clockRate () const override
 Returns the RTP timestamp clock rate in Hz.
 
RtpPacket::List pack (const void *mediaData, size_t size) override
 Fragments media data into RTP payload packets.
 
Buffer unpack (const RtpPacket::List &packets) override
 Reassembles RTP payload packets into media data.
 
void setPayloadType (uint8_t pt)
 Sets the RTP payload type number.
 
int width () const
 Returns the frame width.
 
int height () const
 Returns the frame height.
 
int bitsPerPixel () const
 Returns bits per pixel.
 
- Public Member Functions inherited from RtpPayload
virtual ~RtpPayload ()=default
 Destructor.
 
virtual size_t maxPayloadSize () const
 Returns the maximum payload size per packet.
 

Additional Inherited Members

- Protected Member Functions inherited from RtpPayload
 RtpPayload ()=default
 Default constructor (protected; use a concrete subclass).
 

Detailed Description

RTP payload handler for RFC 4175 raw video (ST 2110-20).

Implements packing/unpacking of uncompressed video frames as defined by RFC 4175 for use with SMPTE ST 2110-20. Each packet carries one or more scan line segments with a per-line header.

RFC 4175 Packet Layout
+--12 bytes--+--2 bytes--+--per-line headers--+--pixel data--+
| RTP Header | Extended | Line 1 Header (6B) | Pixel Data |
| | Seq Num | [Line 2 Header...] | |
+------------+-----------+--------------------+--------------+
N-dimensional line segment defined by a start and end point.
Definition line.h:25
Dynamic array container wrapping std::vector.
Definition list.h:40

Each per-line header is 6 bytes:

  • 2 bytes: data length for this line segment
  • 2 bytes: line number
  • 2 bytes: field ID (1 bit) + offset (15 bits) + continuation (1 bit)
Example
RtpPayloadRawVideo payload(1920, 1080, 24); // 1080p, 24 bits/pixel
auto packets = payload.pack(frameData, frameSize);
RTP payload handler for RFC 4175 raw video (ST 2110-20).
Definition rtppayload.h:202

Constructor & Destructor Documentation

◆ RtpPayloadRawVideo()

RtpPayloadRawVideo::RtpPayloadRawVideo ( int  width,
int  height,
int  bitsPerPixel 
)

Constructs a raw video payload handler.

Parameters
widthFrame width in pixels.
heightFrame height in pixels.
bitsPerPixelBits per pixel (e.g. 24 for RGB8).

Member Function Documentation

◆ clockRate()

uint32_t RtpPayloadRawVideo::clockRate ( ) const
inlineoverridevirtual

Returns the RTP timestamp clock rate in Hz.

Implements RtpPayload.

◆ pack()

RtpPacket::List RtpPayloadRawVideo::pack ( const void mediaData,
size_t  size 
)
overridevirtual

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.

Parameters
mediaDataPointer to the media data.
sizeSize of the media data in bytes.
Returns
List of RtpPackets sharing one buffer.

Implements RtpPayload.

◆ payloadType()

uint8_t RtpPayloadRawVideo::payloadType ( ) const
inlineoverridevirtual

Returns the RTP payload type number.

Implements RtpPayload.

◆ unpack()

Buffer RtpPayloadRawVideo::unpack ( const RtpPacket::List packets)
overridevirtual

Reassembles RTP payload packets into media data.

Parameters
packetsThe list of packets to reassemble.
Returns
Buffer containing the reassembled media data.

Implements RtpPayload.


The documentation for this class was generated from the following file: