|
SmolRTSP 0.2.0
A small, portable, extensible RTSP 1.0 implementation in C99
|
RFC 3550 §6.4-compliant RTCP Sender Report (SR) implementation. More...
#include <smolrtsp/priv/compiler_attrs.h>#include <stdbool.h>#include <stddef.h>#include <stdint.h>
Go to the source code of this file.
Data Structures | |
| struct | SmolRTSP_RtcpSr |
| An RTCP Sender Report (SR) header. More... | |
| struct | SmolRTSP_RtcpRr |
| An RTCP Receiver Report (RR) header (RFC 3550 §6.4.2). More... | |
| struct | SmolRTSP_RtcpSdesCname |
| An RTCP SDES packet with a single chunk containing a single CNAME item (RFC 3550 §6.5). More... | |
| struct | SmolRTSP_RtcpBye |
| An RTCP BYE packet for a single SSRC, optionally carrying a reason text (RFC 3550 §6.6). More... | |
Macros | |
| #define | SMOLRTSP_RTCP_PT_SR 200 |
| RTCP packet type for Sender Report (RFC 3550 §6.4.1). | |
| #define | SMOLRTSP_RTCP_PT_RR 201 |
| RTCP packet type for Receiver Report (RFC 3550 §6.4.2). | |
| #define | SMOLRTSP_RTCP_PT_SDES 202 |
| RTCP packet type for Source Description (RFC 3550 §6.5). | |
| #define | SMOLRTSP_RTCP_PT_BYE 203 |
| RTCP packet type for Goodbye (RFC 3550 §6.6). | |
| #define | SMOLRTSP_RTCP_SDES_CNAME 1 |
| SDES item type for canonical end-point identifier (CNAME) (RFC 3550 §6.5.1). | |
| #define | SMOLRTSP_RTCP_SR_SIZE_BASE 28u |
| The fixed wire size of an RTCP Sender Report with no reception report blocks (RC = 0). | |
| #define | SMOLRTSP_RTCP_RR_SIZE_BASE 8u |
| The fixed wire size of an RTCP Receiver Report with no reception report blocks (RC = 0): a 4-byte common header plus the 4-byte SSRC of the packet sender = 8 bytes. | |
Functions | |
| size_t | SmolRTSP_RtcpSr_size (SmolRTSP_RtcpSr self) SMOLRTSP_PRIV_MUST_USE |
Computes the size of the binary self. | |
| uint8_t * | SmolRTSP_RtcpSr_serialize (SmolRTSP_RtcpSr 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. | |
| uint8_t * | SmolRTSP_RtcpRr_serialize (SmolRTSP_RtcpRr self, uint8_t buffer[restrict]) SMOLRTSP_PRIV_MUST_USE |
Writes self to buffer. | |
| size_t | SmolRTSP_RtcpSdesCname_size (SmolRTSP_RtcpSdesCname self) SMOLRTSP_PRIV_MUST_USE |
Computes the size of the binary self. | |
| 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. | |
RFC 3550 §6.4-compliant RTCP Sender Report (SR) implementation.
| #define SMOLRTSP_RTCP_SR_SIZE_BASE 28u |
The fixed wire size of an RTCP Sender Report with no reception report blocks (RC = 0).
4 (common header) + 4 (sender SSRC) + 8 (NTP timestamp) + 4 (RTP timestamp)
| uint8_t * SmolRTSP_RtcpBye_serialize | ( | SmolRTSP_RtcpBye | self, |
| uint8_t | buffer[restrict] | ||
| ) |
Writes self to buffer.
buffer != NULL self.reason == NULL || strlen(self.reason) <= 255 | size_t SmolRTSP_RtcpBye_size | ( | SmolRTSP_RtcpBye | self | ) |
Computes the size of the binary self.
Without a reason: 8 bytes (4 header + 4 SSRC). With a reason: the above plus 1 byte length + N bytes text, zero-padded to a 32-bit boundary.
self.reason == NULL || strlen(self.reason) <= 255 | uint8_t * SmolRTSP_RtcpRr_serialize | ( | SmolRTSP_RtcpRr | self, |
| uint8_t | buffer[restrict] | ||
| ) |
Writes self to buffer.
| [in] | self | The RR packet to write. |
| [out] | buffer | Must be at least SmolRTSP_RtcpRr_size(self) bytes. |
buffer != NULL self.rc == 0 | size_t SmolRTSP_RtcpRr_size | ( | SmolRTSP_RtcpRr | self | ) |
Computes the size of the binary self.
Currently always returns SMOLRTSP_RTCP_RR_SIZE_BASE.
| uint8_t * SmolRTSP_RtcpSdesCname_serialize | ( | SmolRTSP_RtcpSdesCname | self, |
| uint8_t | buffer[restrict] | ||
| ) |
Writes self to buffer.
buffer != NULL self.cname != NULL strlen(self.cname) <= 255 | size_t SmolRTSP_RtcpSdesCname_size | ( | SmolRTSP_RtcpSdesCname | self | ) |
Computes the size of the binary self.
Layout: 4-byte common header + 4-byte SSRC + 2-byte CNAME item header
self.cname != NULL strlen(self.cname) <= 255 | uint8_t * SmolRTSP_RtcpSr_serialize | ( | SmolRTSP_RtcpSr | self, |
| uint8_t | buffer[restrict] | ||
| ) |
Writes self to buffer.
| [in] | self | The SR packet to write. |
| [out] | buffer | The pointer to write to. Must be at least of size SmolRTSP_RtcpSr_size(self). |
buffer != NULL self.rc == 0 (reception report blocks not yet supported) | size_t SmolRTSP_RtcpSr_size | ( | SmolRTSP_RtcpSr | self | ) |
Computes the size of the binary self.
Currently always returns SMOLRTSP_RTCP_SR_SIZE_BASE; reserved for future support of reception report blocks.