SmolRTSP  0.1.3
A small, portable, extensible RTSP 1.0 implementation in C99
rtp.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #include <smolrtsp/priv/compiler_attrs.h>
10 
11 #include <stdbool.h>
12 #include <stddef.h>
13 #include <stdint.h>
14 
20 typedef struct {
24  uint8_t version;
25 
33  bool padding;
34 
39  bool extension;
40 
45  uint8_t csrc_count;
46 
52  bool marker;
53 
59  uint8_t payload_ty;
60 
68  uint16_t sequence_number;
69 
80  uint32_t timestamp;
81 
87  uint32_t ssrc;
88 
94  uint32_t *csrc;
95 
104 
109 
115 
119 size_t SmolRTSP_RtpHeader_size(SmolRTSP_RtpHeader self) SMOLRTSP_PRIV_MUST_USE;
120 
131  SmolRTSP_RtpHeader self, uint8_t buffer[restrict]) SMOLRTSP_PRIV_MUST_USE;
size_t SmolRTSP_RtpHeader_size(SmolRTSP_RtpHeader self) SMOLRTSP_PRIV_MUST_USE
Computes the size of the binary self.
uint8_t * SmolRTSP_RtpHeader_serialize(SmolRTSP_RtpHeader self, uint8_t buffer[restrict]) SMOLRTSP_PRIV_MUST_USE
Writes self to buffer.
An RTP header.
Definition: rtp.h:20
uint32_t timestamp
Used by the receiver to play back the received samples at appropriate time and interval.
Definition: rtp.h:80
uint16_t sequence_number
(16 bits) The sequence number is incremented for each RTP data packet sent and is to be used by the r...
Definition: rtp.h:68
uint32_t * csrc
(32 bits each, the number of entries is indicated by the CSRC count field) Contributing source IDs en...
Definition: rtp.h:94
bool extension
(1 bit) Indicates presence of an extension header between the header and payload data.
Definition: rtp.h:39
bool padding
(1 bit) Used to indicate if there are extra padding bytes at the end of the RTP packet.
Definition: rtp.h:33
uint8_t version
(2 bits) Indicates the version of the protocol.
Definition: rtp.h:24
uint16_t extension_profile
(optional, presence indicated by Extension field) The first 32-bit word contains a profile-specific i...
Definition: rtp.h:103
uint8_t csrc_count
(4 bits) Contains the number of CSRC identifiers (defined below) that follow the SSRC (also defined b...
Definition: rtp.h:45
uint32_t ssrc
(32 bits) Synchronization source identifier uniquely identifies the source of a stream.
Definition: rtp.h:87
uint8_t * extension_payload
The pointer to extension header data.
Definition: rtp.h:113
bool marker
(1 bit) Signaling used at the application level in a profile-specific manner.
Definition: rtp.h:52
uint8_t payload_ty
(7 bits) Indicates the format of the payload and thus determines its interpretation by the applicatio...
Definition: rtp.h:59
uint16_t extension_payload_len
Indicates the length of the extension in 32-bit units.
Definition: rtp.h:108