]> git.sesse.net Git - vlc/blob - include/ninput.h
Keep track of ioctl_UnsetDMXFilter
[vlc] / include / ninput.h
1 /*****************************************************************************
2  * ninput.h
3  *****************************************************************************
4  * Copyright (C) 1999-2001 VideoLAN
5  * $Id: ninput.h,v 1.3 2003/08/02 19:16:04 fenrir 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  * Stream (stream_t)
29  * -----------------
30  *  This will allow you to easily handle read/seek in demuxer modules.
31  *
32  * - stream_OpenInput
33  *      create a "stream_t *" from an "input_thread_t *".
34  * - stream_Release
35  *      destroy a previously "stream_t *" instances.
36  * - stream_Read
37  *      Try to read "i_read" bytes into a buffer pointed by "p_read".
38  *      If "p_read" is NULL then data are skipped instead of read.
39  *      The return value is the real numbers of bytes read/skip. If
40  *      this value is less than i_read that means that it's the end
41  *      of the stream.
42  * - stream_Peek
43  *      Store in pp_peek a pointer to the next "i_peek" bytes in the
44  *      stream
45  *      The return value is the real numbers of valid bytes, if it's
46  *      less or equal to 0, *pp_peek is invalid.
47  *      XXX: it's a pointer to internal buffer and it will be invalid
48  *      as soons as other stream_* functions are called.
49  *      be 0 (then *pp_peek isn't valid).
50  *      XXX: due to input limitation, it could be less than i_peek without
51  *      meaning the end of the stream (but only when you have
52  *      i_peek >= p_input->i_bufsize)
53  * - stream_PesPacket
54  *      Read "i_size" bytes and store them in a pes_packet_t.
55  *      Only fields p_first, p_last, i_nb_data, and i_pes_size are set.
56  *      (Of course, you need to fill i_dts, i_pts, ... )
57  *      If only less than "i_size" bytes are available NULL is returned.
58  * - stream_vaControl, stream_Control
59  *      Use to control the "stream_t *". Look at stream_query_e for possible
60  *      "i_query" value and format arguments.
61  *      Return VLC_SUCCESS if ... succeed ;) and VLC_EGENERIC if failed or
62  *      unimplemented
63  */
64
65 enum stream_query_e
66 {
67     /* capabilities */
68     STREAM_CAN_SEEK,            /* arg1= vlc_bool_t *   res=cannot fail*/
69     STREAM_CAN_FASTSEEK,        /* arg1= vlc_bool_t *   res=cannot fail*/
70
71     /* */
72     STREAM_SET_POSITION,        /* arg1= int64_t        res=can fail  */
73     STREAM_GET_POSITION,        /* arg1= int64_t *      res=cannot fail*/
74
75     STREAM_GET_SIZE,            /* arg1= int64_t *      res=cannot fail (0 if no sense)*/
76 };
77
78 /*
79  * Demux
80  * XXX: don't look at it yet.
81  */
82 #define DEMUX_POSITION_MAX  10000
83 enum demux_query_e
84 {
85     DEMUX_GET_POSITION,         /* arg1= int64_t *      res=    */
86     DEMUX_SET_POSITION,         /* arg1= int64_t        res=can fail    */
87
88     DEMUX_GET_TIME,             /* arg1= int64_t *      res=    */
89     DEMUX_SET_TIME,             /* arg1= int64_t        res=can fail    */
90
91     DEMUX_GET_LENGTH            /* arg1= int64_t *      res=can fail    */
92 };
93
94
95 /* Stream */
96 VLC_EXPORT( stream_t *,     stream_OpenInput,       ( input_thread_t * ) );
97 VLC_EXPORT( void,           stream_Release,         ( stream_t * ) );
98 VLC_EXPORT( int,            stream_vaControl,       ( stream_t *, int i_query, va_list ) );
99 VLC_EXPORT( int,            stream_Control,         ( stream_t *, int i_query, ... ) );
100 VLC_EXPORT( int,            stream_Read,            ( stream_t *, void *p_read, int i_read ) );
101 VLC_EXPORT( int,            stream_Peek,            ( stream_t *, uint8_t **pp_peek, int i_peek ) );
102 VLC_EXPORT( pes_packet_t *, stream_PesPacket,       ( stream_t *, int i_size ) );
103
104 /* Demux */
105 VLC_EXPORT( int,            demux_vaControl,        ( input_thread_t *, int i_query, va_list  ) );
106 VLC_EXPORT( int,            demux_Control,          ( input_thread_t *, int i_query, ...  ) );
107
108 #endif
109