codec: atsc_a65: avoid crash
[vlc.git] / include / vlc_access.h
blob1f168c19a83c7fc6bb703b8d56c4ec14c0ee6d24
1 /*****************************************************************************
2 * vlc_access.h: Access descriptor, queries and methods
3 *****************************************************************************
4 * Copyright (C) 1999-2006 VLC authors and VideoLAN
5 * $Id$
7 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef VLC_ACCESS_H
25 #define VLC_ACCESS_H 1
27 #include <vlc_stream.h>
29 /**
30 * \defgroup access Access
31 * \ingroup stream
32 * Raw input byte streams
33 * @{
34 * \file
35 * Input byte stream modules interface
38 /**
39 * Special redirection error code.
41 * In case of redirection, the access open function should clean up (as in
42 * normal failure case), store the heap-allocated redirection URL in
43 * stream_t.psz_url, and return this value.
45 #define VLC_ACCESS_REDIRECT VLC_ETIMEOUT
47 /**
48 * Opens a new read-only byte stream.
50 * This function might block.
51 * The initial offset is of course always zero.
53 * \param obj parent VLC object
54 * \param mrl media resource location to read
55 * \return a new access object on success, NULL on failure
57 VLC_API stream_t *vlc_access_NewMRL(vlc_object_t *obj, const char *mrl);
59 /**
60 * \defgroup access_helper Access Helpers
61 * @{
64 /**
65 * Default pf_control callback for directory accesses.
67 VLC_API int access_vaDirectoryControlHelper( stream_t *p_access, int i_query, va_list args );
69 #define ACCESS_SET_CALLBACKS( read, block, control, seek ) \
70 do { \
71 p_access->pf_read = (read); \
72 p_access->pf_block = (block); \
73 p_access->pf_control = (control); \
74 p_access->pf_seek = (seek); \
75 } while(0)
77 /**
78 * Access pf_readdir helper struct
79 * \see access_fsdir_init()
80 * \see access_fsdir_additem()
81 * \see access_fsdir_finish()
83 struct access_fsdir
85 input_item_node_t *p_node;
86 void **pp_slaves;
87 unsigned int i_slaves;
88 int i_sub_autodetect_fuzzy;
89 bool b_show_hiddenfiles;
90 char *psz_ignored_exts;
93 /**
94 * Init a access_fsdir struct
96 * \param p_fsdir need to be cleaned with access_fsdir_finish()
97 * \param p_node node that will be used to add items
99 VLC_API void access_fsdir_init(struct access_fsdir *p_fsdir,
100 stream_t *p_access, input_item_node_t *p_node);
103 * Finish adding items to the node
105 * \param b_success if true, items of the node will be sorted.
107 VLC_API void access_fsdir_finish(struct access_fsdir *p_fsdir, bool b_success);
110 * Add a new input_item_t entry to the node of the access_fsdir struct.
112 * \param p_fsdir previously inited access_fsdir struct
113 * \param psz_uri uri of the new item
114 * \param psz_filename file name of the new item
115 * \param i_type see \ref input_item_type_e
116 * \param i_net see \ref input_item_net_type
118 VLC_API int access_fsdir_additem(struct access_fsdir *p_fsdir,
119 const char *psz_uri, const char *psz_filename,
120 int i_type, int i_net);
123 * @} @}
126 #endif