VLC  3.0.0-git
Files | Functions

Helper functions related to parsing, as well as generating, data related to the MRL-specification. More...

Collaboration diagram for MRL helpers:

Files

file  mrl_helpers.h
 

Functions

static int mrl_EscapeFragmentIdentifier (char **out, char const *payload)
 Escape a fragment identifier for use within an MRL. More...
 
static int mrl_FragmentSplit (vlc_array_t *out_items, char const **out_extra, char const *payload)
 Split an MRL-fragment into identifiers. More...
 

Detailed Description

Helper functions related to parsing, as well as generating, data related to the MRL-specification.

Function Documentation

◆ mrl_EscapeFragmentIdentifier()

static int mrl_EscapeFragmentIdentifier ( char **  out,
char const *  payload 
)
inlinestatic

Escape a fragment identifier for use within an MRL.

The function will generate a string that follows the MRL-specification regarding fragment-identifiers.

See the MRL-specification for a detailed explanation of how payload will be escaped.

Parameters
[out]out*out will refer to the created string on success, and an unspecified value on error.
[in]payloadthe data to escape.
Returns
VLC_SUCCESS on success, an error-code on failure.

< Unspecified error

< Unspecified error

< No error

References p, vlc_memstream::ptr, RFC3986_FRAGMENT, VLC_EGENERIC, vlc_memstream_close(), vlc_memstream_open(), vlc_memstream_printf(), and VLC_SUCCESS.

Referenced by StreamExtractorCreateMRL().

◆ mrl_FragmentSplit()

static int mrl_FragmentSplit ( vlc_array_t out_items,
char const **  out_extra,
char const *  payload 
)
inlinestatic

Split an MRL-fragment into identifiers.

Function used to split the fragment-data (also referred to as anchor-data) into an array containing each of the files specified.

See the MRL-specification for detailed information regarding how payload will be interpreted.

Warning
On success, the caller has ownership of the contents of *out_items which means that it is responsible for freeing the individual elements, as well as cleaning the array itself.
Parameters
[out]out_itemsstorage for a vlc_array_t that will contain the parsed identifiers on success.
[out]out_extra*out_extra will point to any remaining data (if any)
[in]payloadthe data to parse
Returns
VLC_SUCCESS on success, an error-code on failure

< No error

< Unspecified error

References vlc_memstream::error, strndup(), unlikely, vlc_array_append(), vlc_array_clear(), vlc_array_count(), vlc_array_init(), VLC_EGENERIC, VLC_SUCCESS, and vlc_uri_decode().

Referenced by stream_extractor_AttachParsed().