Fork me on GitHub
Loading...
Searching...
No Matches
sdp.h File Reference

SDP processing (headers) More...

#include <inttypes.h>
#include "sdp-utils.h"
#include "dtls.h"
Include dependency graph for sdp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

Janus SDP helper methods
janus_sdpjanus_sdp_preparse (void *handle, const char *jsep_sdp, char *error_str, size_t errlen, janus_dtls_role *dtls_role, int *audio, int *video, int *data)
 Method to pre-parse a session description.
 
int janus_sdp_process (void *handle, janus_sdp *sdp, gboolean rids_hml, gboolean update)
 Method to process a parsed session description.
 
int janus_sdp_parse_candidate (void *stream, const char *candidate, int trickle)
 Method to parse a single candidate.
 
int janus_sdp_parse_ssrc_group (void *stream, const char *group_attr, int video)
 Method to parse a SSRC group attribute.
 
int janus_sdp_parse_ssrc (void *stream, const char *ssrc_attr, int video)
 Method to parse a SSRC attribute.
 
int janus_sdp_anonymize (janus_sdp *sdp)
 Method to strip/anonymize a session description.
 
char * janus_sdp_merge (void *handle, janus_sdp *sdp, gboolean offer)
 Method to merge a stripped session description and the right transport information.
 

Detailed Description

SDP processing (headers)

Author
Lorenzo Miniero loren.nosp@m.zo@m.nosp@m.eetec.nosp@m.ho.c.nosp@m.om

Implementation of an SDP parser/merger/generator in the server. Each SDP coming from peers is stripped/anonymized before it is passed to the plugins: all DTLS/ICE/transport related information is removed, only leaving the relevant information in place. SDP coming from plugins is stripped/anonymized as well, and merged with the proper DTLS/ICE/transport information before it is sent to the peers. The actual SDP processing (parsing SDP strings, representation of SDP as an internal format, and so on) is done via the tools provided in sdp-utils.h.

Protocols

Function Documentation

◆ janus_sdp_anonymize()

int janus_sdp_anonymize ( janus_sdp * sdp)

Method to strip/anonymize a session description.

Parameters
[in,out]sdpThe Janus SDP description object to strip/anonymize
Returns
0 in case of success, a non-zero integer in case of an error

◆ janus_sdp_merge()

char * janus_sdp_merge ( void * handle,
janus_sdp * sdp,
gboolean offer )

Method to merge a stripped session description and the right transport information.

Parameters
[in]handleOpaque pointer to the ICE handle this session description is related to
[in]sdpThe Janus SDP description object to merge/enrich
[in]offerWhether the SDP is an offer or an answer
Returns
A string containing the full session description in case of success, NULL if the SDP is invalid

◆ janus_sdp_parse_candidate()

int janus_sdp_parse_candidate ( void * stream,
const char * candidate,
int trickle )

Method to parse a single candidate.

This method will parse a single remote candidate provided by a peer, whether it is trickling or not

Parameters
[in]streamOpaque pointer to the ICE stream this candidate refers to
[in]candidateThe remote candidate to process
[in]trickleWhether this is a trickle candidate, or coming from the SDP
Returns
0 in case of success, a non-zero integer in case of an error

◆ janus_sdp_parse_ssrc()

int janus_sdp_parse_ssrc ( void * stream,
const char * ssrc_attr,
int video )

Method to parse a SSRC attribute.

This method will parse a SSRC attribute, and set it for the peer

Parameters
[in]streamOpaque pointer to the ICE stream this candidate refers to
[in]ssrc_attrThe SSRC attribute value to parse
[in]videoWhether this is a video SSRC or not
Returns
0 in case of success, a non-zero integer in case of an error

◆ janus_sdp_parse_ssrc_group()

int janus_sdp_parse_ssrc_group ( void * stream,
const char * group_attr,
int video )

Method to parse a SSRC group attribute.

This method will parse a SSRC group attribute, and set the parsed values for the peer

Parameters
[in]streamOpaque pointer to the ICE stream this candidate refers to
[in]group_attrThe SSRC group attribute value to parse
[in]videoWhether this is video-related or not
Returns
0 in case of success, a non-zero integer in case of an error

◆ janus_sdp_preparse()

janus_sdp * janus_sdp_preparse ( void * handle,
const char * jsep_sdp,
char * error_str,
size_t errlen,
janus_dtls_role * dtls_role,
int * audio,
int * video,
int * data )

Method to pre-parse a session description.

This method is only used to quickly check how many audio and video lines are in an SDP, and to generate a Janus SDP instance

Parameters
[in]handleOpaque pointer to the ICE handle this session description will modify
[in]jsep_sdpThe SDP that the browser peer originated
[in,out]error_strBuffer to receive a reason for an error, if any
[in]errlenThe length of the error buffer
[out]dtls_roleThe advertised DTLS role
[out]audioThe number of audio m-lines
[out]videoThe number of video m-lines
[out]dataThe number of SCTP m-lines
Returns
The Janus SDP object in case of success, NULL in case the SDP is invalid

◆ janus_sdp_process()

int janus_sdp_process ( void * handle,
janus_sdp * sdp,
gboolean rids_hml,
gboolean update )

Method to process a parsed session description.

This method will process a session description coming from a peer, and set up the ICE candidates accordingly

Note
While this method can handle SDP updates, renegotiations are currently limited to updates to the media direction of existing media streams (e.g., sendrecv to recvonly) and ICE restarts. Adding/removing streams and supporting multiple streams in the same PeerConnection are still WIP.
Parameters
[in]handleOpaque pointer to the ICE handle this session description will modify
[in]sdpThe Janus SDP object to process
[in]rids_hmlWhether the order of rids in the SDP, if present, will be h-m-l (TRUE) or l-m-h (FALSE)
[in]updateWhether this SDP is an update to an existing session or not
Returns
0 in case of success, -1 in case of an error