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

Unified receive path for RTCP and backchannel RTP data. More...

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

Go to the source code of this file.

Macros

#define Compy_AudioReceiver_IFACE
 Application callback interface for receiving backchannel audio data.
 
#define COMPY_CHANNEL_RTCP   0
 
#define COMPY_CHANNEL_RTP   1
 

Typedefs

typedef struct Compy_RtpReceiver Compy_RtpReceiver
 

Functions

 interface99 (Compy_AudioReceiver)
 
Compy_RtpReceiverCompy_RtpReceiver_new (Compy_Rtcp *rtcp, Compy_AudioReceiver audio_receiver) COMPY_PRIV_MUST_USE
 Creates a new RTP receiver for demuxing incoming data.
 
int Compy_RtpReceiver_feed (Compy_RtpReceiver *self, uint8_t channel_type, const uint8_t *data, size_t len)
 Feeds raw received data into the receiver for demuxing.
 
 declImplExtern99 (Compy_Droppable, Compy_RtpReceiver)
 

Detailed Description

Unified receive path for RTCP and backchannel RTP data.

Provides the #Compy_AudioReceiver interface for applications to receive backchannel audio, and the Compy_RtpReceiver demuxer that routes incoming data to either RTCP handling or audio callbacks.

Macro Definition Documentation

◆ Compy_AudioReceiver_IFACE

#define Compy_AudioReceiver_IFACE
Value:
vfunc99( \
void, on_audio, VSelf99, uint8_t payload_type, uint32_t timestamp, \
uint32_t ssrc, U8Slice99 payload)

Application callback interface for receiving backchannel audio data.

See Interface99 for the macro usage.

Function Documentation

◆ Compy_RtpReceiver_feed()

int Compy_RtpReceiver_feed ( Compy_RtpReceiver self,
uint8_t  channel_type,
const uint8_t *  data,
size_t  len 
)

Feeds raw received data into the receiver for demuxing.

Parameters
[in]selfThe receiver.
[in]channel_typeEither COMPY_CHANNEL_RTCP or COMPY_CHANNEL_RTP.
[in]dataThe raw packet data.
[in]lenLength of data.
Precondition
self != NULL
data != NULL
Returns
0 on success, -1 on parse error.

◆ Compy_RtpReceiver_new()

Compy_RtpReceiver * Compy_RtpReceiver_new ( Compy_Rtcp rtcp,
Compy_AudioReceiver  audio_receiver 
)

Creates a new RTP receiver for demuxing incoming data.

Parameters
[in]rtcpThe RTCP session for handling incoming RTCP. May be NULL.
[in]audio_receiverThe audio callback for backchannel data. The .self field may be NULL if no backchannel is configured.