SmolRTSP 0.2.0
A small, portable, extensible RTSP 1.0 implementation in C99
Loading...
Searching...
No Matches
rtcp.h
Go to the documentation of this file.
1
8#pragma once
9
10#include <smolrtsp/priv/compiler_attrs.h>
11
12#include <stdbool.h>
13#include <stddef.h>
14#include <stdint.h>
15
19#define SMOLRTSP_RTCP_PT_SR 200
20
24#define SMOLRTSP_RTCP_PT_RR 201
25
29#define SMOLRTSP_RTCP_PT_SDES 202
30
34#define SMOLRTSP_RTCP_PT_BYE 203
35
40#define SMOLRTSP_RTCP_SDES_CNAME 1
41
49#define SMOLRTSP_RTCP_SR_SIZE_BASE 28u
50
80typedef struct {
85 bool padding;
86
90 uint8_t rc;
91
97 uint32_t ssrc;
98
103 uint32_t ntp_sec;
104
109 uint32_t ntp_frac;
110
116 uint32_t rtp_ts;
117
123 uint32_t pkt_count;
124
130 uint32_t octet_count;
132
139size_t SmolRTSP_RtcpSr_size(SmolRTSP_RtcpSr self) SMOLRTSP_PRIV_MUST_USE;
140
154 SmolRTSP_RtcpSr self, uint8_t buffer[restrict]) SMOLRTSP_PRIV_MUST_USE;
155
161#define SMOLRTSP_RTCP_RR_SIZE_BASE 8u
162
177typedef struct {
182
186 uint8_t rc;
187
193 uint32_t ssrc;
195
200size_t SmolRTSP_RtcpRr_size(SmolRTSP_RtcpRr self) SMOLRTSP_PRIV_MUST_USE;
201
214 SmolRTSP_RtcpRr self, uint8_t buffer[restrict]) SMOLRTSP_PRIV_MUST_USE;
215
233typedef struct {
238
243 uint32_t ssrc;
244
249 const char *cname;
251
262size_t
264
274 uint8_t buffer[restrict]) SMOLRTSP_PRIV_MUST_USE;
275
290typedef struct {
295
299 uint32_t ssrc;
300
305 const char *reason;
307
317size_t SmolRTSP_RtcpBye_size(SmolRTSP_RtcpBye self) SMOLRTSP_PRIV_MUST_USE;
318
326 SmolRTSP_RtcpBye self, uint8_t buffer[restrict]) SMOLRTSP_PRIV_MUST_USE;
uint8_t * SmolRTSP_RtcpRr_serialize(SmolRTSP_RtcpRr self, uint8_t buffer[restrict]) SMOLRTSP_PRIV_MUST_USE
Writes self to buffer.
uint8_t * SmolRTSP_RtcpSr_serialize(SmolRTSP_RtcpSr self, uint8_t buffer[restrict]) SMOLRTSP_PRIV_MUST_USE
Writes self to buffer.
uint8_t * SmolRTSP_RtcpSdesCname_serialize(SmolRTSP_RtcpSdesCname self, uint8_t buffer[restrict]) SMOLRTSP_PRIV_MUST_USE
Writes self to buffer.
size_t SmolRTSP_RtcpBye_size(SmolRTSP_RtcpBye self) SMOLRTSP_PRIV_MUST_USE
Computes the size of the binary self.
uint8_t * SmolRTSP_RtcpBye_serialize(SmolRTSP_RtcpBye self, uint8_t buffer[restrict]) SMOLRTSP_PRIV_MUST_USE
Writes self to buffer.
size_t SmolRTSP_RtcpRr_size(SmolRTSP_RtcpRr self) SMOLRTSP_PRIV_MUST_USE
Computes the size of the binary self.
size_t SmolRTSP_RtcpSr_size(SmolRTSP_RtcpSr self) SMOLRTSP_PRIV_MUST_USE
Computes the size of the binary self.
size_t SmolRTSP_RtcpSdesCname_size(SmolRTSP_RtcpSdesCname self) SMOLRTSP_PRIV_MUST_USE
Computes the size of the binary self.
An RTCP BYE packet for a single SSRC, optionally carrying a reason text (RFC 3550 §6....
Definition rtcp.h:290
bool padding
(1 bit) Padding flag.
Definition rtcp.h:294
uint32_t ssrc
(32 bits) SSRC of the source leaving the session.
Definition rtcp.h:299
const char * reason
Optional human-readable reason text (NULL or empty string means no reason).
Definition rtcp.h:305
An RTCP Receiver Report (RR) header (RFC 3550 §6.4.2).
Definition rtcp.h:177
uint32_t ssrc
(32 bits) Synchronization source identifier of the packet sender.
Definition rtcp.h:193
uint8_t rc
(5 bits) Reception report count.
Definition rtcp.h:186
bool padding
(1 bit) Padding flag.
Definition rtcp.h:181
An RTCP SDES packet with a single chunk containing a single CNAME item (RFC 3550 §6....
Definition rtcp.h:233
bool padding
(1 bit) Padding flag.
Definition rtcp.h:237
uint32_t ssrc
(32 bits) SSRC of the source being described.
Definition rtcp.h:243
const char * cname
Canonical name (CNAME) in user@host-or-host form.
Definition rtcp.h:249
An RTCP Sender Report (SR) header.
Definition rtcp.h:80
bool padding
(1 bit) Padding flag.
Definition rtcp.h:85
uint8_t rc
(5 bits) Reception report count.
Definition rtcp.h:90
uint32_t ntp_sec
(32 bits) NTP-epoch seconds.
Definition rtcp.h:103
uint32_t pkt_count
(32 bits) Total number of RTP data packets transmitted by the sender since starting transmission,...
Definition rtcp.h:123
uint32_t ntp_frac
(32 bits) NTP fractional seconds.
Definition rtcp.h:109
uint32_t ssrc
(32 bits) Synchronization source identifier of the sender.
Definition rtcp.h:97
uint32_t rtp_ts
(32 bits) The RTP timestamp that corresponds to the same instant as the NTP timestamp above.
Definition rtcp.h:116
uint32_t octet_count
(32 bits) Total number of payload octets (i.e., not including header or padding) transmitted by the s...
Definition rtcp.h:130