Commit Graph

42 Commits

Author SHA1 Message Date
Loïc Branstett f93de3ef23 stream/demux: move remaining callbacks to their respective ops struct
This commit moves the remaining callbacks of stream/demux: pf_read/
pf_block/pf_seek/pf_readdir and pf_demux into their operations table,
aiming at unifying all the callbacks under a unique place.
This is a follow-up to the introduction of typed controls callbacks
for stream and demux.

Like for the typed controls callbacks if no operation is provided
(ie, stream_t/demux_t.ops is NULL) by a module, the legacy pf_* will be
used instead as a fallback.

The commit doesn't migrate any of modules yet.
2023-03-24 10:51:36 +00:00
Rémi Denis-Courmont 60e36ce7d2 stream_filter: only filter byte streams
All existing stream filters either implicitly (e.g. by peeking) or
explicitly (by checking pf_* pointers) check that the source is a byte
stream.

Don't waste time probing filters for directories or (access_)demuxers.
If we ever need to filter directories, we are better off adding a
different capability to do so.
2020-09-25 19:04:07 +03:00
Rémi Denis-Courmont d867dac99e Use vlc_object_parent() 2019-02-28 21:20:32 +02:00
Steve Lhomme 5363279805 remove the $Id$ in the source code 2019-01-17 12:21:18 +01:00
Thomas Guillem 6b96ade7dd stream: replace input_thread_t by input_item_t
This will prevent all demuxers/access/streams to mess with the input_thread_t
state.
2018-07-20 17:23:03 +02:00
Rémi Denis-Courmont e38642a8d3 stream_filter: privatize module pointer 2018-04-06 20:45:10 +03:00
Rémi Denis-Courmont 6692050c70 stream_filter: assign type name for now
(though it will probably be merged with demux soon)
2018-04-06 20:45:10 +03:00
Rémi Denis-Courmont daeddd9bc7 stream_filter: remove tautology test 2018-04-06 20:45:10 +03:00
Rémi Denis-Courmont 5d36f25f03 stream_filter: reorder to avoid forward declaration 2018-04-06 20:45:10 +03:00
Rémi Denis-Courmont 2ec4bfe7b1 stream: remove dummy pf_readdir callbacks
This was required for stream filters, but not for accesses. Now that
both are stream_t, this has become inconsistent.

So this just makes them optional also for stream filters.
2018-03-31 17:59:20 +03:00
Rémi Denis-Courmont ef8618e457 stream filter: provide file path in addition to URL 2018-02-26 20:56:55 +02:00
Rémi Denis-Courmont 7902c7a656 stream: rename p_source to s (refs #18504) 2017-12-02 23:23:56 +02:00
Rémi Denis-Courmont 5eab2397a8 stream_filter: limit probing recursion (fixes #17670)
This limits the number of filters that are probed automatically. There
are no valid use cases for a large number of autoprobed filters.
2016-11-23 21:41:11 +02:00
Rémi Denis-Courmont 312d198438 stream: stream_ -> vlc_stream_ 2016-07-21 22:26:57 +03:00
Rémi Denis-Courmont c240692f0b Common structure for VLC common object members, document 2016-06-18 18:01:32 +03: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 f343ca522c Fix use of %p format string specifier
%p is only for pointers to void, not just any type of pointers. Due to
variable arguments, there is no implicit conversion here.
2015-10-31 18:34:47 +02:00
Rémi Denis-Courmont 5f1a70589d stream_FilterNew: fix missing psz_url 2015-10-22 22:45:09 +03:00
Rémi Denis-Courmont f680366757 stream: privatize the destruction callback 2015-09-02 22:30:27 +03:00
Rémi Denis-Courmont 33eb0cd1df stream: merge stream_CommonDelete() and stream_Delete() 2015-08-25 21:28:14 +03:00
Rémi Denis-Courmont 682e16024a stream_filter: revector, use strtok_r() 2015-08-25 20:52:33 +03:00
Rémi Denis-Courmont 70a513b938 stream_filter: separate hard-coded "record" stream filter insertion 2015-08-25 20:52:30 +03:00
Rémi Denis-Courmont 15a2182a62 stream_filter: split out code for automatic filter probing 2015-08-25 20:52:27 +03:00
Rémi Denis-Courmont 3bf3de015a stream_filter: improve parenting
Attach to the source stream´s parent rather than the source stream.
This avoids recursive vlc_object_release() when deleting the chain.
2015-08-25 20:23:47 +03:00
Rémi Denis-Courmont 8df23063ed stream: allow NULL psz_url and fail as appropriate
Previously, "" would be used, leading to nonsensical results in those
stream filters that actually need a URL.
2015-07-26 15:38:25 +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
Thomas Guillem 88ffe15878 access: refactor pf_readdir
The main advantage is to move the management of the input_item_node_t from all
accesses to the directory demux.
2015-05-20 16:07:32 +02:00
Rémi Denis-Courmont 01db92aa68 stream: remove redundant checks 2014-06-26 18:34:53 +03:00
Julien 'Lta' BALLET 8eb065ff63 Add a default implementation for pf_readdir for StreamFilter. Use it in stream_filter/record.c
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2014-06-24 10:58:17 +02:00
Rémi Denis-Courmont 989f6ff2c6 input: correct record stream filter name (fixes #9185) 2013-10-03 19:08:31 +03:00
Jean-Baptiste Kempf 36ab287e77 LGPL
Re-license almost all of libVLC and libVLCcore to LGPLv2.1+

This move was authorized by the developers, either:
 - by e-mail,
 - by vote at the VideoLAN Dev Days 2011,
 - on the license website,
 - in a contract, oral or written.
No objection was raised, so far.

The developers agreeing are:
  Justus Piater
  Alexis Ballier
  Alexander Bethke
  Mohammed Adnène Trojette
  Alex Converse
  Alexey Sokolov
  Alexis de Lattre
  Andre Pang
  Anthony Loiseau
  Cyril Deguet
  André Weber
  Boris Dorès
  Brieuc Jeunhomme
  Benjamin Drung
  Hugo Beauzée-Luyssen
  Benoit Steiner
  Benjamin Pracht
  Bernie Purcell
  Przemyslaw Fiala
  Arnaud de Bossoreille de Ribou
  Brad Smith
  Nick Briggs
  Christopher Rath
  Christophe Courtaut
  Christopher Mueller
  Clement Chesnin
  Andres Krapf
  Damien Fouilleul
  David Flynn
  Sebastien Zwickert
  Antoine Cellerier
  Jérôme Decoodt
  Jérome Decoodt
  Dylan Yudaken
  Eduard Babayan
  Eugenio Jarosiewicz
  Elliot Murphy
  Eric Petit
  Erwan Tulou
  Etienne Membrives
  Ludovic Fauvet
  Fabio Ritrovato
  Tobias Güntner
  Jakub Wieczorek
  Frédéric Crozat
  Francois Cartegnie
  Laurent Aimar
  Florian G. Pflug
  Felix Paul Kühne
  Frank Enderle
  Rafaël Carré
  Simon Latapie
  Gildas Bazin
  Geoffroy Couprie
  Julien / Gellule
  Gildas Bazin
  Arnaud Schauly
  Toralf Niebuhr
  Vicente Jimenez Aguilar
  Derk-Jan Hartman
  Henri Fallon
  Ilkka Ollakka
  Olivier Teulière
  Rémi Duraffort
  Jakob Leben
  Jean-Baptiste Kempf
  Jean-Paul Saman
  Jean-Philippe Grimaldi
  Jean-François Massol
  Gaël Hendryckx
  Jakob Leben
  Jean-Marc Dressler
  Jai Menon
  Johan Bilien
  Johann Ransay
  Joris van Rooij
  JP Dinger
  Jean-Philippe André
  Adrien Grand
  Juha Jeronen
  Juho Vähä-Herttua
  Kaarlo Raiha
  Kaarlo Raiha
  Kamil Baldyga
  Keary Griffin
  Ken Self
  KO Myung-Hun
  Pierre Ynard
  Filippo Carone
  Loïc Minier
  Luca Barbato
  Lucas C. Villa Real
  Lukas Durfina
  Adrien Maglo
  Marc Ariberti
  Mark Lee
  Mark Moriarty
  Martin Storsjö
  Christophe Massiot
  Michel Kaempf
  Marian Ďurkovič
  Mirsal Ennaime
  Carlo Calabrò
  Damien Lucas
  Naohiro Koriyama
  Basos G
  Pierre Baillet
  Vincent Penquerc'h
  Olivier Aubert
  Pankaj Yadav
  Paul Corke
  Pierre d'Herbemont
  Philippe Morin
  Antoine Lejeune
  Michael Ploujnikov
  Jean-Marc Dressler
  Michael Hanselmann
  Rafaël Carré
  Ramiro Polla
  Rémi Denis-Courmont
  Renaud Dartus
  Richard Shepherd
  Faustino Osuna
  Arnaud Vallat
  Rob Jonson
  Robert Jedrzejczyk
  Steve Lhomme
  Rocky Bernstein
  Romain Goyet
  Rov Juvano
  Sam Hocevar
  Martin T. H. Sandsmark
  Sebastian Birk
  Sébastien Escudier
  Vincent Seguin
  Fabio Ritrovato
  Sigmund Augdal Helberg
  Casian Andrei
  Srikanth Raju
  Hannes Domani
  Stéphane Borel
  Stephan Krempel
  Stephan Assmus
  Tony Castley
  Pavlov Konstantin
  Eric Petit
  Tanguy Krotoff
  Dennis van Amerongen
  Michel Lespinasse
  Can Wu
  Xavier Marchesini
  Sébastien Toque
  Christophe Mutricy
  Yoann Peronneau
  Yohann Martineau
  Yuval Tze
  Scott Caudle
  Clément Stenac

It is possible, that some minor piece of code was badly tracked, for
some reasons (SVN, mainly) or that some small developers did not answer.
However, as an "œuvre collective", defined as in "CPI 113-2 alinéa 3",
and seeing "Cour. Cass. 17 Mai 1978", and seeing that the editor and
the very vast majority of developers have agreed (> 99.99% of the code,
> 99% of developers), we are fine here.
2011-11-27 22:54:33 +01:00
Rémi Denis-Courmont 36c4a22f2c Remove vlc_object_attach() 2011-05-25 19:50:38 +03:00
Jean-Paul Saman 87a2d70001 stream_filter core: add procotol information to stream_t
In addition to p_access->psz_location also add p_access->psz_access to the contructed
stream_t *. It will allow a stream_filter to determine the protocol used in case it was
constructed with an access input.
2010-11-02 09:45:26 +01:00
Rémi Denis-Courmont 59117b2862 Do not include vlc_modules.h in vlc_common.h 2010-07-27 22:33:36 +03:00
Rémi Denis-Courmont a7c0e2a065 Typos 2010-06-05 11:10:50 +03:00
Jean-Philippe André cf168e78fd Stream: Export stream_FilterNew 2009-12-19 18:56:39 +01:00
Rémi Denis-Courmont 5d0ae5d7c8 Remove most vlc_object_set_name() calls, now redumdant 2009-09-20 12:48:41 +03:00
Rémi Denis-Courmont 07a61eae0b Use vlc_object_set_name in some places 2009-08-23 22:27:27 +03:00
Pierre d'Herbemont 0d1f966a0b Implement access_GetParentInput and demux_GetParentInput and use.
This try to avoid vlc_object_find() as much as possible.
This is conservative, because where there is no associated parent input, we'll try to find in certain cases the parent input. This will probably be
 removed later on. Because yes, there is not necessarily a parent input for access and demux, especially if created from stream_UrlNew().
2009-08-21 12:33:56 +02:00
Laurent Aimar 9f052b2bd2 Added path information in stream_t. 2009-01-25 17:46:10 +01:00
Laurent Aimar 033efbad8c Cosmetics. 2008-12-11 21:05:37 +01:00
Laurent Aimar 584da50459 Support for auto and user requested stream_filter. 2008-12-09 21:13:03 +01:00