VLC  4.0.0-dev
Modules | Data Structures | Macros | Typedefs | Functions
Collaboration diagram for Stream Extractor:


 Stream Extractor Internals

Data Structures

struct  stream_extractor_t
struct  stream_directory_t


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


typedef struct stream_extractor_t stream_extractor_t
typedef struct stream_directory_t stream_directory_t


VLC_EXPORT 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...
VLC_EXPORT char * vlc_stream_extractor_CreateMRL (stream_directory_t *, 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.

[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
VLC_SUCCESS if a stream-extractor was successfully attached, an error-code on failure.
VLC_EXPORT int vlc_stream_extractor_Attach (stream_t **source, char const *identifier, char const *module_name)
VLC_EXPORT 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()

VLC_EXPORT int vlc_stream_directory_Attach ( stream_t **  source,
char const *  module_name 

◆ vlc_stream_extractor_Attach()

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

◆ vlc_stream_extractor_CreateMRL()

VLC_EXPORT char* vlc_stream_extractor_CreateMRL ( stream_directory_t ,
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.

the returned value is to be freed by the caller
extractorthe stream_directory_t for which the entity belongs
subentrythe name of the entity in question
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()

VLC_EXPORT 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.

This function is only to be used when Media Resource Locator (MRL) functionality is explicitly needed. vlc_stream_NewURL shall be used where applicable.
objthe owner of the requested stream
mrlthe mrl for which the stream_t should be created
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().