Compy 0.2.0
A lightweight RTSP 1.0 server library for embedded systems
Loading...
Searching...
No Matches
receiver.h
Go to the documentation of this file.
1
10#pragma once
11
12#include <compy/droppable.h>
13#include <compy/rtcp.h>
14#include <compy/types/rtp.h>
15
16#include <stdbool.h>
17#include <stddef.h>
18#include <stdint.h>
19
20#include <interface99.h>
21#include <slice99.h>
22
23#include <compy/priv/compiler_attrs.h>
24
31#define Compy_AudioReceiver_IFACE \
32 vfunc99( \
33 void, on_audio, VSelf99, uint8_t payload_type, uint32_t timestamp, \
34 uint32_t ssrc, U8Slice99 payload)
35
36interface99(Compy_AudioReceiver);
37
38#define COMPY_CHANNEL_RTCP 0
39#define COMPY_CHANNEL_RTP 1
40
42
51 Compy_Rtcp *rtcp, Compy_AudioReceiver audio_receiver) COMPY_PRIV_MUST_USE;
52
67 Compy_RtpReceiver *self, uint8_t channel_type, const uint8_t *data,
68 size_t len);
69
82 Compy_RtpReceiver *self, uint8_t channel_type, const uint8_t *data,
83 size_t len, int64_t arrival_us);
84
93 Compy_RtpReceiver *self, uint32_t clock_rate);
94
111 Compy_RtpReceiver *self, uint32_t reporter_ssrc, int64_t now_us,
112 const char *cname, uint8_t *buf, size_t cap);
113
125 Compy_RtpReceiver *self, uint32_t reporter_ssrc, int64_t now_us,
126 const char *cname, uint8_t *buf, size_t cap);
127
128declImplExtern99(Compy_Droppable, Compy_RtpReceiver);
interface99(Compy_Controller)
Defines the Compy_Controller interface.
Droppable types support.
void Compy_RtpReceiver_set_clock_rate(Compy_RtpReceiver *self, uint32_t clock_rate)
Sets the RTP clock rate used to convert arrival instants into timestamp units for jitter (RFC 3550 §6...
Definition receiver.c:66
int Compy_RtpReceiver_feed_at(Compy_RtpReceiver *self, uint8_t channel_type, const uint8_t *data, size_t len, int64_t arrival_us)
Compy_RtpReceiver_feed with the packet's arrival instant, which enables the reception statistics behi...
Definition receiver.c:149
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.
Definition receiver.c:190
ssize_t Compy_RtpReceiver_write_rr(Compy_RtpReceiver *self, uint32_t reporter_ssrc, int64_t now_us, const char *cname, uint8_t *buf, size_t cap)
Writes an RTCP receiver report (RFC 3550 §6.4.2) about the RTP stream this receiver has been fed,...
Definition receiver.c:198
ssize_t Compy_RtpReceiver_write_bye(Compy_RtpReceiver *self, uint32_t reporter_ssrc, int64_t now_us, const char *cname, uint8_t *buf, size_t cap)
Writes the leave compound (RFC 3550 §6.3.7): the same report Compy_RtpReceiver_write_rr produces,...
Definition receiver.c:301
Compy_RtpReceiver * Compy_RtpReceiver_new(Compy_Rtcp *rtcp, Compy_AudioReceiver audio_receiver) COMPY_PRIV_MUST_USE
Creates a new RTP receiver for demuxing incoming data.
Definition receiver.c:46
RTCP session management (RFC 3550 Section 6).
RFC 3550-compliant RTP implementation.
Definition rtcp.c:12
Definition receiver.c:38