Compy 0.2.0
A lightweight RTSP 1.0 server library for embedded systems
Loading...
Searching...
No Matches
rtcp.h File Reference

RFC 3550 Section 6-compliant RTCP packet types. More...

#include <compy/priv/compiler_attrs.h>
#include <stddef.h>
#include <stdint.h>
#include <slice99.h>
Include dependency graph for rtcp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Compy_RtcpHeader
 RTCP common header (RFC 3550 Section 6.4.1). More...
 
struct  Compy_RtcpSenderInfo
 RTCP Sender Report sender info (RFC 3550 Section 6.4.1). More...
 
struct  Compy_RtcpReportBlock
 RTCP Receiver Report block (RFC 3550 Section 6.4.2). More...
 

Macros

#define COMPY_RTCP_SR   200
 
#define COMPY_RTCP_RR   201
 
#define COMPY_RTCP_SDES   202
 
#define COMPY_RTCP_BYE   203
 
#define COMPY_RTCP_APP   204
 
#define COMPY_RTCP_SDES_CNAME   1
 
#define COMPY_RTCP_MAX_PACKET_SIZE   512
 

Functions

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.
 
size_t Compy_RtcpBye_serialize (uint32_t ssrc, uint8_t buffer[restrict]) COMPY_PRIV_MUST_USE
 Serializes a BYE packet into buffer.
 
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.
 
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.
 

Detailed Description

RFC 3550 Section 6-compliant RTCP packet types.

Function Documentation

◆ Compy_RtcpBye_serialize()

size_t Compy_RtcpBye_serialize ( uint32_t  ssrc,
uint8_t  buffer[restrict] 
)

Serializes a BYE packet into buffer.

Parameters
[in]ssrcThe SSRC to include in the BYE.
[out]bufferOutput buffer, must be at least 8 bytes.
Precondition
buffer != NULL
Returns
The total number of bytes written.

◆ Compy_RtcpHeader_deserialize()

int Compy_RtcpHeader_deserialize ( Compy_RtcpHeader *restrict  self,
const uint8_t *  data,
size_t  len 
)

Deserializes an RTCP common header from data.

Parameters
[out]selfThe parsed header.
[in]dataThe buffer to parse.
[in]lenLength of data.
Precondition
self != NULL
data != NULL
Returns
0 on success, -1 if data is too short or version is not 2.

◆ Compy_RtcpReportBlock_deserialize()

int Compy_RtcpReportBlock_deserialize ( Compy_RtcpReportBlock *restrict  self,
const uint8_t *  data,
size_t  len 
)

Deserializes an RTCP Receiver Report block from data.

Parameters
[out]selfThe parsed report block.
[in]dataThe buffer to parse (must point past the RTCP header).
[in]lenLength of data.
Precondition
self != NULL
data != NULL
Returns
0 on success, -1 if data is too short.

◆ Compy_RtcpSenderReport_serialize()

size_t Compy_RtcpSenderReport_serialize ( Compy_RtcpSenderInfo  info,
const char *  cname,
uint8_t  buffer[restrict] 
)

Serializes a compound SR + SDES packet into buffer.

Parameters
[in]infoThe sender report information.
[in]cnameThe CNAME string for the SDES item.
[out]bufferOutput buffer, must be at least COMPY_RTCP_MAX_PACKET_SIZE bytes.
Precondition
cname != NULL
buffer != NULL
Returns
The total number of bytes written.