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

RTCP session management (RFC 3550 Section 6). More...

#include <compy/droppable.h>
#include <compy/rtp_transport.h>
#include <compy/transport.h>
#include <compy/types/rtcp.h>
#include <compy/priv/compiler_attrs.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.

Typedefs

typedef struct Compy_Rtcp Compy_Rtcp
 

Functions

Compy_RtcpCompy_Rtcp_new (Compy_RtpTransport *rtp, Compy_Transport rtcp_transport, const char *cname) COMPY_PRIV_MUST_USE
 Creates a new RTCP session context.
 
int Compy_Rtcp_send_sr (Compy_Rtcp *self) COMPY_PRIV_MUST_USE
 Generates and sends a compound SR + SDES packet.
 
int Compy_Rtcp_send_bye (Compy_Rtcp *self) COMPY_PRIV_MUST_USE
 Generates and sends a BYE packet.
 
int Compy_Rtcp_handle_incoming (Compy_Rtcp *self, const uint8_t *data, size_t len)
 Processes an incoming RTCP packet.
 
const Compy_RtcpReportBlockCompy_Rtcp_get_last_rr (const Compy_Rtcp *self) COMPY_PRIV_MUST_USE
 Returns the last received Receiver Report block, or NULL if none received.
 
 declImplExtern99 (Compy_Droppable, Compy_Rtcp)
 

Detailed Description

RTCP session management (RFC 3550 Section 6).

Provides Sender Report generation, BYE signaling, and incoming Receiver Report parsing. The application is responsible for calling Compy_Rtcp_send_sr periodically (recommended interval: 5 seconds).

Function Documentation

◆ Compy_Rtcp_get_last_rr()

const Compy_RtcpReportBlock * Compy_Rtcp_get_last_rr ( const Compy_Rtcp self)

Returns the last received Receiver Report block, or NULL if none received.

Precondition
self != NULL

◆ Compy_Rtcp_handle_incoming()

int Compy_Rtcp_handle_incoming ( Compy_Rtcp self,
const uint8_t *  data,
size_t  len 
)

Processes an incoming RTCP packet.

Currently handles Receiver Report (RR) packets, storing the first report block for later retrieval via Compy_Rtcp_get_last_rr.

Parameters
[in]selfThe RTCP session.
[in]dataThe raw RTCP packet data.
[in]lenLength of data.
Precondition
self != NULL
data != NULL
Returns
0 on success, -1 on parse error.

◆ Compy_Rtcp_new()

Compy_Rtcp * Compy_Rtcp_new ( Compy_RtpTransport rtp,
Compy_Transport  rtcp_transport,
const char *  cname 
)

Creates a new RTCP session context.

Parameters
[in]rtpThe RTP transport to read statistics from (not owned).
[in]rtcp_transportThe transport for sending RTCP packets (port+1 or channel+1).
[in]cnameThe CNAME identifier for SDES (e.g., "camera@192.168.1.1").
Precondition
rtp != NULL
rtcp_transport.self && rtcp_transport.vptr
cname != NULL

◆ Compy_Rtcp_send_bye()

int Compy_Rtcp_send_bye ( Compy_Rtcp self)

Generates and sends a BYE packet.

Precondition
self != NULL
Returns
-1 on I/O error, 0 on success.

◆ Compy_Rtcp_send_sr()

int Compy_Rtcp_send_sr ( Compy_Rtcp self)

Generates and sends a compound SR + SDES packet.

Reads current statistics from the associated RTP transport and sends a Sender Report followed by an SDES chunk containing the CNAME.

Precondition
self != NULL
Returns
-1 on I/O error, 0 on success.