Fork me on GitHub
rtcp.h
Go to the documentation of this file.
1 
16 #ifndef JANUS_RTCP_H
17 #define JANUS_RTCP_H
18 
19 #include <arpa/inet.h>
20 #ifdef __MACH__
21 #include <machine/endian.h>
22 #elif defined(__FreeBSD__)
23 #include <sys/endian.h>
24 #else
25 #include <endian.h>
26 #endif
27 #include <inttypes.h>
28 #include <string.h>
29 
31 typedef enum {
32  RTCP_FIR = 192,
33  RTCP_SR = 200,
34  RTCP_RR = 201,
35  RTCP_SDES = 202,
36  RTCP_BYE = 203,
37  RTCP_APP = 204,
38  RTCP_RTPFB = 205,
39  RTCP_PSFB = 206,
40  RTCP_XR = 207,
41 } rtcp_type;
43 
44 
46 typedef struct rtcp_header
47 {
48 #if __BYTE_ORDER == __BIG_ENDIAN
49  uint16_t version:2;
50  uint16_t padding:1;
51  uint16_t rc:5;
52  uint16_t type:8;
53 #elif __BYTE_ORDER == __LITTLE_ENDIAN
54  uint16_t rc:5;
55  uint16_t padding:1;
56  uint16_t version:2;
57  uint16_t type:8;
58 #endif
59  uint16_t length:16;
62 
64 typedef struct sender_info
65 {
66  uint32_t ntp_ts_msw;
67  uint32_t ntp_ts_lsw;
68  uint32_t rtp_ts;
69  uint32_t s_packets;
70  uint32_t s_octets;
73 
75 typedef struct report_block
76 {
77  uint32_t ssrc;
78  uint32_t flcnpl;
79  uint32_t ehsnr;
80  uint32_t jitter;
81  uint32_t lsr;
82  uint32_t delay;
85 
87 typedef struct rtcp_sr
88 {
90  uint32_t ssrc;
95 
97 typedef struct rtcp_rr
98 {
100  uint32_t ssrc;
104 
106 typedef struct rtcp_sdes_chunk
107 {
108  uint32_t ssrc;
111 
112 typedef struct rtcp_sdes_item
113 {
114  uint8_t type;
115  uint8_t len;
116  char content[1];
119 
120 typedef struct rtcp_sdes
121 {
127 
129 typedef struct rtcp_bye
130 {
132  uint32_t ssrc[1];
135 
137 typedef struct rtcp_app
138 {
140  uint32_t ssrc;
141  char name[4];
144 
146 typedef struct rtcp_nack
147 {
149  uint16_t pid;
151  uint16_t blp;
154 
156 typedef struct janus_nack {
158  uint16_t seq_no;
160  struct janus_nack *next;
162 
163 
165 typedef struct rtcp_remb
166 {
168  char id[4];
170  uint32_t bitrate;
172  uint32_t ssrc[3];
175 
176 
178 typedef struct rtcp_fir
179 {
181  uint32_t ssrc;
183  uint32_t seqnr;
186 
187 
189 typedef struct rtcp_fb
190 {
194  uint32_t ssrc;
196  uint32_t media;
198  char fci[1];
201 
203 typedef struct extended_report_block
204 {
206  uint8_t blocktype;
208  uint8_t typesp;
210  uint16_t length;
212  char content[1];
213 
216 
218 typedef struct rtcp_xr
219 {
221  uint32_t ssrc;
225 
226 
228 typedef struct rtcp_context
229 {
230  /* Whether we received any RTP packet at all (don't send RR otherwise) */
231  uint8_t rtp_recvd:1;
234 
235  uint16_t max_seq_nr;
236  uint16_t seq_cycle;
237  uint16_t base_seq;
238  /* Payload type */
239  uint16_t pt;
240 
241  /* RFC 3550 A.8 Interarrival Jitter */
242  int64_t transit;
244  /* Timestamp base (e.g., 48000 for opus audio, or 90000 for video) */
245  uint32_t tb;
246 
247  /* Last SR received */
248  uint32_t lsr;
249  /* Monotonic time of last SR received */
250  int64_t lsr_ts;
251 
252  /* Last RR/SR we sent */
253  int64_t last_sent;
254 
255  /* Estimated round-trip time */
256  uint32_t rtt;
257 
258  /* RFC 3550 A.3 */
259  uint32_t received;
260  uint32_t received_prior;
261  uint32_t expected;
262  uint32_t expected_prior;
263  uint32_t lost, lost_remote;
264 
265  uint32_t retransmitted;
267 
268  /* Inbound RR process */
269  int64_t rr_last_ts;
270  uint32_t rr_last_ehsnr;
271  uint32_t rr_last_lost;
275 
276  /* Link quality estimations */
281 
282  /* TODO Incoming transport-wide CC feedback*/
283 
286 
289 {
293  guint64 timestamp;
296 
305 uint32_t janus_rtcp_context_get_lost_all(janus_rtcp_context *ctx, gboolean remote);
310 uint32_t janus_rtcp_context_get_jitter(janus_rtcp_context *ctx, gboolean remote);
332 void janus_rtcp_swap_report_blocks(char *packet, int len, uint32_t rtx_ssrc);
337 guint32 janus_rtcp_get_sender_ssrc(char *packet, int len);
342 guint32 janus_rtcp_get_receiver_ssrc(char *packet, int len);
343 
349 gboolean janus_rtcp_check_len(janus_rtcp_header *rtcp, int len);
354 gboolean janus_rtcp_check_rr(janus_rtcp_header *rtcp, int len);
359 gboolean janus_rtcp_check_sr(janus_rtcp_header *rtcp, int len);
366 gboolean janus_rtcp_check_fci(janus_rtcp_header *rtcp, int len, int sizeof_fci);
371 gboolean janus_rtcp_check_remb(janus_rtcp_header *rtcp, int len);
372 
376 gboolean janus_is_rtcp(char *buf, guint len);
377 
383 int janus_rtcp_parse(janus_rtcp_context *ctx, char *packet, int len);
384 
395 int janus_rtcp_fix_report_data(char *packet, int len, uint32_t base_ts, uint32_t base_ts_prev, uint32_t ssrc_peer, uint32_t ssrc_local, uint32_t ssrc_expected, gboolean video);
396 
405 int janus_rtcp_fix_ssrc(janus_rtcp_context *ctx, char *packet, int len, int fixssrc, uint32_t newssrcl, uint32_t newssrcr);
406 
412 char *janus_rtcp_filter(char *packet, int len, int *newlen);
413 
423 int janus_rtcp_process_incoming_rtp(janus_rtcp_context *ctx, char *packet, int len,
424  gboolean rfc4588_pkt, gboolean rfc4588_enabled, gboolean retransmissions_disabled,
425  GHashTable *clock_rates);
426 
432 
441 gboolean janus_rtcp_parse_lost_info(char *packet, int len, uint32_t *lost, int *fraction);
442 
447 gboolean janus_rtcp_has_bye(char *packet, int len);
448 
453 gboolean janus_rtcp_has_fir(char *packet, int len);
454 
459 gboolean janus_rtcp_has_pli(char *packet, int len);
460 
465 GSList *janus_rtcp_get_nacks(char *packet, int len);
466 
475 int janus_rtcp_remove_nacks(char *packet, int len);
476 
481 uint32_t janus_rtcp_get_remb(char *packet, int len);
482 
488 int janus_rtcp_cap_remb(char *packet, int len, uint32_t bitrate);
489 
496 int janus_rtcp_sdes_cname(char *packet, int len, const char *cname, int cnamelen);
497 
503 int janus_rtcp_remb(char *packet, int len, uint32_t bitrate);
504 
511 int janus_rtcp_remb_ssrcs(char *packet, int len, uint32_t bitrate, uint8_t numssrc);
512 
518 int janus_rtcp_fir(char *packet, int len, int *seqnr);
519 
526 int janus_rtcp_fir_legacy(char *packet, int len, int *seqnr);
527 
532 int janus_rtcp_pli(char *packet, int len);
533 
539 int janus_rtcp_nacks(char *packet, int len, GSList *nacks);
540 
549 int janus_rtcp_transport_wide_cc_feedback(char *packet, size_t len, guint32 ssrc, guint32 media, guint8 feedback_packet_count, GQueue *transport_wide_cc_stats);
550 
551 #endif
janus_rtcp_has_pli
gboolean janus_rtcp_has_pli(char *packet, int len)
Method to check whether an RTCP message contains a PLI request.
Definition: rtcp.c:1137
janus_extended_report_block
extended_report_block janus_extended_report_block
Definition: rtcp.h:215
janus_rtcp_rr
rtcp_rr janus_rtcp_rr
Definition: rtcp.h:103
rtcp_rr::ssrc
uint32_t ssrc
Definition: rtcp.h:100
rtcp_sdes_item::len
uint8_t len
Definition: rtcp.h:115
RTCP_APP
@ RTCP_APP
Definition: rtcp.h:37
rtcp_nack::blp
uint16_t blp
bitmask of following lost packets
Definition: rtcp.h:151
rtcp_context::expected_prior
uint32_t expected_prior
Definition: rtcp.h:262
janus_rtcp_has_fir
gboolean janus_rtcp_has_fir(char *packet, int len)
Method to check whether an RTCP message contains a FIR request.
Definition: rtcp.c:1109
rtcp_context::rr_last_lost
uint32_t rr_last_lost
Definition: rtcp.h:271
rtcp_context::lost
uint32_t lost
Definition: rtcp.h:263
janus_rtcp_fb_remb
rtcp_remb janus_rtcp_fb_remb
Definition: rtcp.h:174
rtcp_context::retransmitted_prior
uint32_t retransmitted_prior
Definition: rtcp.h:266
rtcp_app
RTCP APP (http://tools.ietf.org/html/rfc3550#section-6.7)
Definition: rtcp.h:138
janus_nack::next
struct janus_nack * next
Next element in the linked list.
Definition: rtcp.h:160
rtcp_sdes::chunk
rtcp_sdes_chunk chunk
Definition: rtcp.h:123
report_block::lsr
uint32_t lsr
Definition: rtcp.h:81
rtcp_fb
RTCP-FB (http://tools.ietf.org/html/rfc4585)
Definition: rtcp.h:190
rtcp_bye
struct rtcp_bye rtcp_bye
RTCP BYE (http://tools.ietf.org/html/rfc3550#section-6.6)
extended_report_block
struct extended_report_block extended_report_block
RTCP Extended Report Block (https://tools.ietf.org/html/rfc3611#section-3)
janus_rtcp_has_bye
gboolean janus_rtcp_has_bye(char *packet, int len)
Method to check whether an RTCP message contains a BYE message.
Definition: rtcp.c:1081
rtcp_nack::pid
uint16_t pid
Packet ID.
Definition: rtcp.h:149
rtcp_app::header
rtcp_header header
Definition: rtcp.h:139
rtcp_sdes::header
rtcp_header header
Definition: rtcp.h:122
rtcp_header
RTCP Header (http://tools.ietf.org/html/rfc3550#section-6.1)
Definition: rtcp.h:47
rtcp_sdes_item
struct rtcp_sdes_item rtcp_sdes_item
janus_rtcp_parse
int janus_rtcp_parse(janus_rtcp_context *ctx, char *packet, int len)
Method to parse/validate an RTCP message.
Definition: rtcp.c:52
janus_rtcp_remb_ssrcs
int janus_rtcp_remb_ssrcs(char *packet, int len, uint32_t bitrate, uint8_t numssrc)
Method to generate a new RTCP REMB message to cap the reported bitrate, but for more SSRCs.
Definition: rtcp.c:1433
rtcp_sdes_item
Definition: rtcp.h:113
janus_rtcp_check_remb
gboolean janus_rtcp_check_remb(janus_rtcp_header *rtcp, int len)
Method to check if a RTCP packet could contain an AFB REMB Message.
Definition: rtcp.c:481
janus_rtcp_fix_ssrc
int janus_rtcp_fix_ssrc(janus_rtcp_context *ctx, char *packet, int len, int fixssrc, uint32_t newssrcl, uint32_t newssrcr)
Method to fix an RTCP message (http://tools.ietf.org/html/draft-ietf-straw-b2bua-rtcp-00)
Definition: rtcp.c:499
rtcp_remb::bitrate
uint32_t bitrate
Num SSRC, Br Exp, Br Mantissa (bit mask)
Definition: rtcp.h:170
rtcp_context::in_link_quality
double in_link_quality
Definition: rtcp.h:277
rtcp_context::rr_last_ts
int64_t rr_last_ts
Definition: rtcp.h:269
rtcp_fb::fci
char fci[1]
Feedback Control Information.
Definition: rtcp.h:198
rtcp_context::tb
uint32_t tb
Definition: rtcp.h:245
rtcp_sr::rb
report_block rb[1]
Definition: rtcp.h:92
janus_rtcp_nacks
int janus_rtcp_nacks(char *packet, int len, GSList *nacks)
Method to generate a new RTCP NACK message to report lost packets.
Definition: rtcp.c:1514
rtcp_sdes
Definition: rtcp.h:121
janus_rtcp_check_fci
gboolean janus_rtcp_check_fci(janus_rtcp_header *rtcp, int len, int sizeof_fci)
Method to check if a RTCP packet could contain a Feedback Message with a defined FCI size.
Definition: rtcp.c:448
janus_rtcp_transport_wide_cc_feedback
int janus_rtcp_transport_wide_cc_feedback(char *packet, size_t len, guint32 ssrc, guint32 media, guint8 feedback_packet_count, GQueue *transport_wide_cc_stats)
Method to generate a new RTCP transport wide message to report reception stats.
Definition: rtcp.c:1558
sender_info::rtp_ts
uint32_t rtp_ts
Definition: rtcp.h:68
RTCP_RR
@ RTCP_RR
Definition: rtcp.h:34
janus_rtcp_check_rr
gboolean janus_rtcp_check_rr(janus_rtcp_header *rtcp, int len)
Method to check if a RTCP packet could contain a Receiver Report.
Definition: rtcp.c:438
rtcp_transport_wide_cc_stats::transport_seq_num
guint32 transport_seq_num
Transwport wide sequence number.
Definition: rtcp.h:291
rtcp_context::out_link_quality
double out_link_quality
Definition: rtcp.h:279
rtcp_context::out_media_link_quality
double out_media_link_quality
Definition: rtcp.h:280
rtcp_context::jitter
double jitter
Definition: rtcp.h:243
janus_rtcp_get_nacks
GSList * janus_rtcp_get_nacks(char *packet, int len)
Method to parse an RTCP NACK message.
Definition: rtcp.c:1169
rtcp_sdes
struct rtcp_sdes rtcp_sdes
rtcp_nack
struct rtcp_nack rtcp_nack
RTCP NACK (http://tools.ietf.org/html/rfc4585#section-6.2.1)
janus_rtcp_context_get_lost_all
uint32_t janus_rtcp_context_get_lost_all(janus_rtcp_context *ctx, gboolean remote)
Method to retrieve the total number of lost packets from an existing RTCP context.
Definition: rtcp.c:918
janus_rtcp_context_get_out_media_link_quality
uint32_t janus_rtcp_context_get_out_media_link_quality(janus_rtcp_context *ctx)
Method to retrieve outbound media link quality from an existing RTCP context.
Definition: rtcp.c:914
sender_info::ntp_ts_lsw
uint32_t ntp_ts_lsw
Definition: rtcp.h:67
janus_rtcp_sdes_item
rtcp_sdes_item janus_rtcp_sdes_item
Definition: rtcp.h:118
report_block::ehsnr
uint32_t ehsnr
Definition: rtcp.h:79
rtcp_header::version
uint16_t version
Definition: rtcp.h:49
sender_info::s_packets
uint32_t s_packets
Definition: rtcp.h:69
rtcp_header
struct rtcp_header rtcp_header
RTCP Header (http://tools.ietf.org/html/rfc3550#section-6.1)
janus_rtcp_context_get_jitter
uint32_t janus_rtcp_context_get_jitter(janus_rtcp_context *ctx, gboolean remote)
Method to retrieve the jitter from an existing RTCP context.
Definition: rtcp.c:950
rtcp_sdes_item::type
uint8_t type
Definition: rtcp.h:114
rtcp_sdes_chunk::ssrc
uint32_t ssrc
Definition: rtcp.h:108
rtcp_context::lost_remote
uint32_t lost_remote
Definition: rtcp.h:263
rtcp_transport_wide_cc_stats
struct rtcp_transport_wide_cc_stats rtcp_transport_wide_cc_stats
Stores transport wide packet reception statistics.
janus_rtcp_header
rtcp_header janus_rtcp_header
Definition: rtcp.h:61
janus_rtcp_sdes_chunk
rtcp_sdes_chunk janus_rtcp_sdes_chunk
Definition: rtcp.h:110
janus_rtcp_filter
char * janus_rtcp_filter(char *packet, int len, int *newlen)
Method to filter an outgoing RTCP message (http://tools.ietf.org/html/draft-ietf-straw-b2bua-rtcp-00)
Definition: rtcp.c:738
rtcp_context::seq_cycle
uint16_t seq_cycle
Definition: rtcp.h:236
rtcp_context::lsr_ts
int64_t lsr_ts
Definition: rtcp.h:250
rtcp_rr
RTCP Receiver Report (http://tools.ietf.org/html/rfc3550#section-6.4.2)
Definition: rtcp.h:98
janus_rtcp_fir
int janus_rtcp_fir(char *packet, int len, int *seqnr)
Method to generate a new RTCP FIR message to request a key frame.
Definition: rtcp.c:1478
janus_rtcp_get_remb
uint32_t janus_rtcp_get_remb(char *packet, int len)
Inspect an existing RTCP REMB message to retrieve the reported bitrate.
Definition: rtcp.c:1292
rtcp_context
Internal RTCP state context (for RR/SR)
Definition: rtcp.h:229
rtcp_context::expected
uint32_t expected
Definition: rtcp.h:261
janus_rtcp_sdes_cname
int janus_rtcp_sdes_cname(char *packet, int len, const char *cname, int cnamelen)
Method to generate a new RTCP SDES message.
Definition: rtcp.c:1401
rtcp_fb::media
uint32_t media
Media source.
Definition: rtcp.h:196
rtcp_sdes::item
rtcp_sdes_item item
Definition: rtcp.h:124
rtcp_rr
struct rtcp_rr rtcp_rr
RTCP Receiver Report (http://tools.ietf.org/html/rfc3550#section-6.4.2)
rtcp_context::in_media_link_quality
double in_media_link_quality
Definition: rtcp.h:278
janus_rtcp_context_get_out_link_quality
uint32_t janus_rtcp_context_get_out_link_quality(janus_rtcp_context *ctx)
Method to retrieve outbound link quality from an existing RTCP context.
Definition: rtcp.c:910
rtcp_type
rtcp_type
RTCP Packet Types (http://www.networksorcery.com/enp/protocol/rtcp.htm)
Definition: rtcp.h:31
rtcp_context::transit
int64_t transit
Definition: rtcp.h:242
rtcp_transport_wide_cc_stats::timestamp
guint64 timestamp
Reception time.
Definition: rtcp.h:293
sender_info
struct sender_info sender_info
RTCP Sender Information (http://tools.ietf.org/html/rfc3550#section-6.4.1)
janus_rtcp_pli
int janus_rtcp_pli(char *packet, int len)
Method to generate a new RTCP PLI message to request a key frame.
Definition: rtcp.c:1500
report_block::delay
uint32_t delay
Definition: rtcp.h:82
janus_rtcp_fix_report_data
int janus_rtcp_fix_report_data(char *packet, int len, uint32_t base_ts, uint32_t base_ts_prev, uint32_t ssrc_peer, uint32_t ssrc_local, uint32_t ssrc_expected, gboolean video)
Method to fix incoming RTCP SR and RR data.
Definition: rtcp.c:1011
RTCP_PSFB
@ RTCP_PSFB
Definition: rtcp.h:39
report_block::jitter
uint32_t jitter
Definition: rtcp.h:80
rtcp_context::rr_last_ehsnr
uint32_t rr_last_ehsnr
Definition: rtcp.h:270
rtcp_xr
RTCP Extended Report (https://tools.ietf.org/html/rfc3611#section-2)
Definition: rtcp.h:219
janus_rtcp_transport_wide_cc_stats
rtcp_transport_wide_cc_stats janus_rtcp_transport_wide_cc_stats
Definition: rtcp.h:295
janus_rtcp_sdes
rtcp_sdes janus_rtcp_sdes
Definition: rtcp.h:126
rtcp_sr::si
sender_info si
Definition: rtcp.h:91
rtcp_context::rtt
uint32_t rtt
Definition: rtcp.h:256
janus_rtcp_xr
rtcp_xr janus_rtcp_xr
Definition: rtcp.h:224
rtcp_fir::ssrc
uint32_t ssrc
SSRC of the media sender that needs to send a key frame.
Definition: rtcp.h:181
janus_rtcp_get_receiver_ssrc
guint32 janus_rtcp_get_receiver_ssrc(char *packet, int len)
Method to quickly retrieve the received SSRC (needed for demuxing RTCP in BUNDLE)
Definition: rtcp.c:109
rtcp_context::received
uint32_t received
Definition: rtcp.h:259
rtcp_context::rtp_last_inorder_time
int64_t rtp_last_inorder_time
Definition: rtcp.h:233
janus_is_rtcp
gboolean janus_is_rtcp(char *buf, guint len)
Helper method to demultiplex RTCP from other protocols.
Definition: rtcp.c:45
janus_rtcp_app
rtcp_app janus_rtcp_app
Definition: rtcp.h:143
janus_rtcp_remb
int janus_rtcp_remb(char *packet, int len, uint32_t bitrate)
Method to generate a new RTCP REMB message to cap the reported bitrate.
Definition: rtcp.c:1428
rtcp_rr::rb
report_block rb[1]
Definition: rtcp.h:101
RTCP_RTPFB
@ RTCP_RTPFB
Definition: rtcp.h:38
RTCP_XR
@ RTCP_XR
Definition: rtcp.h:40
janus_nack
struct janus_nack janus_nack
Janus representation (linked list) of sequence numbers to send again.
rtcp_bye::header
rtcp_header header
Definition: rtcp.h:131
rtcp_fb::header
rtcp_header header
Common header.
Definition: rtcp.h:192
janus_rtcp_parse_lost_info
gboolean janus_rtcp_parse_lost_info(char *packet, int len, uint32_t *lost, int *fraction)
Method to quickly fetch the lost packets info from an RR packet, if present.
rtcp_app
struct rtcp_app rtcp_app
RTCP APP (http://tools.ietf.org/html/rfc3550#section-6.7)
janus_rtcp_get_sender_ssrc
guint32 janus_rtcp_get_sender_ssrc(char *packet, int len)
Method to quickly retrieve the sender SSRC (needed for demuxing RTCP in BUNDLE)
Definition: rtcp.c:56
janus_rtcp_type
rtcp_type janus_rtcp_type
Definition: rtcp.h:42
RTCP_SR
@ RTCP_SR
Definition: rtcp.h:33
rtcp_header::length
uint16_t length
Definition: rtcp.h:59
janus_report_block
report_block janus_report_block
Definition: rtcp.h:84
rtcp_transport_wide_cc_stats
Stores transport wide packet reception statistics.
Definition: rtcp.h:289
sender_info
RTCP Sender Information (http://tools.ietf.org/html/rfc3550#section-6.4.1)
Definition: rtcp.h:65
janus_rtcp_report_block
int janus_rtcp_report_block(janus_rtcp_context *ctx, janus_report_block *rb)
Method to fill in a Report Block in a Receiver Report.
Definition: rtcp.c:980
RTCP_FIR
@ RTCP_FIR
Definition: rtcp.h:32
rtcp_context::retransmitted
uint32_t retransmitted
Definition: rtcp.h:265
report_block::flcnpl
uint32_t flcnpl
Definition: rtcp.h:78
rtcp_header::rc
uint16_t rc
Definition: rtcp.h:51
report_block
RTCP Report Block (http://tools.ietf.org/html/rfc3550#section-6.4.1)
Definition: rtcp.h:76
sender_info::s_octets
uint32_t s_octets
Definition: rtcp.h:70
rtcp_sr::ssrc
uint32_t ssrc
Definition: rtcp.h:90
extended_report_block::length
uint16_t length
Block length.
Definition: rtcp.h:210
rtcp_xr::ssrc
uint32_t ssrc
Definition: rtcp.h:221
report_block::ssrc
uint32_t ssrc
Definition: rtcp.h:77
rtcp_context::sent_packets_since_last_rr
gint sent_packets_since_last_rr
Definition: rtcp.h:273
rtcp_context::jitter_remote
double jitter_remote
Definition: rtcp.h:243
rtcp_xr::header
rtcp_header header
Definition: rtcp.h:220
rtcp_context::rr_last_nack_count
uint32_t rr_last_nack_count
Definition: rtcp.h:272
janus_rtcp_nack
rtcp_nack janus_rtcp_nack
Definition: rtcp.h:153
janus_rtcp_cap_remb
int janus_rtcp_cap_remb(char *packet, int len, uint32_t bitrate)
Method to modify an existing RTCP REMB message to cap the reported bitrate.
Definition: rtcp.c:1336
rtcp_context::last_sent
int64_t last_sent
Definition: rtcp.h:253
rtcp_app::ssrc
uint32_t ssrc
Definition: rtcp.h:140
janus_nack::seq_no
uint16_t seq_no
Sequence number to send again.
Definition: rtcp.h:158
extended_report_block::blocktype
uint8_t blocktype
Block type (BT)
Definition: rtcp.h:206
RTCP_SDES
@ RTCP_SDES
Definition: rtcp.h:35
rtcp_context::pt
uint16_t pt
Definition: rtcp.h:239
janus_rtcp_context
rtcp_context janus_rtcp_context
Definition: rtcp.h:285
janus_rtcp_context_get_in_media_link_quality
uint32_t janus_rtcp_context_get_in_media_link_quality(janus_rtcp_context *ctx)
Method to retrieve inbound media link quality from an existing RTCP context.
Definition: rtcp.c:906
janus_rtcp_fir_legacy
int janus_rtcp_fir_legacy(char *packet, int len, int *seqnr)
Method to generate a new legacy RTCP FIR (RFC2032) message to request a key frame.
rtcp_remb
struct rtcp_remb rtcp_remb
RTCP REMB (http://tools.ietf.org/html/draft-alvestrand-rmcat-remb-03)
janus_nack
Janus representation (linked list) of sequence numbers to send again.
Definition: rtcp.h:156
rtcp_fir
RTCP FIR (http://tools.ietf.org/search/rfc5104#section-4.3.1.1)
Definition: rtcp.h:179
janus_rtcp_context_get_in_link_quality
uint32_t janus_rtcp_context_get_in_link_quality(janus_rtcp_context *ctx)
Method to retrieve inbound link quality from an existing RTCP context.
Definition: rtcp.c:902
rtcp_context::base_seq
uint16_t base_seq
Definition: rtcp.h:237
rtcp_context::received_prior
uint32_t received_prior
Definition: rtcp.h:260
rtcp_remb
RTCP REMB (http://tools.ietf.org/html/draft-alvestrand-rmcat-remb-03)
Definition: rtcp.h:166
rtcp_nack
RTCP NACK (http://tools.ietf.org/html/rfc4585#section-6.2.1)
Definition: rtcp.h:147
report_block
struct report_block report_block
RTCP Report Block (http://tools.ietf.org/html/rfc3550#section-6.4.1)
rtcp_bye
RTCP BYE (http://tools.ietf.org/html/rfc3550#section-6.6)
Definition: rtcp.h:130
rtcp_sr::header
rtcp_header header
Definition: rtcp.h:89
rtcp_context::rtp_recvd
uint8_t rtp_recvd
Definition: rtcp.h:231
rtcp_sr
RTCP Sender Report (http://tools.ietf.org/html/rfc3550#section-6.4.1)
Definition: rtcp.h:88
rtcp_context::max_seq_nr
uint16_t max_seq_nr
Definition: rtcp.h:235
janus_rtcp_fb
rtcp_fb janus_rtcp_fb
Definition: rtcp.h:200
rtcp_context::lsr
uint32_t lsr
Definition: rtcp.h:248
rtcp_context::rtp_last_inorder_ts
uint32_t rtp_last_inorder_ts
Definition: rtcp.h:232
janus_rtcp_bye
rtcp_bye janus_rtcp_bye
Definition: rtcp.h:134
extended_report_block::content
char content[1]
Content (variable length)
Definition: rtcp.h:212
rtcp_header::padding
uint16_t padding
Definition: rtcp.h:50
rtcp_sr
struct rtcp_sr rtcp_sr
RTCP Sender Report (http://tools.ietf.org/html/rfc3550#section-6.4.1)
extended_report_block
RTCP Extended Report Block (https://tools.ietf.org/html/rfc3611#section-3)
Definition: rtcp.h:204
rtcp_context::nack_count
gint nack_count
Definition: rtcp.h:274
janus_rtcp_swap_report_blocks
void janus_rtcp_swap_report_blocks(char *packet, int len, uint32_t rtx_ssrc)
Method to swap Report Blocks and move media RB in first position in case rtx SSRC comes first.
Definition: rtcp.c:157
rtcp_fir::seqnr
uint32_t seqnr
Sequence number (only the first 8 bits are used, the other 24 are reserved)
Definition: rtcp.h:183
sender_info::ntp_ts_msw
uint32_t ntp_ts_msw
Definition: rtcp.h:66
RTCP_BYE
@ RTCP_BYE
Definition: rtcp.h:36
rtcp_rr::header
rtcp_header header
Definition: rtcp.h:99
janus_rtcp_sr
rtcp_sr janus_rtcp_sr
Definition: rtcp.h:94
rtcp_fb
struct rtcp_fb rtcp_fb
RTCP-FB (http://tools.ietf.org/html/rfc4585)
rtcp_app::name
char name[4]
Definition: rtcp.h:141
rtcp_sdes_item::content
char content[1]
Definition: rtcp.h:116
janus_rtcp_remove_nacks
int janus_rtcp_remove_nacks(char *packet, int len)
Method to remove an RTCP NACK message.
Definition: rtcp.c:1237
rtcp_sdes_chunk
RTCP SDES (http://tools.ietf.org/html/rfc3550#section-6.5)
Definition: rtcp.h:107
janus_sender_info
sender_info janus_sender_info
Definition: rtcp.h:72
rtcp_sdes_chunk
struct rtcp_sdes_chunk rtcp_sdes_chunk
RTCP SDES (http://tools.ietf.org/html/rfc3550#section-6.5)
rtcp_fir
struct rtcp_fir rtcp_fir
RTCP FIR (http://tools.ietf.org/search/rfc5104#section-4.3.1.1)
rtcp_context
struct rtcp_context rtcp_context
Internal RTCP state context (for RR/SR)
janus_rtcp_check_sr
gboolean janus_rtcp_check_sr(janus_rtcp_header *rtcp, int len)
Method to check if a RTCP packet could contain a Sender Report.
Definition: rtcp.c:424
rtcp_header::type
uint16_t type
Definition: rtcp.h:52
janus_rtcp_check_len
gboolean janus_rtcp_check_len(janus_rtcp_header *rtcp, int len)
Method to check that a RTCP packet size is at least the minimum necessary (8 bytes) and to validate t...
Definition: rtcp.c:411
rtcp_remb::ssrc
uint32_t ssrc[3]
SSRC feedback (we expect at max three SSRCs in there)
Definition: rtcp.h:172
rtcp_fb::ssrc
uint32_t ssrc
Sender SSRC.
Definition: rtcp.h:194
rtcp_xr
struct rtcp_xr rtcp_xr
RTCP Extended Report (https://tools.ietf.org/html/rfc3611#section-2)
rtcp_xr::erb
extended_report_block erb[1]
Definition: rtcp.h:222
janus_rtcp_context_get_rtt
uint32_t janus_rtcp_context_get_rtt(janus_rtcp_context *ctx)
Method to retrieve the estimated round-trip time from an existing RTCP context.
Definition: rtcp.c:898
rtcp_bye::ssrc
uint32_t ssrc[1]
Definition: rtcp.h:132
janus_rtcp_fb_fir
rtcp_fir janus_rtcp_fb_fir
Definition: rtcp.h:185
extended_report_block::typesp
uint8_t typesp
Type-specific.
Definition: rtcp.h:208
janus_rtcp_process_incoming_rtp
int janus_rtcp_process_incoming_rtp(janus_rtcp_context *ctx, char *packet, int len, gboolean rfc4588_pkt, gboolean rfc4588_enabled, gboolean retransmissions_disabled, GHashTable *clock_rates)
Method to quickly process the header of an incoming RTP packet to update the associated RTCP context.
Definition: rtcp.c:816