vlc_access.h 2.4 KB
Newer Older
1
/*****************************************************************************
2
 * vlc_access.h: Access descriptor, queries and methods
3
 *****************************************************************************
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
4
 * Copyright (C) 1999-2006 VLC authors and VideoLAN
5
 * $Id$
6 7 8
 *
 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
 *
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
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
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's avatar
Jean-Baptiste Kempf committed
16 17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
18
 *
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
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.
22 23
 *****************************************************************************/

24 25
#ifndef VLC_ACCESS_H
#define VLC_ACCESS_H 1
26

27
#include <vlc_stream.h>
28

29 30
/**
 * \defgroup access Access
31
 * \ingroup stream
32
 * Raw input byte streams
33
 * @{
34 35
 * \file
 * Input byte stream modules interface
36 37
 */

38 39 40 41 42
/**
 * 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
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
43
 * stream_t.psz_url, and return this value.
44 45 46
 */
#define VLC_ACCESS_REDIRECT VLC_ETIMEOUT

47 48 49 50 51 52 53 54 55 56
/**
 * 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
 */
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
57
VLC_API stream_t *vlc_access_NewMRL(vlc_object_t *obj, const char *mrl);
58

59 60 61 62 63
/**
 * \defgroup access_helper Access Helpers
 * @{
 */

64 65 66
/**
 * Default pf_control callback for directory accesses.
 */
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
67
VLC_API int access_vaDirectoryControlHelper( stream_t *p_access, int i_query, va_list args );
68

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)

77 78
/**
 * @} @}
79 80
 */

81
#endif