]> git.sesse.net Git - vlc/blob - include/ninput.h
include/ninput.c, src/input/stream.c:
[vlc] / include / ninput.h
1 /*****************************************************************************
2  * ninput.h
3  *****************************************************************************
4  * Copyright (C) 1999-2001 VideoLAN
5  * $Id: ninput.h,v 1.4 2003/08/14 11:25:56 sigmunau Exp $
6  *
7  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
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 General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24 #ifndef _NINPUT_H
25 #define _NINPUT_H 1
26
27 /**
28  * \defgroup stream Stream
29  *
30  *  This will allow you to easily handle read/seek in demuxer modules.
31  * @{
32  */
33
34 /**
35  * Possible commands to send to stream_Control() and stream_vaControl()
36  */
37 enum stream_query_e
38 {
39     /* capabilities */
40     STREAM_CAN_SEEK,            /**< arg1= vlc_bool_t *   res=cannot fail*/
41     STREAM_CAN_FASTSEEK,        /**< arg1= vlc_bool_t *   res=cannot fail*/
42
43     /* */
44     STREAM_SET_POSITION,        /**< arg1= int64_t        res=can fail  */
45     STREAM_GET_POSITION,        /**< arg1= int64_t *      res=cannot fail*/
46
47     STREAM_GET_SIZE,            /**< arg1= int64_t *      res=cannot fail (0 if no sense)*/
48 };
49
50 /* Stream */
51 VLC_EXPORT( stream_t *,     stream_OpenInput,       ( input_thread_t * ) );
52 VLC_EXPORT( void,           stream_Release,         ( stream_t * ) );
53 VLC_EXPORT( int,            stream_vaControl,       ( stream_t *, int i_query, va_list ) );
54 VLC_EXPORT( int,            stream_Control,         ( stream_t *, int i_query, ... ) );
55 VLC_EXPORT( int,            stream_Read,            ( stream_t *, void *p_read, int i_read ) );
56 VLC_EXPORT( int,            stream_Peek,            ( stream_t *, uint8_t **pp_peek, int i_peek ) );
57 VLC_EXPORT( pes_packet_t *, stream_PesPacket,       ( stream_t *, int i_size ) );
58 /**
59  * @}
60  */
61
62 /**
63  * \defgroup demux Demux
64  * XXX: don't look at it yet.
65  * @{
66  */
67 #define DEMUX_POSITION_MAX  10000
68 enum demux_query_e
69 {
70     DEMUX_GET_POSITION,         /* arg1= int64_t *      res=    */
71     DEMUX_SET_POSITION,         /* arg1= int64_t        res=can fail    */
72
73     DEMUX_GET_TIME,             /* arg1= int64_t *      res=    */
74     DEMUX_SET_TIME,             /* arg1= int64_t        res=can fail    */
75
76     DEMUX_GET_LENGTH            /* arg1= int64_t *      res=can fail    */
77 };
78
79
80
81 /* Demux */
82 VLC_EXPORT( int,            demux_vaControl,        ( input_thread_t *, int i_query, va_list  ) );
83 VLC_EXPORT( int,            demux_Control,          ( input_thread_t *, int i_query, ...  ) );
84
85 /**
86  * @}
87  */
88 #endif
89