VLC  4.0.0-dev
vlc_stream.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * vlc_stream.h: Stream (between access and demux) descriptor and methods
3  *****************************************************************************
4  * Copyright (C) 1999-2004 VLC authors and VideoLAN
5  *
6  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
7  *
8  * This program is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation; either version 2.1 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this program; if not, write to the Free Software Foundation,
20  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21  *****************************************************************************/
22 
23 #ifndef VLC_STREAM_H
24 #define VLC_STREAM_H 1
25 
26 #include <vlc_block.h>
27 
28 # ifdef __cplusplus
29 extern "C" {
30 # endif
31 
32 /**
33  * \defgroup stream Stream
34  * \ingroup input
35  * Buffered input byte streams
36  * @{
37  * \file
38  * Byte streams and byte stream filter modules interface
39  */
40 
41 /**
42  * stream_t definition
43  */
44 
45 struct stream_t
46 {
47  struct vlc_object_t obj;
48 
49  char *psz_name;
50  char *psz_url; /**< Full URL or MRL (can be NULL) */
51  const char *psz_location; /**< Location (URL with the scheme stripped) */
52  char *psz_filepath; /**< Local file path (if applicable) */
53  bool b_preparsing; /**< True if this access is used to preparse */
54  input_item_t *p_input_item;/**< Input item (can be NULL) */
55 
56  /**
57  * Input stream
58  *
59  * Depending on the module capability:
60  * - "stream filter" or "demux": input byte stream (not NULL)
61  * - "access": a NULL pointer
62  * - "demux_filter": upstream demuxer or demux filter
63  */
64  stream_t *s;
65 
66  /* es output */
67  es_out_t *out; /* our p_es_out */
68 
69  /**
70  * Read data.
71  *
72  * Callback to read data from the stream into a caller-supplied buffer.
73  *
74  * This may be NULL if the stream is actually a directory rather than a
75  * byte stream, or if \ref stream_t.pf_block is non-NULL.
76  *
77  * \param buf buffer to read data into
78  * \param len buffer length (in bytes)
79  *
80  * \retval -1 no data available yet
81  * \retval 0 end of stream (incl. fatal error)
82  * \retval positive number of bytes read (no more than len)
83  */
84  ssize_t (*pf_read)(stream_t *, void *buf, size_t len);
85 
86  /**
87  * Read data block.
88  *
89  * Callback to read a block of data. The data is read into a block of
90  * memory allocated by the stream. For some streams, data can be read more
91  * efficiently in block of a certain size, and/or using a custom allocator
92  * for buffers. In such case, this callback should be provided instead of
93  * \ref stream_t.pf_read; otherwise, this should be NULL.
94  *
95  * \param eof storage space for end-of-stream flag [OUT]
96  * (*eof is always false when invoking pf_block(); pf_block() should set
97  * *eof to true if it detects the end of the stream)
98  *
99  * \return a data block,
100  * NULL if no data available yet, on error and at end-of-stream
101  */
102  block_t *(*pf_block)(stream_t *, bool *eof);
103 
104  /**
105  * Read directory.
106  *
107  * Callback to fill an item node from a directory
108  * (see doc/browsing.txt for details).
109  *
110  * NULL if the stream is not a directory.
111  */
113 
114  int (*pf_demux)(stream_t *);
115 
116  /**
117  * Seek.
118  *
119  * Callback to set the stream pointer (in bytes from start).
120  *
121  * May be NULL if seeking is not supported.
122  */
123  int (*pf_seek)(stream_t *, uint64_t);
124 
125  /**
126  * Stream control.
127  *
128  * Cannot be NULL.
129  *
130  * \see stream_query_e
131  */
132  int (*pf_control)(stream_t *, int i_query, va_list);
133 
134  /**
135  * Private data pointer
136  */
137  void *p_sys;
138 };
139 
140 /**
141  * Possible commands to send to vlc_stream_Control() and vlc_stream_vaControl()
142  */
143 enum stream_query_e
144 {
145  /* capabilities */
146  STREAM_CAN_SEEK, /**< arg1= bool * res=cannot fail*/
147  STREAM_CAN_FASTSEEK, /**< arg1= bool * res=cannot fail*/
148  STREAM_CAN_PAUSE, /**< arg1= bool * res=cannot fail*/
149  STREAM_CAN_CONTROL_PACE, /**< arg1= bool * res=cannot fail*/
150  /* */
151  STREAM_GET_SIZE=6, /**< arg1= uint64_t * res=can fail */
152 
153  /* */
154  STREAM_GET_PTS_DELAY = 0x101,/**< arg1= vlc_tick_t* res=cannot fail */
155  STREAM_GET_TITLE_INFO, /**< arg1=input_title_t*** arg2=int* res=can fail */
156  STREAM_GET_TITLE, /**< arg1=unsigned * res=can fail */
157  STREAM_GET_SEEKPOINT, /**< arg1=unsigned * res=can fail */
158  STREAM_GET_META, /**< arg1= vlc_meta_t * res=can fail */
159  STREAM_GET_CONTENT_TYPE, /**< arg1= char ** res=can fail */
160  STREAM_GET_SIGNAL, /**< arg1=double *pf_quality, arg2=double *pf_strength res=can fail */
161  STREAM_GET_TAGS, /**< arg1=const block_t ** res=can fail */
162  STREAM_GET_TYPE, /**< arg1=int* res=can fail */
163 
164  STREAM_SET_PAUSE_STATE = 0x200, /**< arg1= bool res=can fail */
165  STREAM_SET_TITLE, /**< arg1= int res=can fail */
166  STREAM_SET_SEEKPOINT, /**< arg1= int res=can fail */
167 
168  /* XXX only data read through vlc_stream_Read/Block will be recorded */
169  STREAM_SET_RECORD_STATE, /**< arg1=bool, arg2=const char *psz_ext (if arg1 is true) res=can fail */
170 
171  STREAM_SET_PRIVATE_ID_STATE = 0x1000, /* arg1= int i_private_data, bool b_selected res=can fail */
172  STREAM_SET_PRIVATE_ID_CA, /* arg1= void * */
173  STREAM_GET_PRIVATE_ID_STATE, /* arg1=int i_private_data arg2=bool * res=can fail */
174 };
175 
176 /**
177  * Reads data from a byte stream.
178  *
179  * This function always waits for the requested number of bytes, unless a fatal
180  * error is encountered or the end-of-stream is reached first.
181  *
182  * If the buffer is NULL, data is skipped instead of read. This is effectively
183  * a relative forward seek, but it works even on non-seekable streams.
184  *
185  * \param buf start of buffer to read data into [OUT]
186  * \param len number of bytes to read
187  * \return the number of bytes read or a negative value on error.
188  */
189 VLC_API ssize_t vlc_stream_Read(stream_t *, void *buf, size_t len) VLC_USED;
190 
191 /**
192  * Reads partial data from a byte stream.
193  *
194  * This function waits until some data is available for reading from the
195  * stream, a fatal error is encountered or the end-of-stream is reached.
196  *
197  * Unlike vlc_stream_Read(), this function does not wait for the full requested
198  * bytes count. It can return a short count even before the end of the stream
199  * and in the absence of any error.
200  *
201  * \param buf start of buffer to read data into [OUT]
202  * \param len buffer size (maximum number of bytes to read)
203  * \return the number of bytes read or a negative value on error.
204  */
205 VLC_API ssize_t vlc_stream_ReadPartial(stream_t *, void *buf, size_t len)
206 VLC_USED;
207 
208 /**
209  * Peeks at data from a byte stream.
210  *
211  * This function buffers for the requested number of bytes, waiting if
212  * necessary. Then it stores a pointer to the buffer. Unlike vlc_stream_Read()
213  * or vlc_stream_Block(), this function does not modify the stream read offset.
214  *
215  * \note
216  * The buffer remains valid until the next read/peek or seek operation on the
217  * same stream. In case of error, the buffer address is undefined.
218  *
219  * \param bufp storage space for the buffer address [OUT]
220  * \param len number of bytes to peek
221  * \return the number of bytes actually available (shorter than requested if
222  * the end-of-stream is reached), or a negative value on error.
223  */
224 VLC_API ssize_t vlc_stream_Peek(stream_t *, const uint8_t **, size_t) VLC_USED;
225 
226 /**
227  * Reads a data block from a byte stream.
228  *
229  * This function dequeues the next block of data from the byte stream. The
230  * byte stream back-end decides on the size of the block; the caller cannot
231  * make any assumption about it.
232  *
233  * The function might also return NULL spuriously - this does not necessarily
234  * imply that the stream is ended nor that it has encountered a nonrecoverable
235  * error.
236  *
237  * This function should be used instead of vlc_stream_Read() or
238  * vlc_stream_Peek() when the caller can handle reads of any size.
239  *
240  * \return either a data block or NULL
241  */
243 
244 /**
245  * Tells the current stream position.
246  *
247  * This function tells the current read offset (in bytes) from the start of
248  * the start of the stream.
249  * @note The read offset may be larger than the stream size, either because of
250  * a seek past the end, or because the stream shrank asynchronously.
251  *
252  * @return the byte offset from the beginning of the stream (cannot fail)
253  */
254 VLC_API uint64_t vlc_stream_Tell(const stream_t *) VLC_USED;
255 
256 /**
257  * Checks for end of stream.
258  *
259  * Checks if the last attempt to reads data from the stream encountered the
260  * end of stream before the attempt could be fully satisfied.
261  * The value is initially false, and is reset to false by vlc_stream_Seek().
262  *
263  * \note The function can return false even though the current stream position
264  * is equal to the stream size. It will return true after the following attempt
265  * to read more than zero bytes.
266  *
267  * \note It might be possible to read after the end of the stream.
268  * It implies the size of the stream increased asynchronously in the mean time.
269  * Streams of most types cannot trigger such a case,
270  * but regular local files notably can.
271  *
272  * \note In principles, the stream size should match the stream offset when
273  * the end-of-stream is reached. But that rule is not enforced; it is entirely
274  * dependent on the underlying implementation of the stream.
275  */
277 
278 /**
279  * Sets the current stream position.
280  *
281  * This function changes the read offset within a stream, if the stream
282  * supports seeking. In case of error, the read offset is not changed.
283  *
284  * @note It is possible (but not useful) to seek past the end of a stream.
285  *
286  * @param offset byte offset from the beginning of the stream
287  * @return zero on success, a negative value on error
288  */
289 VLC_API int vlc_stream_Seek(stream_t *, uint64_t offset) VLC_USED;
290 
291 VLC_API int vlc_stream_vaControl(stream_t *s, int query, va_list args);
292 
293 static inline int vlc_stream_Control(stream_t *s, int query, ...)
294 {
295  va_list ap;
296  int ret;
297 
298  va_start(ap, query);
299  ret = vlc_stream_vaControl(s, query, ap);
300  va_end(ap);
301  return ret;
302 }
303 
306 
307 /**
308  * Reads a directory.
309  *
310  * This function fills an input item node with any and all the items within
311  * a directory. The behaviour is undefined if the stream is not a directory.
312  *
313  * \param s directory object to read from
314  * \param node node to store the items into
315  * \return VLC_SUCCESS on success
316  */
318 
319 /**
320  * Closes a byte stream.
321  * \param s byte stream to close
322  */
324 
326 
327 /**
328  * Get the size of the stream.
329  */
330 VLC_USED static inline int vlc_stream_GetSize( stream_t *s, uint64_t *size )
331 {
332  return vlc_stream_Control( s, STREAM_GET_SIZE, size );
333 }
334 
335 static inline int64_t stream_Size( stream_t *s )
336 {
337  uint64_t i_pos;
338 
339  if( vlc_stream_GetSize( s, &i_pos ) )
340  return 0;
341  if( i_pos >> 62 )
342  return (int64_t)1 << 62;
343  return i_pos;
344 }
345 
346 VLC_USED
347 static inline bool stream_HasExtension( stream_t *s, const char *extension )
348 {
349  const char *name = (s->psz_filepath != NULL) ? s->psz_filepath
350  : s->psz_url;
351  const char *ext = strrchr( name, '.' );
352  return ext != NULL && !strcasecmp( ext, extension );
353 }
354 
355 /**
356  * Get the Content-Type of a stream, or NULL if unknown.
357  * Result must be free()'d.
358  */
359 static inline char *stream_ContentType( stream_t *s )
360 {
361  char *res;
363  return NULL;
364  return res;
365 }
366 
367 /**
368  * Get the mime-type of a stream
369  *
370  * \warning the returned resource is to be freed by the caller
371  * \return the mime-type, or `NULL` if unknown
372  **/
373 VLC_USED
374 static inline char *stream_MimeType( stream_t *s )
375 {
376  char* mime_type = stream_ContentType( s );
377 
378  if( mime_type ) /* strip parameters */
379  mime_type[strcspn( mime_type, " ;" )] = '\0';
380 
381  return mime_type;
382 }
383 
384 /**
385  * Checks for a MIME type.
386  *
387  * Checks if the stream has a specific MIME type.
388  */
389 VLC_USED
390 static inline bool stream_IsMimeType(stream_t *s, const char *type)
391 {
392  char *mime = stream_MimeType(s);
393  if (mime == NULL)
394  return false;
395 
396  bool ok = !strcasecmp(mime, type);
397  free(mime);
398  return ok;
399 }
400 
401 /**
402  * Create a stream from a memory buffer.
403  *
404  * \param obj parent VLC object
405  * \param base start address of the memory buffer to read from
406  * \param size size in bytes of the memory buffer
407  * \param preserve if false, free(base) will be called when the stream is
408  * destroyed; if true, the memory buffer is preserved
409  */
411  size_t size, bool preserve) VLC_USED;
412 #define vlc_stream_MemoryNew(a, b, c, d) \
413  vlc_stream_MemoryNew(VLC_OBJECT(a), b, c, d)
414 
415 /**
416  * Create a stream_t reading from a URL.
417  * You must delete it using vlc_stream_Delete.
418  */
420 VLC_USED;
421 #define vlc_stream_NewURL(a, b) vlc_stream_NewURL(VLC_OBJECT(a), b)
422 
423 /**
424  * \defgroup stream_fifo FIFO stream
425  * In-memory anonymous pipe
426  @{
427  */
428 
429 typedef struct vlc_stream_fifo vlc_stream_fifo_t;
430 
431 /**
432  * Creates a FIFO stream.
433  *
434  * Creates a non-seekable byte stream object whose byte stream is generated
435  * by another thread in the process. This is the LibVLC equivalent of an
436  * anonymous pipe/FIFO.
437  *
438  * On the reader side, the normal stream functions are used,
439  * e.g. vlc_stream_Read() and vlc_stream_Delete().
440  *
441  * The created stream object is automatically destroyed when both the reader
442  * and the writer sides have been closed, with vlc_stream_Delete() and
443  * vlc_stream_fifo_Close() respectively.
444  *
445  * \param parent parent VLC object for the stream
446  * \param reader location to store read side stream pointer [OUT]
447  * \return a FIFO stream object or NULL on memory error.
448  */
450  stream_t **reader);
451 
452 /**
453  * Writes a block to a FIFO stream.
454  *
455  * \param s FIFO stream created by vlc_stream_fifo_New()
456  * \param block data block to write to the stream
457  * \return 0 on success. -1 if the reader end has already been closed
458  * (errno is then set to EPIPE, and the block is deleted).
459  *
460  * \bug No congestion control is performed. If the reader end is not keeping
461  * up with the writer end, buffers will accumulate in memory.
462  */
464 
465 /**
466  * Writes data to a FIFO stream.
467  *
468  * This is a convenience helper for vlc_stream_fifo_Queue().
469  * \param s FIFO stream created by vlc_stream_fifo_New()
470  * \param buf start address of data to write
471  * \param len length of data to write in bytes
472  * \return len on success, or -1 on error (errno is set accordingly)
473  */
474 VLC_API ssize_t vlc_stream_fifo_Write(vlc_stream_fifo_t *s, const void *buf,
475  size_t len);
476 
477 /**
478  * Terminates a FIFO stream.
479  *
480  * Marks the end of the FIFO stream and releases any underlying resources.
481  * \param s FIFO stream created by vlc_stream_fifo_New()
482  */
484 
485 /**
486  * @}
487  */
488 
489 /**
490  * Try to add a stream filter to an open stream.
491  * @return New stream to use, or NULL if the filter could not be added.
492  **/
493 VLC_API stream_t* vlc_stream_FilterNew( stream_t *p_source, const char *psz_stream_filter );
494 
495 /**
496  * @}
497  */
498 
499 # ifdef __cplusplus
500 }
501 # endif
502 
503 #endif
STREAM_CAN_PAUSE
@ STREAM_CAN_PAUSE
arg1= bool * res=cannot fail
Definition: vlc_stream.h:149
vlc_stream_vaControl
VLC_EXPORT int vlc_stream_vaControl(stream_t *s, int query, va_list args)
Use to control the "stream_t *".
Definition: stream.c:687
vlc_stream_Tell
VLC_EXPORT uint64_t vlc_stream_Tell(const stream_t *)
Tells the current stream position.
Definition: stream.c:611
vlc_stream_FilterNew
VLC_EXPORT stream_t * vlc_stream_FilterNew(stream_t *p_source, const char *psz_stream_filter)
Try to add a stream filter to an open stream.
Definition: stream_filter.c:50
STREAM_GET_TITLE
@ STREAM_GET_TITLE
arg1=unsigned * res=can fail
Definition: vlc_stream.h:157
VLC_API
#define VLC_API
Definition: fourcc_gen.c:31
vlc_stream_fifo_Write
VLC_EXPORT ssize_t vlc_stream_fifo_Write(vlc_stream_fifo_t *s, const void *buf, size_t len)
Writes data to a FIFO stream.
Definition: stream_fifo.c:151
vlc_stream_Block
VLC_EXPORT block_t * vlc_stream_Block(stream_t *s, size_t)
Read data into a block.
Definition: stream.c:729
vlc_object_t::obj
struct vlc_object_marker * obj
Definition: vlc_objects.h:48
vlc_stream_GetSize
static int vlc_stream_GetSize(stream_t *s, uint64_t *size)
Get the size of the stream.
Definition: vlc_stream.h:331
strcasecmp
int strcasecmp(const char *, const char *)
stream_t::obj
struct vlc_object_t obj
Definition: vlc_stream.h:48
STREAM_SET_RECORD_STATE
@ STREAM_SET_RECORD_STATE
arg1=bool, arg2=const char *psz_ext (if arg1 is true) res=can fail
Definition: vlc_stream.h:170
vlc_common.h
STREAM_GET_TITLE_INFO
@ STREAM_GET_TITLE_INFO
arg1=input_title_t*** arg2=int* res=can fail
Definition: vlc_stream.h:156
stream_t::b_preparsing
bool b_preparsing
True if this access is used to preparse.
Definition: vlc_stream.h:54
vlc_stream_fifo_New
VLC_EXPORT vlc_stream_fifo_t * vlc_stream_fifo_New(vlc_object_t *parent, stream_t **reader)
Creates a FIFO stream.
Definition: stream_fifo.c:106
input_item_t
Describes an input and is used to spawn input_thread_t objects.
Definition: vlc_input_item.h:77
STREAM_SET_SEEKPOINT
@ STREAM_SET_SEEKPOINT
arg1= int res=can fail
Definition: vlc_stream.h:167
vlc_stream_ReadLine
VLC_EXPORT char * vlc_stream_ReadLine(stream_t *)
Definition: stream.c:187
vlc_stream_NewURL
#define vlc_stream_NewURL(a, b)
Definition: vlc_stream.h:422
STREAM_SET_TITLE
@ STREAM_SET_TITLE
arg1= int res=can fail
Definition: vlc_stream.h:166
vlc_stream_fifo_Close
VLC_EXPORT void vlc_stream_fifo_Close(vlc_stream_fifo_t *s)
Terminates a FIFO stream.
Definition: stream_fifo.c:162
STREAM_SET_PAUSE_STATE
@ STREAM_SET_PAUSE_STATE
arg1= bool res=can fail
Definition: vlc_stream.h:165
stream_query_e
stream_query_e
Possible commands to send to vlc_stream_Control() and vlc_stream_vaControl()
Definition: vlc_stream.h:144
STREAM_SET_PRIVATE_ID_CA
@ STREAM_SET_PRIVATE_ID_CA
Definition: vlc_stream.h:173
stream_HasExtension
static bool stream_HasExtension(stream_t *s, const char *extension)
Definition: vlc_stream.h:348
stream_t::pf_demux
int(* pf_demux)(stream_t *)
Definition: vlc_stream.h:115
stream_t::out
es_out_t * out
Definition: vlc_stream.h:68
stream_t::psz_location
const char * psz_location
Location (URL with the scheme stripped)
Definition: vlc_stream.h:52
STREAM_CAN_SEEK
@ STREAM_CAN_SEEK
arg1= bool * res=cannot fail
Definition: vlc_stream.h:147
stream_t::pf_readdir
int(* pf_readdir)(stream_t *, input_item_node_t *)
Read directory.
Definition: vlc_stream.h:113
stream_t::psz_name
char * psz_name
Definition: vlc_stream.h:50
STREAM_SET_PRIVATE_ID_STATE
@ STREAM_SET_PRIVATE_ID_STATE
Definition: vlc_stream.h:172
es_out_t
Definition: vlc_es_out.h:143
vlc_stream_fifo
Definition: stream_fifo.c:37
vlc_stream_ReadDir
VLC_EXPORT int vlc_stream_ReadDir(stream_t *s, input_item_node_t *node)
Reads a directory.
Definition: stream.c:749
stream_t::pf_seek
int(* pf_seek)(stream_t *, uint64_t)
Seek.
Definition: vlc_stream.h:124
stream_t::psz_url
char * psz_url
Full URL or MRL (can be NULL)
Definition: vlc_stream.h:51
vlc_stream_MemoryNew
#define vlc_stream_MemoryNew(a, b, c, d)
Definition: vlc_stream.h:413
vlc_stream_Control
static int vlc_stream_Control(stream_t *s, int query,...)
Definition: vlc_stream.h:294
stream_t
stream_t definition
Definition: vlc_stream.h:46
STREAM_GET_META
@ STREAM_GET_META
arg1= vlc_meta_t * res=can fail
Definition: vlc_stream.h:159
stream_t::s
stream_t * s
Input stream.
Definition: vlc_stream.h:65
vlc_stream_Seek
VLC_EXPORT int vlc_stream_Seek(stream_t *, uint64_t offset)
Sets the current stream position.
Definition: stream.c:625
STREAM_GET_PTS_DELAY
@ STREAM_GET_PTS_DELAY
arg1= vlc_tick_t* res=cannot fail
Definition: vlc_stream.h:155
vlc_stream_Read
VLC_EXPORT ssize_t vlc_stream_Read(stream_t *, void *buf, size_t len)
Reads data from a byte stream.
Definition: stream.c:485
stream_t::pf_control
int(* pf_control)(stream_t *, int i_query, va_list)
Stream control.
Definition: vlc_stream.h:133
stream_t::p_input_item
input_item_t * p_input_item
Input item (can be NULL)
Definition: vlc_stream.h:55
STREAM_GET_SEEKPOINT
@ STREAM_GET_SEEKPOINT
arg1=unsigned * res=can fail
Definition: vlc_stream.h:158
vlc_object_t
VLC object common members.
Definition: vlc_objects.h:43
stream_ContentType
static char * stream_ContentType(stream_t *s)
Get the Content-Type of a stream, or NULL if unknown.
Definition: vlc_stream.h:360
VLC_USED
#define VLC_USED
Definition: fourcc_gen.c:32
vlc_block.h
name
const char name[16]
Definition: httpd.c:1268
stream_t::pf_read
ssize_t(* pf_read)(stream_t *, void *buf, size_t len)
Read data.
Definition: vlc_stream.h:85
vlc_stream_ReadBlock
VLC_EXPORT block_t * vlc_stream_ReadBlock(stream_t *)
Reads a data block from a byte stream.
Definition: stream.c:561
vlc_stream_Peek
VLC_EXPORT ssize_t vlc_stream_Peek(stream_t *, const uint8_t **, size_t)
Peeks at data from a byte stream.
STREAM_GET_CONTENT_TYPE
@ STREAM_GET_CONTENT_TYPE
arg1= char ** res=can fail
Definition: vlc_stream.h:160
stream_Size
static int64_t stream_Size(stream_t *s)
Definition: vlc_stream.h:336
vlc_stream_fifo_Queue
VLC_EXPORT int vlc_stream_fifo_Queue(vlc_stream_fifo_t *s, block_t *block)
Writes a block to a FIFO stream.
Definition: stream_fifo.c:132
vlc_stream_CommonNew
VLC_EXPORT stream_t * vlc_stream_CommonNew(vlc_object_t *, void(*)(stream_t *))
Definition: stream.c:108
vlc_stream_Delete
VLC_EXPORT void vlc_stream_Delete(stream_t *s)
Closes a byte stream.
Definition: stream.c:133
STREAM_CAN_CONTROL_PACE
@ STREAM_CAN_CONTROL_PACE
arg1= bool * res=cannot fail
Definition: vlc_stream.h:150
stream_MimeType
static char * stream_MimeType(stream_t *s)
Get the mime-type of a stream.
Definition: vlc_stream.h:375
STREAM_GET_PRIVATE_ID_STATE
@ STREAM_GET_PRIVATE_ID_STATE
Definition: vlc_stream.h:174
stream_IsMimeType
static bool stream_IsMimeType(stream_t *s, const char *type)
Checks for a MIME type.
Definition: vlc_stream.h:391
vlc_stream_Eof
VLC_EXPORT bool vlc_stream_Eof(const stream_t *)
Checks for end of stream.
Definition: stream.c:618
stream_t::psz_filepath
char * psz_filepath
Local file path (if applicable)
Definition: vlc_stream.h:53
STREAM_GET_SIGNAL
@ STREAM_GET_SIGNAL
arg1=double *pf_quality, arg2=double *pf_strength res=can fail
Definition: vlc_stream.h:161
STREAM_GET_SIZE
@ STREAM_GET_SIZE
arg1= uint64_t * res=can fail
Definition: vlc_stream.h:152
input_item_node_t
Definition: vlc_input_item.h:194
STREAM_GET_TAGS
@ STREAM_GET_TAGS
arg1=const block_t ** res=can fail
Definition: vlc_stream.h:162
STREAM_GET_TYPE
@ STREAM_GET_TYPE
arg1=int* res=can fail
Definition: vlc_stream.h:163
STREAM_CAN_FASTSEEK
@ STREAM_CAN_FASTSEEK
arg1= bool * res=cannot fail
Definition: vlc_stream.h:148
stream_t::p_sys
void * p_sys
Private data pointer.
Definition: vlc_stream.h:138
block_t
Definition: vlc_block.h:117
vlc_stream_ReadPartial
VLC_EXPORT ssize_t vlc_stream_ReadPartial(stream_t *, void *buf, size_t len)
Reads partial data from a byte stream.
Definition: stream.c:463