Fork me on GitHub
Data Structures | Typedefs | Enumerations | Functions
sdp-utils.h File Reference

SDP utilities (headers) More...

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

Go to the source code of this file.

Data Structures

struct  janus_sdp
 Janus SDP internal object representation. More...
 
struct  janus_sdp_mline
 SDP m-line representation. More...
 
struct  janus_sdp_attribute
 SDP a= attribute representation. More...
 

Typedefs

typedef struct janus_sdp janus_sdp
 Janus SDP internal object representation. More...
 
typedef enum janus_sdp_mtype janus_sdp_mtype
 Helper enumeration to quickly identify m-line media types. More...
 
typedef enum janus_sdp_mdirection janus_sdp_mdirection
 Helper enumeration to quickly identify m-line directions. More...
 
typedef struct janus_sdp_mline janus_sdp_mline
 SDP m-line representation. More...
 
typedef struct janus_sdp_attribute janus_sdp_attribute
 SDP a= attribute representation. More...
 

Enumerations

enum  janus_sdp_mtype { JANUS_SDP_AUDIO, JANUS_SDP_VIDEO, JANUS_SDP_APPLICATION, JANUS_SDP_OTHER }
 Helper enumeration to quickly identify m-line media types. More...
 
enum  janus_sdp_mdirection {
  JANUS_SDP_DEFAULT, JANUS_SDP_SENDRECV, JANUS_SDP_SENDONLY, JANUS_SDP_RECVONLY,
  JANUS_SDP_INACTIVE
}
 Helper enumeration to quickly identify m-line directions. More...
 

Functions

janus_sdp_attributejanus_sdp_attribute_create (const char *name, const char *value,...) G_GNUC_PRINTF(2
 Helper method to quickly create a janus_sdp_attribute instance. More...
 
janus_sdp_attribute 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 *sdp)
 Method to serialize a janus_sdp object to an SDP string. More...
 
void janus_sdp_free (janus_sdp *sdp)
 Method to free a Janus SDP object. More...
 

Detailed Description

SDP utilities (headers)

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

Typedef Documentation

◆ janus_sdp

typedef struct janus_sdp janus_sdp

Janus SDP internal object representation.

◆ janus_sdp_attribute

SDP a= attribute representation.

◆ janus_sdp_mdirection

Helper enumeration to quickly identify m-line directions.

◆ janus_sdp_mline

SDP m-line representation.

◆ janus_sdp_mtype

Helper enumeration to quickly identify m-line media types.

Enumeration Type Documentation

◆ janus_sdp_mdirection

Helper enumeration to quickly identify m-line directions.

Enumerator
JANUS_SDP_DEFAULT 

default=sendrecv

JANUS_SDP_SENDRECV 

sendrecv

JANUS_SDP_SENDONLY 

sendonly

JANUS_SDP_RECVONLY 

recvonly

JANUS_SDP_INACTIVE 

inactive

◆ janus_sdp_mtype

Helper enumeration to quickly identify m-line media types.

Enumerator
JANUS_SDP_AUDIO 

m=audio

JANUS_SDP_VIDEO 

m=video

JANUS_SDP_APPLICATION 

m=application

JANUS_SDP_OTHER 

m=whatever (we don't care, unsupported)

Function Documentation

◆ janus_sdp_attribute_create()

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

Helper method to quickly create a janus_sdp_attribute instance.

Parameters
[in]nameName of the attribute
[in]valueValue of the attribute, as a printf compliant string (variable arguments)
Returns
A pointer to a valid janus_sdp_attribute instance, if successfull, NULL otherwise

◆ janus_sdp_attribute_destroy()

janus_sdp_attribute 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