VLC 4.0.0-dev
Loading...
Searching...
No Matches

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
 

Data Structures

struct  mrl_info
 

Functions

static char * mrl_EscapeFragmentIdentifier (char const *payload)
 Escape a fragment identifier for use within an MRL.
 
static char * mrl_AppendAnchorFragment (const char *anchor, char const *payload)
 
static void mrl_info_Clean (struct mrl_info *mrli)
 
static void mrl_info_Init (struct mrl_info *mrli)
 
static int mrl_FragmentSplit (struct mrl_info *mrli, char const *payload)
 Split an MRL-fragment into identifiers.
 

Detailed Description

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

Function Documentation

◆ mrl_AppendAnchorFragment()

static char * mrl_AppendAnchorFragment ( const char *  anchor,
char const *  payload 
)
inlinestatic

◆ mrl_EscapeFragmentIdentifier()

static char * mrl_EscapeFragmentIdentifier ( 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
[in]payloadthe data to escape.
Returns
he created string on success, and NULL on error.

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

Referenced by mrl_AppendAnchorFragment(), and StreamExtractorCreateMRL().

◆ mrl_FragmentSplit()

static int mrl_FragmentSplit ( struct mrl_info mrli,
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

References mrl_info::extra, mrl_info::identifiers, strndup(), unlikely, vlc_array_append(), vlc_array_count(), VLC_EGENERIC, VLC_SUCCESS, vlc_uri_decode(), and mrl_info::volumes.

Referenced by InputStreamHandleAnchor(), and vlc_stream_NewMRL().

◆ mrl_info_Clean()

static void mrl_info_Clean ( struct mrl_info mrli)
inlinestatic

◆ mrl_info_Init()

static void mrl_info_Init ( struct mrl_info mrli)
inlinestatic