RTP processing. More...
Functions | |
char * | janus_rtp_payload (char *buf, int len, int *plen) |
Helper to quickly access the RTP payload, skipping header and extensions. More... | |
int | janus_rtp_header_extension_get_id (const char *sdp, const char *extension) |
Ugly and dirty helper to quickly get the id associated with an RTP extension (extmap) in an SDP. More... | |
const char * | janus_rtp_header_extension_get_from_id (const char *sdp, int id) |
Ugly and dirty helper to quickly get the RTP extension namespace associated with an id (extmap) in an SDP. More... | |
int | janus_rtp_header_extension_parse_audio_level (char *buf, int len, int id, int *level) |
Helper to parse a ssrc-audio-level RTP extension (https://tools.ietf.org/html/rfc6464) More... | |
int | janus_rtp_header_extension_parse_video_orientation (char *buf, int len, int id, gboolean *c, gboolean *f, gboolean *r1, gboolean *r0) |
Helper to parse a video-orientation RTP extension (http://www.3gpp.org/ftp/Specs/html-info/26114.htm) More... | |
int | janus_rtp_header_extension_parse_playout_delay (char *buf, int len, int id, uint16_t *min_delay, uint16_t *max_delay) |
Helper to parse a playout-delay RTP extension (https://webrtc.org/experiments/rtp-hdrext/playout-delay) More... | |
void | janus_rtp_switching_context_reset (janus_rtp_switching_context *context) |
Set (or reset) the context fields to their default values. More... | |
void | janus_rtp_header_update (rtp_header *header, janus_rtp_switching_context *context, gboolean video, int step) |
Use the context info to update the RTP header of a packet, if needed. More... | |
const char * | janus_srtp_error_str (int error) |
Helper method to get a string representation of a libsrtp error code. More... | |
RTP processing.
Implementation of the RTP header. Since the gateway does not much more than relaying frames around, the only thing we're interested in is the RTP header and how to get its payload, and parsing extensions.
const char* janus_rtp_header_extension_get_from_id | ( | const char * | sdp, |
int | id | ||
) |
Ugly and dirty helper to quickly get the RTP extension namespace associated with an id (extmap) in an SDP.
sdp | The SDP to parse |
id | The extension id to look for |
int janus_rtp_header_extension_get_id | ( | const char * | sdp, |
const char * | extension | ||
) |
Ugly and dirty helper to quickly get the id associated with an RTP extension (extmap) in an SDP.
sdp | The SDP to parse |
extension | The extension namespace to look for |
int janus_rtp_header_extension_parse_audio_level | ( | char * | buf, |
int | len, | ||
int | id, | ||
int * | level | ||
) |
Helper to parse a ssrc-audio-level RTP extension (https://tools.ietf.org/html/rfc6464)
[in] | buf | The packet data |
[in] | len | The packet data length in bytes |
[in] | id | The extension ID to look for |
[out] | level | The level value in dBov (0=max, 127=min) |
int janus_rtp_header_extension_parse_playout_delay | ( | char * | buf, |
int | len, | ||
int | id, | ||
uint16_t * | min_delay, | ||
uint16_t * | max_delay | ||
) |
Helper to parse a playout-delay RTP extension (https://webrtc.org/experiments/rtp-hdrext/playout-delay)
[in] | buf | The packet data |
[in] | len | The packet data length in bytes |
[in] | id | The extension ID to look for |
[out] | min_delay | The minimum delay value |
[out] | max_delay | The maximum delay value |
int janus_rtp_header_extension_parse_video_orientation | ( | char * | buf, |
int | len, | ||
int | id, | ||
gboolean * | c, | ||
gboolean * | f, | ||
gboolean * | r1, | ||
gboolean * | r0 | ||
) |
Helper to parse a video-orientation RTP extension (http://www.3gpp.org/ftp/Specs/html-info/26114.htm)
[in] | buf | The packet data |
[in] | len | The packet data length in bytes |
[in] | id | The extension ID to look for |
[out] | c | The value of the Camera (C) bit |
[out] | f | The value of the Flip (F) bit |
[out] | r1 | The value of the first Rotation (R1) bit |
[out] | r0 | The value of the second Rotation (R0) bit |
void janus_rtp_header_update | ( | rtp_header * | header, |
janus_rtp_switching_context * | context, | ||
gboolean | video, | ||
int | step | ||
) |
Use the context info to update the RTP header of a packet, if needed.
[in] | header | The RTP header to update |
[in] | context | The context to use as a reference |
[in] | video | Whether this is an audio or a video packet |
[in] | step | The expected timestamp step |
char* janus_rtp_payload | ( | char * | buf, |
int | len, | ||
int * | plen | ||
) |
Helper to quickly access the RTP payload, skipping header and extensions.
[in] | buf | The packet data |
[in] | len | The packet data length in bytes |
[out] | plen | The payload data length in bytes |
void janus_rtp_switching_context_reset | ( | janus_rtp_switching_context * | context | ) |
Set (or reset) the context fields to their default values.
[in] | context | The context to (re)set |
const char* janus_srtp_error_str | ( | int | error | ) |
Helper method to get a string representation of a libsrtp error code.
[in] | error | The libsrtp error code |