SDP processing. More...
#include "janus.h"
#include "ice.h"
#include "dtls.h"
#include "sdp.h"
#include "utils.h"
#include "debug.h"
Functions | |
int | janus_sdp_init (void) |
Janus SDP processor initialization. | |
void | janus_sdp_deinit (void) |
Janus SDP processor deinitialization. | |
void | janus_sdp_free (janus_sdp *sdp) |
Method to free a Janus SDP instance. | |
janus_sdp * | janus_sdp_preparse (const char *jsep_sdp, int *audio, int *video, int *data, int *bundle, int *rtcpmux, int *trickle) |
Method to pre-parse a session description. | |
int | janus_sdp_parse (janus_ice_handle *handle, janus_sdp *sdp) |
Method to parse a session description. | |
int | janus_sdp_parse_candidate (janus_ice_stream *stream, const char *candidate, int trickle) |
Method to parse a single candidate. | |
int | janus_sdp_parse_ssrc (janus_ice_stream *stream, const char *ssrc_attr, int video) |
Method to parse a SSRC attribute. | |
char * | janus_sdp_anonymize (const char *sdp) |
Method to strip/anonymize a session description. | |
char * | janus_sdp_merge (janus_ice_handle *handle, const char *origsdp) |
Method to merge a stripped session description and the right transport information. |
SDP processing.
Implementation (based on the Sofia-SDP stack) of the SDP parser/merger/generator in the gateway. 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.
char* janus_sdp_anonymize | ( | const char * | sdp | ) |
Method to strip/anonymize a session description.
[in] | sdp | The session description to strip/anonymize |
void janus_sdp_deinit | ( | void | ) |
Janus SDP processor deinitialization.
void janus_sdp_free | ( | janus_sdp * | sdp | ) |
Method to free a Janus SDP instance.
[in] | sdp | The Janus SDP instance to free |
int janus_sdp_init | ( | void | ) |
Janus SDP processor initialization.
char* janus_sdp_merge | ( | janus_ice_handle * | session, |
const char * | sdp | ||
) |
Method to merge a stripped session description and the right transport information.
[in] | session | The ICE session this session description is related to |
[in] | sdp | The stripped session description to merge |
int janus_sdp_parse | ( | janus_ice_handle * | session, |
janus_sdp * | sdp | ||
) |
Method to parse a session description.
This method will parse a session description coming from a peer, and set up the ICE candidates accordingly
[in] | session | The ICE session this session description will modify |
[in] | sdp | The Janus SDP instance to parse |
int janus_sdp_parse_candidate | ( | janus_ice_stream * | 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
[in] | stream | The ICE stream this candidate refers to |
[in] | candidate | The remote candidate to process |
[in] | trickle | Whether this is a trickle candidate, or coming from the SDP |
int janus_sdp_parse_ssrc | ( | janus_ice_stream * | 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
[in] | stream | The ICE stream this candidate refers to |
[in] | ssrc_attr | The SSRC attribute value to parse |
[in] | video | Whether this is a video SSRC or not |
janus_sdp* janus_sdp_preparse | ( | const char * | jsep_sdp, |
int * | audio, | ||
int * | video, | ||
int * | data, | ||
int * | bundle, | ||
int * | rtcpmux, | ||
int * | trickle | ||
) |
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
[in] | jsep_sdp | The SDP that the browser peer originated |
[out] | audio | The number of audio m-lines |
[out] | video | The number of video m-lines |
[out] | data | The number of SCTP m-lines |
[out] | bundle | Whether BUNDLE has been negotiated or not |
[out] | rtcpmux | Whether rtcp-mux has been negotiated or not |
[out] | trickle | Whether ICE trickling is being used (no candidates) or not |