VLC 4.0.0-dev
stream.h
Go to the documentation of this file.
1/*****************************************************************************
2 * stream.h: Input stream functions
3 *****************************************************************************
4 * Copyright (C) 1998-2008 VLC authors and VideoLAN
5 * Copyright (C) 2008 Laurent Aimar
6 *
7 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
23
24#ifndef LIBVLC_INPUT_STREAM_H
25#define LIBVLC_INPUT_STREAM_H 1
26
27#include <vlc_common.h>
28#include <vlc_stream.h>
29#include "input_internal.h"
30
32 void (*destroy)(stream_t *), size_t extra_size,
33 const char *type_name);
34void *vlc_stream_Private(stream_t *stream);
35
36/* */
38
40 input_attachment_t *attachment);
41
42/**
43 * This function creates a raw stream_t from an URL.
44 */
46 const char *);
47
48/**
49 * Probes stream filters automatically.
50 *
51 * This function automatically and repeatedly probes for applicable stream
52 * filters to append downstream of an existing stream. Any such filter will
53 * convert the stream into another stream, e.g. decompressing it or extracting
54 * the list of contained files (playlist).
55 *
56 * This function transfers ownership of the supplied stream to the following
57 * stream filter, of the first stream filter to the second stream filter, and
58 * so on. Any attempt to access the original stream filter directly is
59 * explicitly undefined.
60 *
61 * If, and only if, no filters were probed successfully, a pointer to the
62 * unchanged source stream will be returned. Otherwise, this returns a stream
63 * filter. The return value is thus guaranteed to be non-NULL.
64 *
65 * @param source input stream around which to build a filter chain
66 *
67 * @return the last, most downstream stream object.
68 *
69 * @note The return value must be freed with vlc_stream_Delete() after use.
70 * This will automatically free the whole chain and the underlying stream.
71 */
73
74/**
75 * Builds an explicit chain of stream filters.
76 *
77 * This function creates a chain of filters according to a supplied list.
78 *
79 * See also stream_FilterAutoNew(). Those two functions have identical
80 * semantics; the only difference lies in how the list of probed filters is
81 * determined (manually versus automatically).
82 *
83 * If the list is empty, or if probing each of the requested filters failed,
84 * this function will return a pointer to the supplied source stream.
85 *
86 * @param source input stream around which to build a filter chain
87 * @param list colon-separated list of stream filters (upstream first)
88 *
89 * @return The last stream (filter) in the chain.
90 * The return value is always a valid (non-NULL) stream pointer.
91 */
92stream_t *stream_FilterChainNew( stream_t *source, const char *list ) VLC_USED;
93
94/**
95 * \addtogroup stream_extractor_Internals
96 * @{
97 */
98
99/**
100 * Attach \ref stream_extractor%s according to specified data
101 *
102 * This function will parse the passed data, and try to attach a \ref
103 * stream_extractor for each specified entity as per the fragment specification
104 * associated with a \ref mrl,
105 *
106 * \warning The data in `*stream` can be modified even if this function only
107 * locates some of the entities specified in `psz_data`. It is up to
108 * the caller to free the resource referred to by `*stream`, no matter
109 * what this function returns.
110 *
111 * \warning Please see \ref vlc_stream_extractor_Attach for a function that
112 * will not modify the passed stream upon failure. \ref
113 * stream_extractor_AttachParsed shall only be used when the caller
114 * only cares about the stream on successful attachment of **all**
115 * stream-extractors referred to by `psz_data`, something which is not
116 * guaranteed.
117 *
118 * \param[out] stream a pointer-to-pointer to stream where the attached
119 * stream-extractor will be applied. `*stream` will refer
120 * to the last successful attachment.
121 * \param data the fragment data string to parse.
122 * \param[out] out_extra `*out_extra` will point to any additional data
123 * in `psz_data` that does not specify an entity (if any).
124 * \return VLC_SUCCESS on success, an error-code on failure
125 **/
126int stream_extractor_AttachParsed( stream_t** stream, const char* data,
127 char const** out_extra );
128
129/**
130 * @}
131 */
132
133#endif
struct vlc_param ** list
Definition: core.c:402
#define VLC_USED
Definition: fourcc_gen.c:32
int stream_extractor_AttachParsed(stream_t **stream, const char *data, char const **out_extra)
Attach Stream Extractors according to specified data.
Definition: stream_extractor.c:343
stream_t * vlc_stream_AttachmentNew(vlc_object_t *p_this, input_attachment_t *attachment)
Definition: stream_memory.c:90
stream_t * stream_AccessNew(vlc_object_t *, input_thread_t *, es_out_t *, bool, const char *)
This function creates a raw stream_t from an URL.
Definition: access.c:284
stream_t * stream_FilterAutoNew(stream_t *source)
Probes stream filters automatically.
Definition: stream_filter.c:95
stream_t * stream_FilterChainNew(stream_t *source, const char *list)
Builds an explicit chain of stream filters.
Definition: stream_filter.c:111
void * vlc_stream_Private(stream_t *stream)
Definition: stream.c:113
void stream_CommonDelete(stream_t *s)
Definition: stream.c:124
stream_t * vlc_stream_CustomNew(vlc_object_t *parent, void(*destroy)(stream_t *), size_t extra_size, const char *type_name)
Allocates a VLC stream object.
Definition: stream.c:69
Definition: vlc_es_out.h:148
Definition: vlc_input.h:161
Main structure representing an input thread.
Definition: input_internal.h:49
stream_t definition
Definition: vlc_stream.h:133
VLC object common members.
Definition: vlc_objects.h:45
This file is a collection of common definitions and types.
Byte streams and byte stream filter modules interface.