2004-06-22 21:29:37 +02:00
|
|
|
/*****************************************************************************
|
2005-12-15 12:37:45 +01:00
|
|
|
* vlc_access.h: Access descriptor, queries and methods
|
2004-06-22 21:29:37 +02:00
|
|
|
*****************************************************************************
|
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 21:44:15 +01:00
|
|
|
* Copyright (C) 1999-2006 VLC authors and VideoLAN
|
2004-08-25 20:50:36 +02:00
|
|
|
* $Id$
|
2004-06-22 21:29:37 +02:00
|
|
|
*
|
|
|
|
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
|
|
|
|
*
|
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 21:44:15 +01:00
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU Lesser General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2.1 of the License, or
|
2004-06-22 21:29:37 +02:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
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 21:44:15 +01:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License for more details.
|
2004-06-22 21:29:37 +02:00
|
|
|
*
|
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 21:44:15 +01:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
|
2004-06-22 21:29:37 +02:00
|
|
|
*****************************************************************************/
|
|
|
|
|
2008-08-11 18:13:10 +02:00
|
|
|
#ifndef VLC_ACCESS_H
|
|
|
|
#define VLC_ACCESS_H 1
|
2004-06-22 21:29:37 +02:00
|
|
|
|
2006-11-26 15:20:34 +01:00
|
|
|
#include <vlc_block.h>
|
|
|
|
|
2004-06-22 21:29:37 +02:00
|
|
|
/**
|
|
|
|
* \defgroup access Access
|
2015-06-14 18:00:16 +02:00
|
|
|
* \ingroup input
|
|
|
|
* Raw input byte streams
|
2004-06-22 21:29:37 +02:00
|
|
|
* @{
|
2015-06-14 18:00:16 +02:00
|
|
|
* \file
|
|
|
|
* Input byte stream modules interface
|
2004-06-22 21:29:37 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
enum access_query_e
|
|
|
|
{
|
|
|
|
/* capabilities */
|
2008-04-14 00:08:29 +02:00
|
|
|
ACCESS_CAN_SEEK, /* arg1= bool* cannot fail */
|
|
|
|
ACCESS_CAN_FASTSEEK, /* arg1= bool* cannot fail */
|
|
|
|
ACCESS_CAN_PAUSE, /* arg1= bool* cannot fail */
|
|
|
|
ACCESS_CAN_CONTROL_PACE,/* arg1= bool* cannot fail */
|
2013-07-21 15:15:17 +02:00
|
|
|
ACCESS_GET_SIZE=6, /* arg1= uin64_t* */
|
2016-04-29 12:39:44 +02:00
|
|
|
ACCESS_IS_DIRECTORY, /* arg1= bool *, res=can fail */
|
2004-06-22 21:29:37 +02:00
|
|
|
|
|
|
|
/* */
|
2009-01-20 22:28:47 +01:00
|
|
|
ACCESS_GET_PTS_DELAY = 0x101,/* arg1= int64_t* cannot fail */
|
2013-08-26 18:08:18 +02:00
|
|
|
ACCESS_GET_TITLE_INFO, /* arg1=input_title_t*** arg2=int* res=can fail */
|
|
|
|
ACCESS_GET_TITLE, /* arg1=unsigned * res=can fail */
|
|
|
|
ACCESS_GET_SEEKPOINT, /* arg1=unsigned * res=can fail */
|
2004-06-22 21:29:37 +02:00
|
|
|
|
2013-08-26 18:08:18 +02:00
|
|
|
/* Meta data */
|
2015-10-20 18:07:37 +02:00
|
|
|
ACCESS_GET_META, /* arg1= vlc_meta_t * res=can fail */
|
2013-08-26 18:08:18 +02:00
|
|
|
ACCESS_GET_CONTENT_TYPE,/* arg1=char **ppsz_content_type res=can fail */
|
2008-09-23 22:11:01 +02:00
|
|
|
|
|
|
|
ACCESS_GET_SIGNAL, /* arg1=double *pf_quality, arg2=double *pf_strength res=can fail */
|
|
|
|
|
|
|
|
/* */
|
2008-09-28 13:54:33 +02:00
|
|
|
ACCESS_SET_PAUSE_STATE = 0x200, /* arg1= bool can fail */
|
2004-06-22 21:29:37 +02:00
|
|
|
|
|
|
|
/* */
|
|
|
|
ACCESS_SET_TITLE, /* arg1= int can fail */
|
|
|
|
ACCESS_SET_SEEKPOINT, /* arg1= int can fail */
|
|
|
|
|
|
|
|
/* Special mode for access/demux communication
|
|
|
|
* XXX: avoid to use it unless you can't */
|
2008-09-28 13:54:33 +02:00
|
|
|
ACCESS_SET_PRIVATE_ID_STATE = 0x1000, /* arg1= int i_private_data, bool b_selected res=can fail */
|
|
|
|
ACCESS_SET_PRIVATE_ID_CA, /* arg1= int i_program_number, uint16_t i_vpid, uint16_t i_apid1, uint16_t i_apid2, uint16_t i_apid3, uint8_t i_length, uint8_t *p_data */
|
|
|
|
ACCESS_GET_PRIVATE_ID_STATE, /* arg1=int i_private_data arg2=bool * res=can fail */
|
2004-06-22 21:29:37 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct access_t
|
|
|
|
{
|
|
|
|
VLC_COMMON_MEMBERS
|
|
|
|
|
|
|
|
/* Module properties */
|
|
|
|
module_t *p_module;
|
|
|
|
|
2015-09-02 21:27:15 +02:00
|
|
|
|
2016-04-27 21:06:13 +02:00
|
|
|
char *psz_access; /**< Access name */
|
2015-09-02 21:27:15 +02:00
|
|
|
char *psz_url; /**< Full URL or MRL */
|
|
|
|
const char *psz_location; /**< Location (URL with the scheme stripped) */
|
2010-05-10 21:55:06 +02:00
|
|
|
char *psz_filepath; /**< Local file path (if applicable) */
|
2016-06-04 17:23:17 +02:00
|
|
|
bool b_preparsing; /**< True if this access is used to preparse */
|
2004-06-22 21:29:37 +02:00
|
|
|
|
2014-06-23 17:07:08 +02:00
|
|
|
/* pf_read/pf_block/pf_readdir is used to read data.
|
2004-06-22 21:29:37 +02:00
|
|
|
* XXX A access should set one and only one of them */
|
2016-07-18 18:33:10 +02:00
|
|
|
ssize_t (*pf_read) ( access_t *, void *, size_t ); /* Return -1 if no data yet, 0 if no more data, else real data read */
|
2016-07-19 19:53:34 +02:00
|
|
|
block_t *(*pf_block) ( access_t *, bool * ); /* Return a block of data in his 'natural' size, NULL if not yet data or eof */
|
2016-04-12 15:07:22 +02:00
|
|
|
int (*pf_readdir)( access_t *, input_item_node_t * );/* Fills the provided item_node, see doc/browsing.txt for details */
|
2004-06-22 21:29:37 +02:00
|
|
|
|
|
|
|
/* Called for each seek.
|
|
|
|
* XXX can be null */
|
2010-01-21 21:36:07 +01:00
|
|
|
int (*pf_seek) ( access_t *, uint64_t ); /* can be null if can't seek */
|
2004-06-22 21:29:37 +02:00
|
|
|
|
2016-04-02 16:50:31 +02:00
|
|
|
/* Used to retrieve and configure the access
|
2004-06-22 21:29:37 +02:00
|
|
|
* XXX mandatory. look at access_query_e to know what query you *have to* support */
|
|
|
|
int (*pf_control)( access_t *, int i_query, va_list args);
|
|
|
|
|
|
|
|
/* Access has to maintain them uptodate */
|
|
|
|
struct
|
|
|
|
{
|
2008-11-11 20:26:05 +01:00
|
|
|
bool b_eof; /* idem */
|
2004-06-22 21:29:37 +02:00
|
|
|
} info;
|
|
|
|
access_sys_t *p_sys;
|
2009-08-21 12:27:56 +02:00
|
|
|
|
|
|
|
/* Weak link to parent input */
|
|
|
|
input_thread_t *p_input;
|
2004-06-22 21:29:37 +02:00
|
|
|
};
|
|
|
|
|
2015-10-22 20:48:16 +02:00
|
|
|
/**
|
|
|
|
* Special redirection error code.
|
|
|
|
*
|
|
|
|
* In case of redirection, the access open function should clean up (as in
|
|
|
|
* normal failure case), store the heap-allocated redirection URL in
|
|
|
|
* access_t.psz_url, and return this value.
|
|
|
|
*/
|
|
|
|
#define VLC_ACCESS_REDIRECT VLC_ETIMEOUT
|
|
|
|
|
2015-07-22 20:30:55 +02:00
|
|
|
/**
|
|
|
|
* Opens a new read-only byte stream.
|
|
|
|
*
|
|
|
|
* This function might block.
|
|
|
|
* The initial offset is of course always zero.
|
|
|
|
*
|
|
|
|
* \param obj parent VLC object
|
|
|
|
* \param mrl media resource location to read
|
|
|
|
* \return a new access object on success, NULL on failure
|
|
|
|
*/
|
|
|
|
VLC_API access_t *vlc_access_NewMRL(vlc_object_t *obj, const char *mrl);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Closes a byte stream.
|
|
|
|
* \param access byte stream to close
|
|
|
|
*/
|
|
|
|
VLC_API void vlc_access_Delete(access_t *access);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the read byte offset.
|
|
|
|
*/
|
|
|
|
static inline int vlc_access_Seek(access_t *access, uint64_t offset)
|
|
|
|
{
|
2016-07-19 20:18:49 +02:00
|
|
|
int ret = VLC_EGENERIC;
|
|
|
|
|
|
|
|
if (access->pf_seek != NULL)
|
|
|
|
ret = access->pf_seek(access, offset);
|
|
|
|
if (ret == VLC_SUCCESS)
|
|
|
|
access->info.b_eof = false;
|
|
|
|
return ret;
|
2015-07-22 20:30:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if end-of-stream is reached.
|
|
|
|
*/
|
|
|
|
static inline bool vlc_access_Eof(const access_t *access)
|
|
|
|
{
|
|
|
|
return access->info.b_eof;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reads a byte stream.
|
|
|
|
*
|
|
|
|
* This function waits for some data to be available (if necessary) and returns
|
|
|
|
* available data (up to the requested size). Not all byte streams support
|
|
|
|
* this. Some streams must be read with vlc_access_Block() instead.
|
|
|
|
*
|
|
|
|
* \note
|
|
|
|
* A short read does <b>not</b> imply the end of the stream. It merely implies
|
|
|
|
* that enough data is not immediately available.
|
|
|
|
* To detect the end of the stream, either check if the function returns zero,
|
|
|
|
* or call vlc_access_Eof().
|
|
|
|
*
|
|
|
|
* \note
|
|
|
|
* The function may return a negative value spuriously. Negative error values
|
|
|
|
* should be ignored; they do not necessarily indicate a fatal error.
|
|
|
|
*
|
|
|
|
* \param buf buffer to read data into
|
|
|
|
* \param len size of the buffer in bytes
|
|
|
|
* \return the number of bytes read (possibly less than requested),
|
|
|
|
* zero at end-of-stream, or -1 on <b>transient</b> errors
|
|
|
|
*/
|
|
|
|
static inline ssize_t vlc_access_Read(access_t *access, void *buf, size_t len)
|
|
|
|
{
|
2016-07-19 20:20:28 +02:00
|
|
|
int ret = -1;
|
|
|
|
|
|
|
|
if (access->pf_read != NULL)
|
|
|
|
ret = access->pf_read(access, buf, len);
|
|
|
|
if (len > 0 && ret == 0)
|
|
|
|
access->info.b_eof = true;
|
|
|
|
return ret;
|
2015-07-22 20:30:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Dequeues one block of data.
|
|
|
|
*
|
|
|
|
* This function waits for a block of data to be available (if necessary) and
|
|
|
|
* returns a reference to it. Not all byte streams support this. Some streams
|
|
|
|
* must be read with vlc_access_Read() instead.
|
|
|
|
*
|
|
|
|
* \note
|
|
|
|
* The returned block may be of any size. The size is dependent on the
|
|
|
|
* underlying implementation of the byte stream.
|
|
|
|
*
|
|
|
|
* \note
|
|
|
|
* The function may return NULL spuriously. A NULL return is not indicative of
|
|
|
|
* a fatal error.
|
|
|
|
*
|
|
|
|
* \return a data block (free with block_Release()) or NULL
|
|
|
|
*/
|
|
|
|
static inline block_t *vlc_access_Block(access_t *access)
|
|
|
|
{
|
|
|
|
if (access->pf_block == NULL)
|
|
|
|
return NULL;
|
2016-07-19 19:53:34 +02:00
|
|
|
|
|
|
|
return access->pf_block(access, &access->info.b_eof);
|
2015-07-22 20:30:55 +02:00
|
|
|
}
|
|
|
|
|
2008-04-14 00:21:18 +02:00
|
|
|
static inline int access_vaControl( access_t *p_access, int i_query, va_list args )
|
2004-06-22 21:29:37 +02:00
|
|
|
{
|
2008-03-13 16:18:35 +01:00
|
|
|
if( !p_access ) return VLC_EGENERIC;
|
2015-06-02 22:01:38 +02:00
|
|
|
return p_access->pf_control( p_access, i_query, args );
|
2004-06-22 21:29:37 +02:00
|
|
|
}
|
2006-11-26 15:20:34 +01:00
|
|
|
|
2008-04-14 00:21:18 +02:00
|
|
|
static inline int access_Control( access_t *p_access, int i_query, ... )
|
2004-06-22 21:29:37 +02:00
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
int i_result;
|
|
|
|
|
|
|
|
va_start( args, i_query );
|
2008-04-14 00:21:18 +02:00
|
|
|
i_result = access_vaControl( p_access, i_query, args );
|
2004-06-22 21:29:37 +02:00
|
|
|
va_end( args );
|
|
|
|
return i_result;
|
|
|
|
}
|
|
|
|
|
2015-08-31 17:32:49 +02:00
|
|
|
static inline int access_GetSize( access_t *p_access, uint64_t *size )
|
2013-07-21 15:15:17 +02:00
|
|
|
{
|
2015-08-31 17:32:49 +02:00
|
|
|
return access_Control( p_access, ACCESS_GET_SIZE, size );
|
2013-07-21 15:15:17 +02:00
|
|
|
}
|
|
|
|
|
2016-04-12 15:07:22 +02:00
|
|
|
/**
|
|
|
|
* \defgroup access_helper Access Helpers
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2015-06-03 11:44:05 +02:00
|
|
|
/**
|
|
|
|
* Default pf_control callback for directory accesses.
|
|
|
|
*/
|
|
|
|
VLC_API int access_vaDirectoryControlHelper( access_t *p_access, int i_query, va_list args );
|
|
|
|
|
2011-09-01 20:14:20 +02:00
|
|
|
#define ACCESS_SET_CALLBACKS( read, block, control, seek ) \
|
|
|
|
do { \
|
|
|
|
p_access->pf_read = (read); \
|
|
|
|
p_access->pf_block = (block); \
|
|
|
|
p_access->pf_control = (control); \
|
|
|
|
p_access->pf_seek = (seek); \
|
|
|
|
} while(0)
|
|
|
|
|
|
|
|
#define STANDARD_READ_ACCESS_INIT \
|
|
|
|
do { \
|
|
|
|
ACCESS_SET_CALLBACKS( Read, NULL, Control, Seek ); \
|
2014-06-19 11:22:23 +02:00
|
|
|
p_sys = p_access->p_sys = (access_sys_t*)calloc( 1, sizeof( access_sys_t ) ); \
|
2011-09-01 20:14:20 +02:00
|
|
|
if( !p_sys ) return VLC_ENOMEM;\
|
|
|
|
} while(0);
|
|
|
|
|
|
|
|
#define STANDARD_BLOCK_ACCESS_INIT \
|
|
|
|
do { \
|
|
|
|
ACCESS_SET_CALLBACKS( NULL, Block, Control, Seek ); \
|
2014-06-19 11:22:23 +02:00
|
|
|
p_sys = p_access->p_sys = (access_sys_t*)calloc( 1, sizeof( access_sys_t ) ); \
|
2011-09-01 20:14:20 +02:00
|
|
|
if( !p_sys ) return VLC_ENOMEM; \
|
|
|
|
} while(0);
|
2006-07-19 11:33:41 +02:00
|
|
|
|
2009-10-16 18:50:45 +02:00
|
|
|
/**
|
2016-04-12 15:07:22 +02:00
|
|
|
* Access pf_readdir helper struct
|
|
|
|
* \see access_fsdir_init()
|
|
|
|
* \see access_fsdir_additem()
|
|
|
|
* \see access_fsdir_finish()
|
|
|
|
*/
|
|
|
|
struct access_fsdir
|
|
|
|
{
|
|
|
|
input_item_node_t *p_node;
|
2016-05-03 18:34:57 +02:00
|
|
|
void **pp_slaves;
|
|
|
|
unsigned int i_slaves;
|
|
|
|
int i_sub_autodetect_fuzzy;
|
2016-04-12 15:07:22 +02:00
|
|
|
bool b_show_hiddenfiles;
|
|
|
|
char *psz_ignored_exts;
|
|
|
|
char *psz_sort;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Init a access_fsdir struct
|
|
|
|
*
|
|
|
|
* \param p_fsdir need to be cleaned with access_fsdir_finish()
|
|
|
|
* \param p_node node that will be used to add items
|
|
|
|
*/
|
|
|
|
VLC_API void access_fsdir_init(struct access_fsdir *p_fsdir,
|
|
|
|
access_t *p_access, input_item_node_t *p_node);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Finish adding items to the node
|
|
|
|
*
|
|
|
|
* \param b_success if true, items of the node will be sorted according
|
|
|
|
* "directory-sort" option.
|
|
|
|
*/
|
|
|
|
VLC_API void access_fsdir_finish(struct access_fsdir *p_fsdir, bool b_success);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a new input_item_t entry to the node of the access_fsdir struct.
|
|
|
|
*
|
|
|
|
* \param p_fsdir previously inited access_fsdir struct
|
|
|
|
* \param psz_uri uri of the new item
|
|
|
|
* \param psz_filename file name of the new item
|
|
|
|
* \param i_type see \ref input_item_type_e
|
|
|
|
* \param i_net see \ref input_item_net_type
|
|
|
|
*/
|
|
|
|
VLC_API int access_fsdir_additem(struct access_fsdir *p_fsdir,
|
|
|
|
const char *psz_uri, const char *psz_filename,
|
|
|
|
int i_type, int i_net);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @} @}
|
2009-10-16 18:50:45 +02:00
|
|
|
*/
|
|
|
|
|
2004-06-22 21:29:37 +02:00
|
|
|
#endif
|