Commit Graph

106 Commits

Author SHA1 Message Date
Rémi Denis-Courmont c4a667202a stream: clarify seeking documentation
(cherry picked from commit ad303c60a7)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2017-11-30 19:23:16 +01:00
Francois Cartegnie 0c6f872de8 vlc_stream: add STREAM_GET_TAGS 2017-07-18 22:08:20 +02:00
Rémi Denis-Courmont b57a08e34e stream: add helper to check extension 2017-06-03 17:42:49 +03:00
Hugo Beauzée-Luyssen 934ff6ee2a vlc_stream: Fix stream_IsMimeType 2017-04-19 11:21:55 +02:00
Rémi Denis-Courmont 7c8871b13d stream: add stream_IsMimeType() 2017-04-18 21:54:12 +03:00
Rémi Denis-Courmont 5556387d88 stream: add VLC_USED to stream_MimeType() 2017-04-18 21:54:12 +03:00
Rémi Denis-Courmont c0d5d15812 stream: removed unused control argument 2017-04-18 21:54:09 +03:00
Filip Roséen 56f202f9ef vlc_stream: add stream_MimeType
As there is quite common for stream-consumers to be interested in the
associated mime-type, if any, of a stream; this helper function allows
access to that directly (instead of consumers having to manually parse
the string returned by stream_ContentType).

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2017-03-22 09:21:33 +02:00
Filip Roséen e4fbdcebeb stream: rename vlc_stream_NewMRL to vlc_stream_NewURL
The function does not open MRLs, as correctly described in its
documentation, as such it is rather unfortunate that its name uses MRL
instead of URL (especially given that it cannot handle MRLs).

These changes are simply renaming all occurrences of the function, so
that the behavior of the function is properly reflected by its name.

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
2016-12-06 15:57:19 +01:00
Thomas Guillem 10c5ded53c stream: update documentation 2016-10-14 16:38:11 +02:00
Rémi Denis-Courmont 38be0d228c stream: merge access_t and stream_t
They were mostly identical, with just a few extra fields in access_t.
Merging them will allow removing the dummy stream_Access layer.
2016-07-21 22:27:00 +03:00
Rémi Denis-Courmont b75462c33e stream: add vlc_stream_ReadPartial()
This is a variant of vlc_stream_Read(), such that it only waits for
some bytes (i.e. more than zero) rather than the full requested bytes
count.
2016-07-21 22:27:00 +03:00
Rémi Denis-Courmont 312d198438 stream: stream_ -> vlc_stream_ 2016-07-21 22:26:57 +03:00
Rémi Denis-Courmont 9e8c9e95cf stream: remove stream_CustomNew() 2016-07-21 19:59:25 +03:00
Rémi Denis-Courmont c9973b6fe9 stream: remove STREAM_GET_PRIVATE_BLOCK 2016-07-21 19:59:25 +03:00
Rémi Denis-Courmont ad84a22236 stream: improve documentation 2016-07-21 19:59:25 +03:00
Rémi Denis-Courmont f1ed338b12 stream: add pf_block callback
This adds support for block-based stream filters.
2016-07-21 19:59:25 +03:00
Rémi Denis-Courmont deb5e45b29 stream: add stream_ReadBlock()
This reads a block of unspecified size. The main use case will be
support for block-oriented stream filters.
2016-07-21 19:59:25 +03:00
Rémi Denis-Courmont 642a329a75 stream: add stream_Eof() 2016-07-21 19:59:24 +03:00
Rémi Denis-Courmont 676b185957 stream: make stream_t.p_sys void * (refs #17078) 2016-07-21 00:05:18 +03:00
Rémi Denis-Courmont 8d599e76b7 stream: fix stream_MemoryNew() prototype 2016-07-20 23:57:43 +03:00
Rémi Denis-Courmont 72b22e2b50 input: remove stream demux 2016-06-30 21:27:46 +03:00
Rémi Denis-Courmont 59f3310090 input: add FIFO stream type
This provides an anonymous pipe as a stream_t. The read side is a
normal non-seekable stream_t. The write side uses dedicated functions.
2016-06-30 21:27:46 +03:00
Thomas Guillem a78bbdd234 access: change ACCESS_IS_DIRECTORY / STREAM_IS_DIRECTORY args
The first sort argument is no longer necessary.
2016-05-19 15:55:27 +02:00
Thomas Guillem 9109718b77 access: re-refactor pf_readdir
This commit changes pf_readdir callback to its original behavior. Accesses and
streams now add items to a node.

Archive stream_filters will now be able to add nodes to a node (when an archive
has directory). This was not possible before.

This commit also adds an access_fsdir helper to help fs accesses (file, smb,
nfs, ftp, sftp) adding items to a node. These accesses need the same treatment
that is now done by this helper:
 - hide hidden files or not (depending on "show-hiddenfiles" option)
 - skip some file extensions (depending on "ignore-filetypes" option)
 - sort items by type and alphabetically (depending on "directory-sort"
   option).
 - For a next commit: attach slaves to items

The directory demux won't do these operations anymore for every access/stream.

This commit doesn't change the interruptible state of the pf_readdir function,
accesses/streams are still interruptible in the middle of a pf_readdir call.

This partially reverts commit 88ffe15878.
2016-05-19 15:55:27 +02:00
Rémi Denis-Courmont f788fa20e1 access: fix ACCESS_GET_META and STREAM_GET_META mismatches 2015-10-20 19:11:01 +03:00
Francois Cartegnie 3946b13fa2 add stream_Custom 2015-10-05 23:30:15 +02:00
Rémi Denis-Courmont f680366757 stream: privatize the destruction callback 2015-09-02 22:30:27 +03:00
Rémi Denis-Courmont 8368744397 stream: remove first parameter to STREAM_IS_DIRECTORY
Return an error code if the stream is not a directory (similar to
STREAM_GET_SIZE).
2015-09-02 21:50:43 +03:00
Rémi Denis-Courmont efe323f85f stream: STREAM_IS_DIRECTORY can actually fail, fix accordingly 2015-09-02 20:21:46 +03:00
Rémi Denis-Courmont 994a2555f0 stream: put stream_Seek() out of line 2015-09-02 20:03:22 +03:00
Rémi Denis-Courmont b1082a5cc0 stream: replace STREAM_SET_POSITION control with dedicated pf_seek
Also:
 - zip: fix seeking to end of file
 - accesstweaks: fix segmentation fault when (inhibiting) seeking
 - decomp: set callbacks only on successful init
2015-09-02 20:02:03 +03:00
Rémi Denis-Courmont fa4f2b18d2 stream: remove no longer used stream_t.b_error 2015-09-01 21:13:12 +03:00
Rémi Denis-Courmont 9e842af879 stream: remove STREAM_GET_POSITION control 2015-08-31 22:34:21 +03:00
Rémi Denis-Courmont 48786ae56d stream: provide a common implementation of stream_Tell() 2015-08-31 22:19:32 +03:00
Rémi Denis-Courmont 79b36fbb5b stream: move Doxygen for steam_Read() and stream_Peek() 2015-08-31 22:17:35 +03:00
Rémi Denis-Courmont b85d67cb7f stream: warn on stream_Read() and stream_Peek() unused result
Both functions can always fail. Even if the stream size is known,
and larger than the requested bytes, reading can fail due to lower
level errors. stream_Peek() can also fail to allocate memory.

Not checking the return value is a bug.
2015-08-31 22:08:26 +03:00
Rémi Denis-Courmont b4b8a82639 stream: fix integer overflow with stream_Block() 2015-08-31 19:59:44 +03:00
Rémi Denis-Courmont db7e4c7780 stream: add stream_GetSize() helper
Unlike stream_Size(), this helper distinguishes between unknown and
zero sizes.
2015-08-31 18:57:17 +03:00
Rémi Denis-Courmont 84d07db2eb stream: add STREAM_GET_PRIVATE_BLOCK for block-based buffering 2015-08-25 21:28:10 +03:00
Rémi Denis-Courmont df2cd48351 stream: use (s)size_t for callback prototypes 2015-07-26 23:57:43 +03:00
Rémi Denis-Courmont c6274d04a8 stream: fold psz_access and psz_path into psz_url 2015-07-26 15:38:20 +03:00
Rémi Denis-Courmont e2ac0530eb stream: restore values of STREAM_ position/size controls 2015-07-24 16:09:50 +03:00
Rémi Denis-Courmont 41683dae63 stream: allow STREAM_GET_SIZE to fail 2015-07-24 16:09:50 +03:00
Rémi Denis-Courmont c7e83e1cee stream: remove stream_BlockRemaining() 2015-07-23 22:41:12 +03:00
Rémi Denis-Courmont 636c11b64a stream: remove unused STREAM_UPDATE_SIZE control 2015-07-23 22:28:41 +03:00
Rémi Denis-Courmont 5ce6b6a858 stream: remove stream_t.pf_peek 2015-07-23 21:07:03 +03:00
Rémi Denis-Courmont 757ced87c8 stream: provide a generic stream_Peek() front-end
In most cases, there is no or little room for optimizing this, and
the benefits are minimal. This provides a generic implementation so
that each stream filter does not need to reinvent the wheel.
2015-07-23 21:07:02 +03:00
Rémi Denis-Courmont 099840efe3 stream: fold stream_text_t into stream private data 2015-07-23 21:07:00 +03:00
Rémi Denis-Courmont aee51fec5a include: add/fix more Doxygen groups 2015-06-14 23:25:38 +03:00