|
void | janus_sdp_destroy (janus_sdp *sdp) |
| Method to destroy a Janus SDP object.
|
|
void | janus_sdp_mline_destroy (janus_sdp_mline *m) |
| Helper method to free a janus_sdp_mline instance.
|
|
void | janus_sdp_attribute_destroy (janus_sdp_attribute *a) |
| Helper method to free a janus_sdp_attribute instance.
|
|
janus_sdp_mline * | janus_sdp_mline_create (janus_sdp_mtype type, guint16 port, const char *proto, janus_sdp_mdirection direction) |
| Helper method to quickly create a janus_sdp_mline instance.
|
|
janus_sdp_mline * | janus_sdp_mline_find (janus_sdp *sdp, janus_sdp_mtype type) |
| Helper method to get the janus_sdp_mline associated to a media type.
|
|
int | janus_sdp_mline_remove (janus_sdp *sdp, janus_sdp_mtype type) |
| Helper method to remove the janus_sdp_mline associated to a media type from the SDP.
|
|
janus_sdp_attribute * | janus_sdp_attribute_create (const char *name, const char *value,...) |
|
int | janus_sdp_attribute_add_to_mline (janus_sdp_mline *mline, janus_sdp_attribute *attr) |
| Helper method to add an attribute to a media line.
|
|
janus_sdp_mtype | janus_sdp_parse_mtype (const char *type) |
| Helper method to get a janus_sdp_mtype from a string.
|
|
const char * | janus_sdp_mtype_str (janus_sdp_mtype type) |
| Helper method to get the string associated to a janus_sdp_mtype value.
|
|
janus_sdp_mdirection | janus_sdp_parse_mdirection (const char *direction) |
| Helper method to get a janus_sdp_mdirection from a string.
|
|
const char * | janus_sdp_mdirection_str (janus_sdp_mdirection direction) |
| Helper method to get the string associated to a janus_sdp_mdirection value.
|
|
janus_sdp * | janus_sdp_parse (const char *sdp, char *error, size_t errlen) |
| Method to parse an SDP string to a janus_sdp object.
|
|
int | janus_sdp_remove_payload_type (janus_sdp *sdp, int pt) |
| Helper method to quickly remove all traces (m-line, rtpmap, fmtp, etc.) of a payload type.
|
|
int | janus_sdp_get_codec_pt (janus_sdp *sdp, const char *codec) |
| Helper to get the payload type associated to a specific codec.
|
|
int | janus_sdp_get_codec_pt_full (janus_sdp *sdp, const char *codec, const char *profile) |
| Helper to get the payload type associated to a specific codec, taking into account a codec profile as a hint as well.
|
|
const char * | janus_sdp_get_codec_name (janus_sdp *sdp, int pt) |
| Helper to get the codec name associated to a specific payload type.
|
|
const char * | janus_sdp_get_codec_rtpmap (const char *codec) |
| Helper to get the rtpmap associated to a specific codec.
|
|
const char * | janus_sdp_get_fmtp (janus_sdp *sdp, int pt) |
| Helper to get the fmtp associated to a specific payload type.
|
|
int | janus_sdp_get_opusred_pt (janus_sdp *sdp) |
| Helper to get the opus/red payload type from an SDP, if present.
|
|
char * | janus_sdp_write (janus_sdp *imported) |
| Method to serialize a janus_sdp object to an SDP string.
|
|
void | janus_sdp_find_preferred_codecs (janus_sdp *sdp, const char **acodec, const char **vcodec) |
| Helper method to return the preferred audio and video codecs in an SDP offer or answer, (where by preferred we mean the codecs we prefer ourselves, and not the m-line SDP order) as long as the m-line direction is not disabled (port=0 or direction=inactive) in the SDP.
|
|
void | janus_sdp_find_first_codecs (janus_sdp *sdp, const char **acodec, const char **vcodec) |
| Helper method to return the first audio and video codecs in an SDP offer or answer, (no matter whether we personally prefer them ourselves or not) as long as the m-line direction is not disabled (port=0 or direction=inactive) in the SDP.
|
|
const char * | janus_sdp_match_preferred_codec (janus_sdp_mtype type, char *codec) |
| Helper method to match a codec to one of the preferred codecs.
|
|
janus_sdp * | janus_sdp_new (const char *name, const char *address) |
| Method to quickly generate a janus_sdp instance from a few selected fields.
|
|
janus_sdp * | janus_sdp_generate_offer (const char *name, const char *address,...) |
| Method to generate a janus_sdp offer, using variable arguments to dictate what to negotiate (e.g., in terms of media to offer, directions, etc.). Variable arguments are in the form of a sequence of name-value terminated by a JANUS_SDP_OA_DONE, e.g.:
|
|
janus_sdp * | janus_sdp_generate_answer (janus_sdp *offer,...) |
| Method to generate a janus_sdp answer to a provided janus_sdp offer, using variable arguments to dictate how to respond (e.g., in terms of media to accept, reject, directions, etc.). Variable arguments are in the form of a sequence of name-value terminated by a JANUS_SDP_OA_DONE, e.g.:
|
|
SDP utilities.
- Author
- Lorenzo Miniero loren.nosp@m.zo@m.nosp@m.eetec.nosp@m.ho.c.nosp@m.om
- Copyright
- GNU General Public License v3
Implementation of an internal SDP representation. Allows to parse SDP strings to an internal janus_sdp object, the manipulation of such object by playing with its properties, and a serialization to an SDP string that can be passed around. Since they don't have any core dependencies, these utilities can be used by plugins as well.
Core
Method to generate a janus_sdp answer to a provided janus_sdp offer, using variable arguments to dictate how to respond (e.g., in terms of media to accept, reject, directions, etc.). Variable arguments are in the form of a sequence of name-value terminated by a JANUS_SDP_OA_DONE, e.g.:
janus_sdp *answer = janus_sdp_generate_answer(offer,
JANUS_SDP_OA_AUDIO, TRUE,
JANUS_SDP_OA_AUDIO_DIRECTION, JANUS_SDP_RECVONLY,
JANUS_SDP_OA_AUDIO_CODEC, "opus",
JANUS_SDP_OA_VIDEO, FALSE,
JANUS_SDP_OA_DATA, FALSE,
JANUS_SDP_OA_DONE);
to only accept the audio stream being offered, but as recvonly
, use Opus and reject both video and datachannels. Refer to the property names in the header file for a complete list of how you can drive the answer. The default, if not specified, is to accept everything as sendrecv
.
- Parameters
-
[in] | offer | The Janus SDP offer to respond to |
- Returns
- A pointer to a janus_sdp object, if successful, NULL otherwise
janus_sdp * janus_sdp_generate_offer |
( |
const char * | name, |
|
|
const char * | address, |
|
|
| ... ) |
Method to generate a janus_sdp offer, using variable arguments to dictate what to negotiate (e.g., in terms of media to offer, directions, etc.). Variable arguments are in the form of a sequence of name-value terminated by a JANUS_SDP_OA_DONE, e.g.:
janus_sdp *offer = janus_sdp_generate_offer("My session", "127.0.0.1",
JANUS_SDP_OA_AUDIO, TRUE,
JANUS_SDP_OA_AUDIO_PT, 100,
JANUS_SDP_OA_AUDIO_DIRECTION, JANUS_SDP_SENDONLY,
JANUS_SDP_OA_AUDIO_CODEC, "opus",
JANUS_SDP_OA_VIDEO, FALSE,
JANUS_SDP_OA_DATA, FALSE,
JANUS_SDP_OA_DONE);
to only offer a sendonly
Opus audio stream being offered with 100 as payload type, and avoid video and datachannels. Refer to the property names in the header file for a complete list of how you can drive the offer. The default, if not specified, is to offer everything, using Opus with pt=111 for audio, VP8 with pt=96 as video, and data channels, all as sendrecv
.
- Parameters
-
[in] | name | The session name (if NULL, a default value will be set) |
[in] | address | The IP to set in o= and c= fields (if NULL, a default value will be set) |
- Returns
- A pointer to a janus_sdp object, if successful, NULL otherwise