Fork me on GitHub
Macros | Functions
sdp-utils.c File Reference

SDP utilities. More...

#include <string.h>
#include "sdp-utils.h"
#include "utils.h"
#include "debug.h"
Include dependency graph for sdp-utils.c:

Macros

#define JANUS_BUFSIZE   8192
 

Functions

void janus_sdp_free (janus_sdp *sdp)
 Method to free a Janus SDP object. More...
 
janus_sdp_attributejanus_sdp_attribute_create (const char *name, const char *value,...)
 
void janus_sdp_attribute_destroy (janus_sdp_attribute *attr)
 Helper method to free a janus_sdp_attribute instance. More...
 
janus_sdpjanus_sdp_parse (const char *sdp, char *error, size_t errlen)
 Method to parse an SDP string to a janus_sdp object. More...
 
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. More...
 
char * janus_sdp_write (janus_sdp *imported)
 Method to serialize a janus_sdp object to an SDP string. More...
 

Detailed Description

SDP utilities.

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

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

Macro Definition Documentation

◆ JANUS_BUFSIZE

#define JANUS_BUFSIZE   8192

Function Documentation

◆ janus_sdp_attribute_create()

janus_sdp_attribute* janus_sdp_attribute_create ( const char *  name,
const char *  value,
  ... 
)

◆ janus_sdp_attribute_destroy()

void janus_sdp_attribute_destroy ( janus_sdp_attribute attr)

Helper method to free a janus_sdp_attribute instance.

Note
This method does not remove the attribute from the global or m-line attributes, that's up to the caller
Parameters
[in]attrThe janus_sdp_attribute instance to free

◆ janus_sdp_free()

void janus_sdp_free ( janus_sdp sdp)

Method to free a Janus SDP object.

Parameters
[in]sdpThe Janus SDP object to free

◆ janus_sdp_parse()

janus_sdp* janus_sdp_parse ( const char *  sdp,
char *  error,
size_t  errlen 
)

Method to parse an SDP string to a janus_sdp object.

Parameters
[in]sdpThe SDP string to parse
[in,out]errorBuffer to receive a reason for an error, if any
[in]errlenThe length of the error buffer
Returns
A pointer to a janus_sdp object, if successful, NULL otherwise; in case of errors, if provided the error string is filled with a reason

◆ janus_sdp_remove_payload_type()

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.

Parameters
[in]sdpThe janus_sdp object to remove the payload type from
[in]ptThe payload type to remove
Returns
0 in case of success, a negative integer otherwise

◆ janus_sdp_write()

char* janus_sdp_write ( janus_sdp sdp)

Method to serialize a janus_sdp object to an SDP string.

Parameters
[in]sdpThe janus_sdp object to serialize
Returns
A pointer to a string with the serialized SDP, if successful, NULL otherwise