1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 1999-2001 VideoLAN
5 * $Id: ninput.h,v 1.18 2003/11/21 00:38:01 gbazin Exp $
7 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
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.
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.
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 *****************************************************************************/
31 ES_OUT_SET_SELECT, /* arg1= es_out_id_t* arg2=vlc_bool_t */
32 ES_OUT_GET_SELECT /* arg1= es_out_id_t* arg2=vlc_bool_t* */
37 es_out_id_t *(*pf_add) ( es_out_t *, es_format_t * );
38 int (*pf_send) ( es_out_t *, es_out_id_t *, block_t * );
39 int (*pf_send_pes)( es_out_t *, es_out_id_t *, pes_packet_t * );
40 void (*pf_del) ( es_out_t *, es_out_id_t * );
41 int (*pf_control)( es_out_t *, int i_query, va_list );
46 static inline es_out_id_t * es_out_Add( es_out_t *out, es_format_t *fmt )
48 return out->pf_add( out, fmt );
50 static inline void es_out_Del( es_out_t *out, es_out_id_t *id )
52 out->pf_del( out, id );
54 static inline int es_out_Send( es_out_t *out, es_out_id_t *id,
57 return out->pf_send( out, id, p_block );
59 static inline int es_out_SendPES( es_out_t *out, es_out_id_t *id,
62 return out->pf_send_pes( out, id, p_pes );
64 static inline int es_out_vaControl( es_out_t *out, int i_query, va_list args )
66 return out->pf_control( out, i_query, args );
68 static inline int es_out_Control( es_out_t *out, int i_query, ... )
73 va_start( args, i_query );
74 i_result = es_out_vaControl( out, i_query, args );
80 * \defgroup stream Stream
82 * This will allow you to easily handle read/seek in demuxer modules.
87 * Possible commands to send to stream_Control() and stream_vaControl()
92 STREAM_CAN_SEEK, /**< arg1= vlc_bool_t * res=cannot fail*/
93 STREAM_CAN_FASTSEEK, /**< arg1= vlc_bool_t * res=cannot fail*/
96 STREAM_SET_POSITION, /**< arg1= int64_t res=can fail */
97 STREAM_GET_POSITION, /**< arg1= int64_t * res=cannot fail*/
99 STREAM_GET_SIZE, /**< arg1= int64_t * res=cannot fail (0 if no sense)*/
103 VLC_EXPORT( stream_t *, stream_OpenInput, ( input_thread_t * ) );
104 VLC_EXPORT( void, stream_Release, ( stream_t * ) );
105 VLC_EXPORT( int, stream_vaControl, ( stream_t *, int i_query, va_list ) );
106 VLC_EXPORT( int, stream_Control, ( stream_t *, int i_query, ... ) );
107 VLC_EXPORT( int, stream_Read, ( stream_t *, void *p_read, int i_read ) );
108 VLC_EXPORT( int, stream_Peek, ( stream_t *, uint8_t **pp_peek, int i_peek ) );
109 VLC_EXPORT( data_packet_t *,stream_DataPacket, ( stream_t *, int i_size, vlc_bool_t b_force ) );
110 VLC_EXPORT( pes_packet_t *, stream_PesPacket, ( stream_t *, int i_size ) );
111 VLC_EXPORT( block_t *, stream_Block, ( stream_t *, int i_size ) );
113 static int64_t inline stream_Tell( stream_t *s )
116 stream_Control( s, STREAM_GET_POSITION, &i_pos );
120 static int64_t inline stream_Size( stream_t *s )
123 stream_Control( s, STREAM_GET_SIZE, &i_pos );
127 static int inline stream_Seek( stream_t *s, int64_t i_pos )
129 return stream_Control( s, STREAM_SET_POSITION, i_pos );
138 * \defgroup demux Demux
143 DEMUX_GET_POSITION, /* arg1= double * res= */
144 DEMUX_SET_POSITION, /* arg1= double res=can fail */
146 DEMUX_GET_TIME, /* arg1= int64_t * res= */
147 DEMUX_SET_TIME, /* arg1= int64_t res=can fail */
149 DEMUX_GET_LENGTH, /* arg1= int64_t * res=can fail */
151 DEMUX_GET_FPS /* arg1= float * res=can fail */
157 VLC_EXPORT( int, demux_vaControl, ( input_thread_t *, int i_query, va_list ) );
158 VLC_EXPORT( int, demux_Control, ( input_thread_t *, int i_query, ... ) );
160 VLC_EXPORT( int, demux_vaControlDefault, ( input_thread_t *, int i_query, va_list ) );
163 VLC_EXPORT( char **, subtitles_Detect, ( input_thread_t *, char* path, char *fname ) );