Compy 0.2.0
A lightweight RTSP 1.0 server library for embedded systems
Loading...
Searching...
No Matches
rtcp.h
Go to the documentation of this file.
1
7#pragma once
8
9#include <compy/priv/compiler_attrs.h>
10
11#include <stddef.h>
12#include <stdint.h>
13
14#include <slice99.h>
15
16#define COMPY_RTCP_SR 200
17#define COMPY_RTCP_RR 201
18#define COMPY_RTCP_SDES 202
19#define COMPY_RTCP_BYE 203
20#define COMPY_RTCP_APP 204
21
22#define COMPY_RTCP_SDES_CNAME 1
23
24#define COMPY_RTCP_MAX_PACKET_SIZE 512
25
29typedef struct {
30 uint8_t version;
31 uint8_t padding;
32 uint8_t count;
33 uint8_t packet_type;
34 uint16_t length;
36
40typedef struct {
41 uint32_t ssrc;
42 uint32_t ntp_timestamp_msw;
43 uint32_t ntp_timestamp_lsw;
44 uint32_t rtp_timestamp;
45 uint32_t sender_packet_count;
46 uint32_t sender_octet_count;
48
52typedef struct {
53 uint32_t ssrc;
54 uint8_t fraction_lost;
55 uint32_t cumulative_lost;
56 uint32_t extended_highest_seq;
57 uint32_t interarrival_jitter;
58 uint32_t last_sr;
59 uint32_t delay_since_last_sr;
61
76 Compy_RtcpSenderInfo info, const char *cname,
77 uint8_t buffer[restrict]) COMPY_PRIV_MUST_USE;
78
89size_t Compy_RtcpBye_serialize(uint32_t ssrc, uint8_t buffer[restrict])
90 COMPY_PRIV_MUST_USE;
91
105 Compy_RtcpHeader *restrict self, const uint8_t *data,
106 size_t len) COMPY_PRIV_MUST_USE;
107
121 Compy_RtcpReportBlock *restrict self, const uint8_t *data,
122 size_t len) COMPY_PRIV_MUST_USE;
RTCP common header (RFC 3550 Section 6.4.1).
Definition rtcp.h:29
RTCP Receiver Report block (RFC 3550 Section 6.4.2).
Definition rtcp.h:52
RTCP Sender Report sender info (RFC 3550 Section 6.4.1).
Definition rtcp.h:40
int Compy_RtcpReportBlock_deserialize(Compy_RtcpReportBlock *restrict self, const uint8_t *data, size_t len) COMPY_PRIV_MUST_USE
Deserializes an RTCP Receiver Report block from data.
Definition rtcp.c:147
size_t Compy_RtcpBye_serialize(uint32_t ssrc, uint8_t buffer[restrict]) COMPY_PRIV_MUST_USE
Serializes a BYE packet into buffer.
Definition rtcp.c:111
size_t Compy_RtcpSenderReport_serialize(Compy_RtcpSenderInfo info, const char *cname, uint8_t buffer[restrict]) COMPY_PRIV_MUST_USE
Serializes a compound SR + SDES packet into buffer.
Definition rtcp.c:37
int Compy_RtcpHeader_deserialize(Compy_RtcpHeader *restrict self, const uint8_t *data, size_t len) COMPY_PRIV_MUST_USE
Deserializes an RTCP common header from data.
Definition rtcp.c:125