1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 1998-2004 the VideoLAN team
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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef _INPUT_INTERNAL_H
25 #define _INPUT_INTERNAL_H 1
29 INPUT_CONTROL_SET_DIE,
31 INPUT_CONTROL_SET_STATE,
33 INPUT_CONTROL_SET_RATE,
34 INPUT_CONTROL_SET_RATE_SLOWER,
35 INPUT_CONTROL_SET_RATE_FASTER,
37 INPUT_CONTROL_SET_POSITION,
38 INPUT_CONTROL_SET_POSITION_OFFSET,
40 INPUT_CONTROL_SET_TIME,
41 INPUT_CONTROL_SET_TIME_OFFSET,
43 INPUT_CONTROL_SET_PROGRAM,
45 INPUT_CONTROL_SET_TITLE,
46 INPUT_CONTROL_SET_TITLE_NEXT,
47 INPUT_CONTROL_SET_TITLE_PREV,
49 INPUT_CONTROL_SET_SEEKPOINT,
50 INPUT_CONTROL_SET_SEEKPOINT_NEXT,
51 INPUT_CONTROL_SET_SEEKPOINT_PREV,
53 INPUT_CONTROL_SET_BOOKMARK,
57 INPUT_CONTROL_SET_AUDIO_DELAY,
58 INPUT_CONTROL_SET_SPU_DELAY,
60 INPUT_CONTROL_ADD_SLAVE,
63 /* Internal helpers */
64 static inline void input_ControlPush( input_thread_t *p_input,
65 int i_type, vlc_value_t *p_val )
67 vlc_mutex_lock( &p_input->lock_control );
68 if( i_type == INPUT_CONTROL_SET_DIE )
70 /* Special case, empty the control */
71 p_input->i_control = 1;
72 p_input->control[0].i_type = i_type;
73 memset( &p_input->control[0].val, 0, sizeof( vlc_value_t ) );
77 if( p_input->i_control >= INPUT_CONTROL_FIFO_SIZE )
79 msg_Err( p_input, "input control fifo overflow, trashing type=%d",
81 vlc_mutex_unlock( &p_input->lock_control );
84 p_input->control[p_input->i_control].i_type = i_type;
86 p_input->control[p_input->i_control].val = *p_val;
88 memset( &p_input->control[p_input->i_control].val, 0,
89 sizeof( vlc_value_t ) );
93 vlc_mutex_unlock( &p_input->lock_control );
97 void input_ControlVarInit ( input_thread_t * );
98 void input_ControlVarClean( input_thread_t * );
99 void input_ControlVarNavigation( input_thread_t * );
100 void input_ControlVarTitle( input_thread_t *, int i_title );
102 void input_ConfigVarInit ( input_thread_t * );
105 stream_t *stream_AccessNew( access_t *p_access, vlc_bool_t );
106 void stream_AccessDelete( stream_t *s );
107 void stream_AccessReset( stream_t *s );
108 void stream_AccessUpdate( stream_t *s );
110 /* decoder.c FIXME make it public ?*/
111 void input_DecoderDiscontinuity( decoder_t * p_dec );
112 vlc_bool_t input_DecoderEmpty( decoder_t * p_dec );
113 void input_DecoderPreroll( decoder_t *p_dec, int64_t i_preroll_end );
116 es_out_t *input_EsOutNew( input_thread_t * );
117 void input_EsOutDelete( es_out_t * );
118 es_out_id_t *input_EsOutGetFromID( es_out_t *, int i_id );
119 void input_EsOutDiscontinuity( es_out_t *, vlc_bool_t b_audio );
120 void input_EsOutSetDelay( es_out_t *, int i_cat, int64_t );
121 vlc_bool_t input_EsOutDecodersEmpty( es_out_t * );
124 enum /* Synchro states */
133 /* Synchronization information */
135 mtime_t cr_ref, sysdate_ref;
136 mtime_t last_sysdate;
137 mtime_t last_cr; /* reference to detect unexpected stream
146 int i_delta_cr_residue;
149 void input_ClockInit( input_clock_t *, vlc_bool_t b_master, int i_cr_average );
150 void input_ClockSetPCR( input_thread_t *, input_clock_t *, mtime_t );
151 mtime_t input_ClockGetTS( input_thread_t *, input_clock_t *, mtime_t );
154 char **subtitles_Detect( input_thread_t *, char* path, char *fname );
155 void MRLSplit( vlc_object_t *, char *, char **, char **, char ** );