VLC 4.0.0-dev
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 char *data, char const **out_extra)
 Attach Stream Extractors according to specified data. More...
 
static char * StreamExtractorCreateMRL (char const *base, char const *subentry)
 Create an MRL for a specific sub-entry. More...
 
static void se_Release (struct stream_extractor_private *priv)
 Release the private data associated with a stream-extractor. More...
 
static int se_AttachWrapper (struct stream_extractor_private *priv, stream_t *source)
 Create the public stream_t that wraps a stream-extractor. More...
 
static int StreamExtractorAttach (stream_t **source, char const *identifier, char const *module_name)
 
int vlc_stream_directory_Attach (stream_t **source, char const *module_name)
 
int vlc_stream_extractor_Attach (stream_t **source, char const *identifier, char const *module_name)
 
char * vlc_stream_extractor_CreateMRL (stream_directory_t *directory, char const *subentry)
 Create a relative MRL for the associated entity. More...
 

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_CleanStream (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_CleanStream()

static void se_CleanStream ( struct stream_extractor_private priv)
static

◆ 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 stream_extractor_private::module, 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 char *  data,
char const **  out_extra 
)

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, mrl_FragmentSplit(), stream_extractor_private::source, vlc_array_clear(), vlc_array_count(), vlc_array_item_at_index, VLC_EGENERIC, vlc_stream_extractor_Attach(), and VLC_SUCCESS.

Referenced by InputStreamHandleAnchor(), and vlc_stream_NewMRL().

◆ StreamExtractorAttach()

◆ StreamExtractorCreateMRL()

static char * StreamExtractorCreateMRL ( char const *  base,
char const *  subentry 
)
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_printf(), 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 
)

◆ vlc_stream_extractor_Attach()

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

◆ vlc_stream_extractor_CreateMRL()

char * vlc_stream_extractor_CreateMRL ( stream_directory_t extractor,
char const *  subentry 
)

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
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().