vlc_access.h 3.7 KB
 Laurent Aimar committed Jun 22, 2004 1 /*****************************************************************************  Clément Stenac committed Dec 15, 2005 2  * vlc_access.h: Access descriptor, queries and methods  Laurent Aimar committed Jun 22, 2004 3  *****************************************************************************  Jean-Baptiste Kempf committed Nov 27, 2011 4  * Copyright (C) 1999-2006 VLC authors and VideoLAN  Laurent Aimar committed Aug 25, 2004 5  * $Id$  Laurent Aimar committed Jun 22, 2004 6 7 8  * * Authors: Laurent Aimar *  Jean-Baptiste Kempf committed Nov 27, 2011 9 10 11  * 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  Laurent Aimar committed Jun 22, 2004 12 13 14 15  * (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  Jean-Baptiste Kempf committed Nov 27, 2011 16 17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details.  Laurent Aimar committed Jun 22, 2004 18  *  Jean-Baptiste Kempf committed Nov 27, 2011 19 20 21  * 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.  Laurent Aimar committed Jun 22, 2004 22 23  *****************************************************************************/  Rémi Denis-Courmont committed Aug 11, 2008 24 25 #ifndef VLC_ACCESS_H #define VLC_ACCESS_H 1  Laurent Aimar committed Jun 22, 2004 26   Rémi Denis-Courmont committed Jul 21, 2016 27 #include  Clément Stenac committed Nov 26, 2006 28   Laurent Aimar committed Jun 22, 2004 29 30 /** * \defgroup access Access  Rémi Denis-Courmont committed Oct 26, 2016 31  * \ingroup stream  Rémi Denis-Courmont committed Jun 14, 2015 32  * Raw input byte streams  Laurent Aimar committed Jun 22, 2004 33  * @{  Rémi Denis-Courmont committed Jun 14, 2015 34 35  * \file * Input byte stream modules interface  Laurent Aimar committed Jun 22, 2004 36 37  */  Rémi Denis-Courmont committed Oct 22, 2015 38 39 40 41 42 43 44 45 46 /** * 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  Rémi Denis-Courmont committed Jul 22, 2015 47 48 49 50 51 52 53 54 55 56 57 58 /** * 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);  Thomas Guillem committed May 19, 2016 59 60 61 62 63 /** * \defgroup access_helper Access Helpers * @{ */  Thomas Guillem committed Jun 04, 2015 64 65 66 67 68 /** * Default pf_control callback for directory accesses. */ VLC_API int access_vaDirectoryControlHelper( access_t *p_access, int i_query, va_list args );  Rémi Denis-Courmont committed Sep 01, 2011 69 70 71 72 73 74 75 76 #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)  Rémi Duraffort committed Oct 16, 2009 77 /**  Thomas Guillem committed May 19, 2016 78 79 80 81 82 83 84 85  * 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;  Benjamin Adolphi committed May 19, 2016 86 87 88  void **pp_slaves; unsigned int i_slaves; int i_sub_autodetect_fuzzy;  Thomas Guillem committed May 19, 2016 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104  bool b_show_hiddenfiles; char *psz_ignored_exts; }; /** * 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 *  Rémi Denis-Courmont committed Feb 18, 2017 105  * \param b_success if true, items of the node will be sorted.  Thomas Guillem committed May 19, 2016 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123  */ 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); /** * @} @}  Rémi Duraffort committed Oct 16, 2009 124 125  */  Laurent Aimar committed Jun 22, 2004 126 #endif