Audiobar: fix copyright years and shortname
[vlc.git] / src / input / input_internal.h
blob1ade60c1a82f0931def1f83d7389e64f9592e365
1 /*****************************************************************************
2 * input_internal.h: Internal input structures
3 *****************************************************************************
4 * Copyright (C) 1998-2006 the VideoLAN team
5 * $Id$
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 LIBVLC_INPUT_INTERNAL_H
25 #define LIBVLC_INPUT_INTERNAL_H 1
27 #include <vlc_access.h>
28 #include <vlc_demux.h>
29 #include <vlc_input.h>
30 #include <libvlc.h>
31 #include "input_interface.h"
33 /*****************************************************************************
34 * Private input fields
35 *****************************************************************************/
37 #define INPUT_CONTROL_FIFO_SIZE 100
39 /* input_source_t: gathers all information per input source */
40 typedef struct
42 /* Access/Stream/Demux plugins */
43 access_t *p_access;
44 stream_t *p_stream;
45 demux_t *p_demux;
47 /* Title infos for that input */
48 bool b_title_demux; /* Titles/Seekpoints provided by demux */
49 int i_title;
50 input_title_t **title;
52 int i_title_offset;
53 int i_seekpoint_offset;
55 int i_title_start;
56 int i_title_end;
57 int i_seekpoint_start;
58 int i_seekpoint_end;
60 /* Properties */
61 bool b_can_pause;
62 bool b_can_pace_control;
63 bool b_can_rate_control;
64 bool b_can_stream_record;
65 bool b_rescale_ts;
67 /* */
68 int64_t i_pts_delay;
70 bool b_eof; /* eof of demuxer */
72 } input_source_t;
74 typedef struct
76 int i_type;
77 vlc_value_t val;
78 } input_control_t;
80 /** Private input fields */
81 struct input_thread_private_t
83 /* Global properties */
84 double f_fps;
85 int i_state;
86 bool b_can_pause;
87 bool b_can_rate_control;
88 bool b_can_pace_control;
90 /* Current state */
91 bool b_recording;
92 int i_rate;
94 /* Playtime configuration and state */
95 int64_t i_start; /* :start-time,0 by default */
96 int64_t i_stop; /* :stop-time, 0 if none */
97 int64_t i_run; /* :run-time, 0 if none */
98 int64_t i_time; /* Current time */
99 bool b_fast_seek;/* :input-fast-seek */
101 /* Output */
102 bool b_out_pace_control; /* XXX Move it ot es_sout ? */
103 sout_instance_t *p_sout; /* Idem ? */
104 es_out_t *p_es_out;
105 es_out_t *p_es_out_display;
107 /* Title infos FIXME multi-input (not easy) ? */
108 int i_title;
109 input_title_t **title;
111 int i_title_offset;
112 int i_seekpoint_offset;
114 /* User bookmarks FIXME won't be easy with multiples input */
115 seekpoint_t bookmark;
116 int i_bookmark;
117 seekpoint_t **pp_bookmark;
119 /* Input attachment */
120 int i_attachment;
121 input_attachment_t **attachment;
123 /* Main input properties */
125 /* Input item */
126 input_item_t *p_item;
128 /* Main source */
129 input_source_t input;
130 /* Slave sources (subs, and others) */
131 int i_slave;
132 input_source_t **slave;
134 /* Resources */
135 input_resource_t *p_resource;
136 input_resource_t *p_resource_private;
138 /* Stats counters */
139 struct {
140 counter_t *p_read_packets;
141 counter_t *p_read_bytes;
142 counter_t *p_input_bitrate;
143 counter_t *p_demux_read;
144 counter_t *p_demux_bitrate;
145 counter_t *p_demux_corrupted;
146 counter_t *p_demux_discontinuity;
147 counter_t *p_decoded_audio;
148 counter_t *p_decoded_video;
149 counter_t *p_decoded_sub;
150 counter_t *p_sout_sent_packets;
151 counter_t *p_sout_sent_bytes;
152 counter_t *p_sout_send_bitrate;
153 counter_t *p_played_abuffers;
154 counter_t *p_lost_abuffers;
155 counter_t *p_displayed_pictures;
156 counter_t *p_lost_pictures;
157 vlc_mutex_t counters_lock;
158 } counters;
160 /* Buffer of pending actions */
161 vlc_mutex_t lock_control;
162 vlc_cond_t wait_control;
163 int i_control;
164 input_control_t control[INPUT_CONTROL_FIFO_SIZE];
166 bool b_abort;
167 bool is_running;
168 vlc_thread_t thread;
171 /***************************************************************************
172 * Internal control helpers
173 ***************************************************************************/
174 enum input_control_e
176 INPUT_CONTROL_SET_DIE,
178 INPUT_CONTROL_SET_STATE,
180 INPUT_CONTROL_SET_RATE,
182 INPUT_CONTROL_SET_POSITION,
184 INPUT_CONTROL_SET_TIME,
186 INPUT_CONTROL_SET_PROGRAM,
188 INPUT_CONTROL_SET_TITLE,
189 INPUT_CONTROL_SET_TITLE_NEXT,
190 INPUT_CONTROL_SET_TITLE_PREV,
192 INPUT_CONTROL_SET_SEEKPOINT,
193 INPUT_CONTROL_SET_SEEKPOINT_NEXT,
194 INPUT_CONTROL_SET_SEEKPOINT_PREV,
196 INPUT_CONTROL_SET_BOOKMARK,
198 INPUT_CONTROL_SET_ES,
199 INPUT_CONTROL_RESTART_ES,
201 INPUT_CONTROL_SET_AUDIO_DELAY,
202 INPUT_CONTROL_SET_SPU_DELAY,
204 INPUT_CONTROL_ADD_SLAVE,
206 INPUT_CONTROL_ADD_SUBTITLE,
208 INPUT_CONTROL_SET_RECORD_STATE,
210 INPUT_CONTROL_SET_FRAME_NEXT,
213 /* Internal helpers */
215 /* XXX for string value you have to allocate it before calling
216 * input_ControlPush
218 void input_ControlPush( input_thread_t *, int i_type, vlc_value_t * );
220 /* Bound pts_delay */
221 #define INPUT_PTS_DELAY_MAX INT64_C(60000000)
223 /**********************************************************************
224 * Item metadata
225 **********************************************************************/
226 /* input_ExtractAttachmentAndCacheArt:
227 * Becarefull; p_item lock HAS to be taken */
228 void input_ExtractAttachmentAndCacheArt( input_thread_t *p_input );
230 /***************************************************************************
231 * Internal prototypes
232 ***************************************************************************/
234 /* var.c */
235 void input_ControlVarInit ( input_thread_t * );
236 void input_ControlVarStop( input_thread_t * );
237 void input_ControlVarNavigation( input_thread_t * );
238 void input_ControlVarTitle( input_thread_t *, int i_title );
240 void input_ConfigVarInit ( input_thread_t * );
242 /* Subtitles */
243 char **subtitles_Detect( input_thread_t *, char* path, const char *fname );
244 int subtitles_Filter( const char *);
246 /* input.c */
247 void input_SplitMRL( const char **, const char **, const char **,
248 const char **, char * );
250 #endif