VLC 4.0.0-dev

If a stream can be viewed as a directory, such as when opening a compressed archive, a stream-extractor is used to get access to the entities inside said stream. More...

Collaboration diagram for Stream Extractor:

Modules

 Stream Extractor Internals
 

Data Structures

struct  stream_extractor_t
 
struct  stream_directory_t
 

Macros

#define vlc_stream_NewMRL(a, b)   vlc_stream_NewMRL(VLC_OBJECT(a), b)
 

Typedefs

typedef struct stream_extractor_t stream_extractor_t
 
typedef struct stream_directory_t stream_directory_t
 

Functions

stream_tvlc_stream_NewMRL (vlc_object_t *obj, const char *mrl)
 Create a stream for the data referred to by a Media Resource Locator (MRL). More...
 
char * vlc_stream_extractor_CreateMRL (stream_directory_t *extractor, char const *subentry)
 Create a relative MRL for the associated entity. More...
 

Attach a stream-extractor to the passed stream

These functions are used to attach a stream extractor to an already existing stream.

As hinted by their names, vlc_stream_extractor_Attach will attach an entity-extractor, whereas vlc_stream_directory_Attach will attach a stream-directory.

Parameters
[out]streama pointer-to-pointer to stream, *stream will refer to the attached stream on success, and left untouched on failure.
identifier(if present) NULL or a c-style string referring to the desired entity
module_nameNULL or an explicit stream-extractor module name
Returns
VLC_SUCCESS if a stream-extractor was successfully attached, an error-code on failure.
int vlc_stream_extractor_Attach (stream_t **source, char const *identifier, char const *module_name)
 
int vlc_stream_directory_Attach (stream_t **source, char const *module_name)
 

Detailed Description

If a stream can be viewed as a directory, such as when opening a compressed archive, a stream-extractor is used to get access to the entities inside said stream.

A stream-extractor can do one of two things;

Macro Definition Documentation

◆ vlc_stream_NewMRL

#define vlc_stream_NewMRL (   a,
 
)    vlc_stream_NewMRL(VLC_OBJECT(a), b)

Typedef Documentation

◆ stream_directory_t

◆ stream_extractor_t

Function Documentation

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

◆ vlc_stream_NewMRL()

stream_t * vlc_stream_NewMRL ( vlc_object_t obj,
const char *  mrl 
)

Create a stream for the data referred to by a Media Resource Locator (MRL).

This function will create a Stream that reads from the specified Media Resource Locator (MRL), potentially making use of Stream Extractors to access named entities within the data read from the original source.

Warning
This function is only to be used when Media Resource Locator (MRL) functionality is explicitly needed. vlc_stream_NewURL shall be used where applicable.
Parameters
objthe owner of the requested stream
mrlthe mrl for which the stream_t should be created
Returns
NULL on error, a pointer to stream_t on success.

References msg_Err, msg_Warn, stream_extractor_AttachParsed(), vlc_stream_Delete(), and vlc_stream_NewURL().