Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtcp: update documentation #666

Merged
merged 1 commit into from
Jan 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ legend:
* [RFC 4585](https://tools.ietf.org/html/rfc4585) - Extended RTP Profile for RTCP-Based Feedback
* [RFC 4733](https://tools.ietf.org/html/rfc4733) - RTP Payload for DTMF Digits, Telephony Tones, and Teleph. Signals
* [RFC 4961](https://tools.ietf.org/html/rfc4961) - Symmetric RTP / RTP Control Protocol (RTCP)
* [RFC 5104](https://tools.ietf.org/html/rfc5104) - Codec Control Messages in AVPF
* [RFC 5118](https://tools.ietf.org/html/rfc5118) - SIP Torture Test Messages for IPv6
* [RFC 5245](https://tools.ietf.org/html/rfc5245) - Interactive Connectivity Establishment (ICE)
* [RFC 5246](https://tools.ietf.org/html/rfc5246) - The TLS Protocol Version 1.2
Expand Down
17 changes: 17 additions & 0 deletions include/re_rtp.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,25 @@ struct sa;
struct re_printf;
struct rtp_sock;

/**
* Defines the callback handler for received RTP packets
*
* @param src Source network address
* @param hdr RTP header
* @param mb RTP payload
* @param arg Handler argument
*/
typedef void (rtp_recv_h)(const struct sa *src, const struct rtp_header *hdr,
struct mbuf *mb, void *arg);


/**
* Defines the callback handler for received RTCP packets
*
* @param src Source network address
* @param msg RTCP packet
* @param arg Handler argument
*/
typedef void (rtcp_recv_h)(const struct sa *src, struct rtcp_msg *msg,
void *arg);

Expand Down
1 change: 1 addition & 0 deletions src/rtp/pkt.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ int rtcp_vencode(struct mbuf *mb, enum rtcp_type type, uint32_t count,
* @param mb Buffer to encode into
* @param type RTCP Packet type
* @param count Packet-specific count
* @param ... Variable arguments, type specific
*
* @return 0 for success, otherwise errorcode
*/
Expand Down
24 changes: 24 additions & 0 deletions src/rtp/rtcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ int rtcp_send_pli(struct rtp_sock *rs, uint32_t fb_ssrc)
rtp_sess_ssrc(rs), fb_ssrc, NULL, NULL);
}


static int encode_fir_rfc5104_fci(struct mbuf *mb, void *arg)
{
struct fir_rfc5104 *fci = arg;
Expand All @@ -114,6 +115,7 @@ static int encode_fir_rfc5104_fci(struct mbuf *mb, void *arg)
return err;
}


/**
* Send an RTCP Full INTRA-frame Request (FIR) packet according to RFC 5104
*
Expand All @@ -131,6 +133,14 @@ int rtcp_send_fir_rfc5104(struct rtp_sock *rs, uint32_t ssrc, uint8_t fir_seqn)
&encode_fir_rfc5104_fci, &fci);
}


/**
* Get the name of an RTCP type
*
* @param type RTCP type
*
* @return String with RTCP name
*/
const char *rtcp_type_name(enum rtcp_type type)
{
switch (type) {
Expand All @@ -151,6 +161,13 @@ const char *rtcp_type_name(enum rtcp_type type)
}


/**
* Get the name of an RTCP SDES type
*
* @param sdes RTCP SDES type
*
* @return String with RTCP SDES name
*/
const char *rtcp_sdes_name(enum rtcp_sdes_type sdes)
{
switch (sdes) {
Expand Down Expand Up @@ -321,6 +338,13 @@ int rtcp_msg_print(struct re_printf *pf, const struct rtcp_msg *msg)
}


/**
* Check if packet is RTCP packet, used for de-multiplexing
*
* @param mb Mbuffer with packet
*
* @return True if RTCP packet, otherwise false
*/
bool rtp_is_rtcp_packet(const struct mbuf *mb)
{
uint8_t pt;
Expand Down