SmolRTSP  0.1.3
A small, portable, extensible RTSP 1.0 implementation in C99
SmolRTSP_RtpHeader Struct Reference

An RTP header. More...

#include <rtp.h>

Data Fields

uint8_t version
 (2 bits) Indicates the version of the protocol. More...
 
bool padding
 (1 bit) Used to indicate if there are extra padding bytes at the end of the RTP packet. More...
 
bool extension
 (1 bit) Indicates presence of an extension header between the header and payload data. More...
 
uint8_t csrc_count
 (4 bits) Contains the number of CSRC identifiers (defined below) that follow the SSRC (also defined below).
 
bool marker
 (1 bit) Signaling used at the application level in a profile-specific manner. More...
 
uint8_t payload_ty
 (7 bits) Indicates the format of the payload and thus determines its interpretation by the application. More...
 
uint16_t sequence_number
 (16 bits) The sequence number is incremented for each RTP data packet sent and is to be used by the receiver to detect packet loss[1] and to accommodate out-of-order delivery. More...
 
uint32_t timestamp
 Used by the receiver to play back the received samples at appropriate time and interval. More...
 
uint32_t ssrc
 (32 bits) Synchronization source identifier uniquely identifies the source of a stream. More...
 
uint32_t * csrc
 (32 bits each, the number of entries is indicated by the CSRC count field) Contributing source IDs enumerate contributing sources to a stream which has been generated from multiple sources.
 
uint16_t extension_profile
 (optional, presence indicated by Extension field) The first 32-bit word contains a profile-specific identifier (16 bits) and a length specifier (16 bits) that indicates the length of the extension in 32-bit units, excluding the 32 bits of the extension header. More...
 
uint16_t extension_payload_len
 Indicates the length of the extension in 32-bit units.
 
uint8_t * extension_payload
 The pointer to extension header data.
 

Detailed Description

An RTP header.

All numerical fields must be in network byte order.

Field Documentation

◆ extension

bool SmolRTSP_RtpHeader::extension

(1 bit) Indicates presence of an extension header between the header and payload data.

The extension header is application or profile specific.

◆ extension_profile

uint16_t SmolRTSP_RtpHeader::extension_profile

(optional, presence indicated by Extension field) The first 32-bit word contains a profile-specific identifier (16 bits) and a length specifier (16 bits) that indicates the length of the extension in 32-bit units, excluding the 32 bits of the extension header.

The extension header data follows.

◆ marker

bool SmolRTSP_RtpHeader::marker

(1 bit) Signaling used at the application level in a profile-specific manner.

If it is set, it means that the current data has some special relevance for the application.

◆ padding

bool SmolRTSP_RtpHeader::padding

(1 bit) Used to indicate if there are extra padding bytes at the end of the RTP packet.

Padding may be used to fill up a block of certain size, for example as required by an encryption algorithm. The last byte of the padding contains the number of padding bytes that were added (including itself).

◆ payload_ty

uint8_t SmolRTSP_RtpHeader::payload_ty

(7 bits) Indicates the format of the payload and thus determines its interpretation by the application.

Values are profile specific and may be dynamically assigned.

◆ sequence_number

uint16_t SmolRTSP_RtpHeader::sequence_number

(16 bits) The sequence number is incremented for each RTP data packet sent and is to be used by the receiver to detect packet loss[1] and to accommodate out-of-order delivery.

The initial value of the sequence number should be randomized to make known-plaintext attacks on Secure Real-time Transport Protocol more difficult.

◆ ssrc

uint32_t SmolRTSP_RtpHeader::ssrc

(32 bits) Synchronization source identifier uniquely identifies the source of a stream.

The synchronization sources within the same RTP session will be unique.

◆ timestamp

uint32_t SmolRTSP_RtpHeader::timestamp

Used by the receiver to play back the received samples at appropriate time and interval.

When several media streams are present, the timestamps may be independent in each stream.[b] The granularity of the timing is application specific. For example, an audio application that samples data once every 125 μs (8 kHz, a common sample rate in digital telephony) would use that value as its clock resolution. Video streams typically use a 90 kHz clock. The clock granularity is one of the details that is specified in the RTP profile for an application.

◆ version

uint8_t SmolRTSP_RtpHeader::version

(2 bits) Indicates the version of the protocol.

Current version is 2.


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