VLC 4.0.0-dev
Loading...
Searching...
No Matches
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#include "mrl_helpers.h"
31
33 void (*destroy)(stream_t *), size_t extra_size,
34 const char *type_name);
35void *vlc_stream_Private(stream_t *stream);
36
37/* */
39
41 input_attachment_t *attachment);
42
43/**
44 * This function creates a raw stream_t from an URL.
45 */
47 const char *);
48
49/**
50 * Probes stream filters automatically.
51 *
52 * This function automatically and repeatedly probes for applicable stream
53 * filters to append downstream of an existing stream. Any such filter will
54 * convert the stream into another stream, e.g. decompressing it or extracting
55 * the list of contained files (playlist).
56 *
57 * This function transfers ownership of the supplied stream to the following
58 * stream filter, of the first stream filter to the second stream filter, and
59 * so on. Any attempt to access the original stream filter directly is
60 * explicitly undefined.
61 *
62 * If, and only if, no filters were probed successfully, a pointer to the
63 * unchanged source stream will be returned. Otherwise, this returns a stream
64 * filter. The return value is thus guaranteed to be non-NULL.
65 *
66 * @param source input stream around which to build a filter chain
67 *
68 * @return the last, most downstream stream object.
69 *
70 * @note The return value must be freed with vlc_stream_Delete() after use.
71 * This will automatically free the whole chain and the underlying stream.
72 */
74
75/**
76 * Builds an explicit chain of stream filters.
77 *
78 * This function creates a chain of filters according to a supplied list.
79 *
80 * See also stream_FilterAutoNew(). Those two functions have identical
81 * semantics; the only difference lies in how the list of probed filters is
82 * determined (manually versus automatically).
83 *
84 * If the list is empty, or if probing each of the requested filters failed,
85 * this function will return a pointer to the supplied source stream.
86 *
87 * @param source input stream around which to build a filter chain
88 * @param list colon-separated list of stream filters (upstream first)
89 *
90 * @return The last stream (filter) in the chain.
91 * The return value is always a valid (non-NULL) stream pointer.
92 */
93stream_t *stream_FilterChainNew( stream_t *source, const char *list ) VLC_USED;
94
95/**
96 * \addtogroup stream_extractor_Internals
97 * @{
98 */
99
100/**
101 * Attach \ref stream_extractor%s according to specified data
102 *
103 * This function will parse the passed data, and try to attach a \ref
104 * stream_extractor for each specified entity as per the fragment specification
105 * associated with a \ref mrl,
106 *
107 * \warning The data in `*stream` can be modified even if this function only
108 * locates some of the entities specified in `psz_data`. It is up to
109 * the caller to free the resource referred to by `*stream`, no matter
110 * what this function returns.
111 *
112 * \warning Please see \ref vlc_stream_extractor_Attach for a function that
113 * will not modify the passed stream upon failure. \ref
114 * stream_extractor_AttachParsed shall only be used when the caller
115 * only cares about the stream on successful attachment of **all**
116 * stream-extractors referred to by `psz_data`, something which is not
117 * guaranteed.
118 *
119 * \param[out] stream a pointer-to-pointer to stream where the attached
120 * stream-extractor will be applied. `*stream` will refer
121 * to the last successful attachment.
122 * \param data the fragment data string to parse.
123 * \param[out] out_extra `*out_extra` will point to any additional data
124 * in `psz_data` that does not specify an entity (if any).
125 * \return VLC_SUCCESS on success, an error-code on failure
126 **/
127int stream_extractor_AttachParsed( stream_t** stream, const struct mrl_info * );
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 struct mrl_info *)
Attach Stream Extractors according to specified data.
Definition stream_extractor.c:388
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:283
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:138
Definition vlc_input.h:169
Main structure representing an input thread.
Definition input_internal.h:43
Definition mrl_helpers.h:123
stream_t definition
Definition vlc_stream.h:135
VLC object common members.
Definition vlc_objects.h:53
This file is a collection of common definitions and types.
Byte streams and byte stream filter modules interface.