VLC  4.0.0-dev
Collaboration diagram for Session Description Protocol:

Files

file  sdp.h
 Session Description Protocol (SDP)
 

Data Structures

struct  vlc_sdp_attr
 SDP attribute. More...
 
struct  vlc_sdp_conn
 SDP connection address. More...
 
struct  vlc_sdp_media
 SDP media. More...
 
struct  vlc_sdp
 SDP session descriptor. More...
 

Functions

struct vlc_sdpvlc_sdp_parse (const char *str, size_t length)
 Parses an SDP session descriptor. More...
 
void vlc_sdp_free (struct vlc_sdp *sdp)
 Destroys a parsed SDP session descriptor. More...
 
const struct vlc_sdp_attrvlc_sdp_attr_first_by_name (struct vlc_sdp_attr *const *ap, const char *name)
 
static const struct vlc_sdp_attrvlc_sdp_media_attr_get (const struct vlc_sdp_media *media, const char *name)
 Gets a media attribute by name. More...
 
static bool vlc_sdp_media_attr_present (const struct vlc_sdp_media *media, const char *name)
 Checks if a median attribute is present. More...
 
static const char * vlc_sdp_media_attr_value (const struct vlc_sdp_media *media, const char *name)
 Returns a media attribute value. More...
 
static const struct vlc_sdp_connvlc_sdp_media_conn (const struct vlc_sdp_media *media)
 Returns the media connection address list. More...
 
static const struct vlc_sdp_attrvlc_sdp_attr_get (const struct vlc_sdp *sdp, const char *name)
 Gets a session attribute by name. More...
 
static bool vlc_sdp_attr_present (const struct vlc_sdp *sdp, const char *name)
 Checks if a session attribute is present. More...
 
static const char * vlc_sdp_attr_value (const struct vlc_sdp *sdp, const char *name)
 Returns a session attribute value. More...
 

Detailed Description

Function Documentation

◆ vlc_sdp_attr_first_by_name()

const struct vlc_sdp_attr* vlc_sdp_attr_first_by_name ( struct vlc_sdp_attr *const *  ap,
const char *  name 
)

◆ vlc_sdp_attr_get()

static const struct vlc_sdp_attr* vlc_sdp_attr_get ( const struct vlc_sdp sdp,
const char *  name 
)
inlinestatic

Gets a session attribute by name.

Parameters
sdpSession descriptor.
nameAttribute name.
Returns
the first attribute with the specified name or NULL if not found.

References vlc_sdp::attrs, name, and vlc_sdp_attr_first_by_name().

Referenced by vlc_sdp_attr_present(), and vlc_sdp_attr_value().

◆ vlc_sdp_attr_present()

static bool vlc_sdp_attr_present ( const struct vlc_sdp sdp,
const char *  name 
)
inlinestatic

Checks if a session attribute is present.

Parameters
sdpSession descriptor.
nameAttribute name.
Return values
trueif present
falseit absent

References name, and vlc_sdp_attr_get().

◆ vlc_sdp_attr_value()

static const char* vlc_sdp_attr_value ( const struct vlc_sdp sdp,
const char *  name 
)
inlinestatic

Returns a session attribute value.

Parameters
sdpSession descriptor.
nameAttribute name.
Note
This function cannot distinguish the cases of a missing attribute and of an attribute without a value. Use vlc_sdp_attr_present() to check for value-less attributes.
Returns
Nul-terminated attribute value, or NULL if none.

References name, vlc_sdp_attr::value, and vlc_sdp_attr_get().

Referenced by OpenSDP().

◆ vlc_sdp_free()

void vlc_sdp_free ( struct vlc_sdp sdp)

◆ vlc_sdp_media_attr_get()

static const struct vlc_sdp_attr* vlc_sdp_media_attr_get ( const struct vlc_sdp_media media,
const char *  name 
)
inlinestatic

Gets a media attribute by name.

Parameters
mediaSession media descriptor.
nameSession attribute name.
Note
This function does not look for session attributes, as this is not always appropriate. To fallback to session attributes, call vlc_sdp_attr_get() explicitly.
Returns
the first attribute with the specified name or NULL if not found.

References vlc_sdp_media::attrs, name, and vlc_sdp_attr_first_by_name().

Referenced by vlc_sdp_media_attr_present(), and vlc_sdp_media_attr_value().

◆ vlc_sdp_media_attr_present()

static bool vlc_sdp_media_attr_present ( const struct vlc_sdp_media media,
const char *  name 
)
inlinestatic

Checks if a median attribute is present.

Parameters
mediaMedia descriptor.
nameAttribute name.
Return values
trueif present
falseit absent

References name, and vlc_sdp_media_attr_get().

Referenced by OpenSDP().

◆ vlc_sdp_media_attr_value()

static const char* vlc_sdp_media_attr_value ( const struct vlc_sdp_media media,
const char *  name 
)
inlinestatic

Returns a media attribute value.

Parameters
mediaMedia descriptor.
nameAttribute name.
Note
This function cannot distinguish the cases of a missing attribute and of an attribute without a value. Use vlc_sdp_media_attr_present() to check for value-less attributes.
Returns
Nul-terminated attribute value, or NULL if none.

References name, vlc_sdp_attr::value, and vlc_sdp_media_attr_get().

Referenced by OpenSDP().

◆ vlc_sdp_media_conn()

static const struct vlc_sdp_conn* vlc_sdp_media_conn ( const struct vlc_sdp_media media)
inlinestatic

Returns the media connection address list.

References vlc_sdp::conn, vlc_sdp_media::conns, and vlc_sdp_media::session.

◆ vlc_sdp_parse()

struct vlc_sdp* vlc_sdp_parse ( const char *  str,
size_t  length 
)

Parses an SDP session descriptor.

Parameters
strstart address of the descriptor
lengthbytes length of the descriptor
Returns
a parsed SDP or NULL on error (errno is set)

References vlc_sdp_media::attrs, vlc_sdp::attrs, vlc_sdp::conn, vlc_sdp_media::conns, vlc_sdp::info, vlc_sdp::media, vlc_sdp::name, vlc_sdp_attr::next, vlc_sdp_conn::next, vlc_sdp_media::next, strndup(), unlikely, vlc_sdp_attr_parse(), vlc_sdp_conn_parse(), vlc_sdp_free(), vlc_sdp_getline(), and vlc_sdp_media_parse().

Referenced by OpenSDP().