VLC 4.0.0-dev
Loading...
Searching...
No Matches
Collaboration diagram for Stream Extractor Internals:

Files

file  stream_extractor.c
 

Data Structures

struct  stream_extractor_private
 

Functions

int stream_extractor_AttachParsed (stream_t **stream, const struct mrl_info *)
 Attach Stream Extractors according to specified data.
 
static char * StreamExtractorCreateMRL (char const *base, char const *subentry, char const **volumes, size_t volumes_count)
 Create an MRL for a specific sub-entry.
 
static void se_Release (struct stream_extractor_private *priv)
 Release the private data associated with a stream-extractor.
 
static int se_AttachWrapper (struct stream_extractor_private *priv, stream_t *source)
 Create the public stream_t that wraps a stream-extractor.
 
static int StreamExtractorAttach (stream_t **source, char const *identifier, char const *module_name, const char **volumes, size_t volumes_count)
 
int vlc_stream_directory_Attach (stream_t **source, char const *module_name, const char **volumes, size_t volumes_count)
 
int vlc_stream_extractor_Attach (stream_t **source, char const *identifier, char const *module_name, const char **volumes, size_t volumes_count)
 
char * vlc_stream_extractor_CreateMRL (stream_directory_t *directory, char const *subentry, char const **volumes, size_t volumes_count)
 Create a relative MRL for the associated entity.
 

Callbacks to forward work to the underlying stream-extractor

static void se_StreamDelete (stream_t *stream)
 
static ssize_t se_StreamRead (stream_t *stream, void *buf, size_t len)
 
static block_tse_StreamBlock (stream_t *stream, bool *restrict eof)
 
static int se_StreamSeek (stream_t *stream, uint64_t offset)
 
static int se_ReadDir (stream_t *stream, input_item_node_t *node)
 
static int se_StreamControl (stream_t *stream, int req, va_list args)
 
static int se_DirControl (stream_t *stream, int req, va_list args)
 

stream-extractor resource handlers

static int se_InitStream (struct stream_extractor_private *priv, stream_t *s)
 
static void se_CleanStreamExtractor (struct stream_extractor_private *priv)
 
static void se_CleanStreamDirectory (struct stream_extractor_private *priv)
 
static int se_InitDirectory (struct stream_extractor_private *priv, stream_t *s)
 

Detailed Description

Function Documentation

◆ se_AttachWrapper()

static int se_AttachWrapper ( struct stream_extractor_private priv,
stream_t source 
)
static

Create the public stream_t that wraps a stream-extractor.

This initializes the relevant data-members of the public stream_t which is used to read from the underlying stream-extractor.

Parameters
privthe private section of the stream_extractor_t
sourcethe source stream which the stream_extractor_t should will read from
Returns
VLC_SUCCESS on success, an error-code on failure.

References stream_t::p_input_item, stream_t::p_sys, stream_extractor_private::pf_init, se_StreamDelete(), stream_extractor_private::source, stream_CommonDelete(), stream_FilterChainNew(), unlikely, VLC_EGENERIC, VLC_ENOMEM, vlc_object_parent, vlc_stream_CommonNew(), VLC_SUCCESS, and stream_extractor_private::wrapper.

Referenced by StreamExtractorAttach().

◆ se_CleanStreamDirectory()

static void se_CleanStreamDirectory ( struct stream_extractor_private priv)
static

◆ se_CleanStreamExtractor()

◆ se_DirControl()

static int se_DirControl ( stream_t stream,
int  req,
va_list  args 
)
static

References VLC_EGENERIC.

Referenced by se_InitDirectory().

◆ se_InitDirectory()

◆ se_InitStream()

◆ se_ReadDir()

static int se_ReadDir ( stream_t stream,
input_item_node_t node 
)
static

◆ se_Release()

static void se_Release ( struct stream_extractor_private priv)
static

Release the private data associated with a stream-extractor.

Parameters
privpointer to the private section

References module_unneed, stream_extractor_private::object, stream_extractor_private::pf_clean, stream_extractor_private::source, vlc_object_delete, and vlc_stream_Delete().

Referenced by se_StreamDelete(), and StreamExtractorAttach().

◆ se_StreamBlock()

static block_t * se_StreamBlock ( stream_t stream,
bool *restrict  eof 
)
static

◆ se_StreamControl()

static int se_StreamControl ( stream_t stream,
int  req,
va_list  args 
)
static

◆ se_StreamDelete()

static void se_StreamDelete ( stream_t stream)
static

References se_Release(), and vlc_memstream::stream.

Referenced by se_AttachWrapper().

◆ se_StreamRead()

static ssize_t se_StreamRead ( stream_t stream,
void *  buf,
size_t  len 
)
static

◆ se_StreamSeek()

static int se_StreamSeek ( stream_t stream,
uint64_t  offset 
)
static

◆ stream_extractor_AttachParsed()

int stream_extractor_AttachParsed ( stream_t **  stream,
const struct mrl_info mrli 
)

Attach Stream Extractors according to specified data.

This function will parse the passed data, and try to attach a Stream Extractor for each specified entity as per the fragment specification associated with a Media Resource Locator (MRL),

Warning
The data in *stream can be modified even if this function only locates some of the entities specified in psz_data. It is up to the caller to free the resource referred to by *stream, no matter what this function returns.
Please see vlc_stream_extractor_Attach for a function that will not modify the passed stream upon failure. stream_extractor_AttachParsed shall only be used when the caller only cares about the stream on successful attachment of all stream-extractors referred to by psz_data, something which is not guaranteed.
Parameters
[out]streama pointer-to-pointer to stream where the attached stream-extractor will be applied. *stream will refer to the last successful attachment.
datathe fragment data string to parse.
[out]out_extra*out_extra will point to any additional data in psz_data that does not specify an entity (if any).
Returns
VLC_SUCCESS on success, an error-code on failure

References count, vlc_array_t::i_count, mrl_info::identifiers, vlc_array_t::pp_elems, stream_extractor_private::source, vlc_array_count(), vlc_array_item_at_index, VLC_EGENERIC, vlc_stream_extractor_Attach(), VLC_SUCCESS, and mrl_info::volumes.

Referenced by InputStreamHandleAnchor(), and vlc_stream_NewMRL().

◆ StreamExtractorAttach()

◆ StreamExtractorCreateMRL()

static char * StreamExtractorCreateMRL ( char const *  base,
char const *  subentry,
char const **  volumes,
size_t  volumes_count 
)
static

Create an MRL for a specific sub-entry.

This internal function is used to create an MRL that refers to subentry within base, see MRL helpers for further information.

References mrl_EscapeFragmentIdentifier(), vlc_memstream::ptr, vlc_memstream_close(), vlc_memstream_open(), vlc_memstream_putc(), and vlc_memstream_puts().

Referenced by se_InitStream(), and vlc_stream_extractor_CreateMRL().

◆ vlc_stream_directory_Attach()

int vlc_stream_directory_Attach ( stream_t **  source,
char const *  module_name,
const char **  volumes,
size_t  volumes_count 
)

◆ vlc_stream_extractor_Attach()

int vlc_stream_extractor_Attach ( stream_t **  source,
char const *  identifier,
char const *  module_name,
const char **  volumes,
size_t  volumes_count 
)

◆ vlc_stream_extractor_CreateMRL()

char * vlc_stream_extractor_CreateMRL ( stream_directory_t extractor,
char const *  subentry,
char const **  volumes,
size_t  volumes_count 
)

Create a relative MRL for the associated entity.

This function shall be used by stream_directory_t's in order to generate an MRL that refers to an entity within the stream. Normally this function will only be invoked within pf_readdir in order to get the virtual path of the listed items.

Warning
The returned value is to be freed by the caller
Parameters
extractorthe stream_directory_t for which the entity belongs
subentrythe name of the entity in question
volumesmedia additional volumes MRLs
volumes_countnumber of additional volumes
Returns
a pointer to the resulting MRL on success, NULL on failure

References stream_extractor_private::directory, stream_t::psz_url, stream_directory_t::source, and StreamExtractorCreateMRL().