Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef LIBVLC_INPUT_INTERNAL_H
00025 #define LIBVLC_INPUT_INTERNAL_H 1
00026
00027 #include <vlc_access.h>
00028 #include <vlc_demux.h>
00029 #include <vlc_input.h>
00030 #include <libvlc.h>
00031 #include "input_interface.h"
00032
00033
00034
00035
00036
00037 #define INPUT_CONTROL_FIFO_SIZE 100
00038
00039
00040 typedef struct
00041 {
00042
00043 access_t *p_access;
00044 stream_t *p_stream;
00045 demux_t *p_demux;
00046
00047
00048 bool b_title_demux;
00049 int i_title;
00050 input_title_t **title;
00051
00052 int i_title_offset;
00053 int i_seekpoint_offset;
00054
00055 int i_title_start;
00056 int i_title_end;
00057 int i_seekpoint_start;
00058 int i_seekpoint_end;
00059
00060
00061 bool b_can_pause;
00062 bool b_can_pace_control;
00063 bool b_can_rate_control;
00064 bool b_can_stream_record;
00065 bool b_rescale_ts;
00066
00067
00068 int64_t i_pts_delay;
00069
00070 bool b_eof;
00071
00072 } input_source_t;
00073
00074 typedef struct
00075 {
00076 int i_type;
00077 vlc_value_t val;
00078 } input_control_t;
00079
00080
00081 struct input_thread_private_t
00082 {
00083
00084 double f_fps;
00085 int i_state;
00086 bool b_can_pause;
00087 bool b_can_rate_control;
00088 bool b_can_pace_control;
00089
00090
00091 bool b_recording;
00092 int i_rate;
00093
00094
00095 int64_t i_start;
00096 int64_t i_stop;
00097 int64_t i_run;
00098 int64_t i_time;
00099 bool b_fast_seek;
00100
00101
00102 bool b_out_pace_control;
00103 sout_instance_t *p_sout;
00104 es_out_t *p_es_out;
00105 es_out_t *p_es_out_display;
00106
00107
00108 int i_title;
00109 input_title_t **title;
00110
00111 int i_title_offset;
00112 int i_seekpoint_offset;
00113
00114
00115 seekpoint_t bookmark;
00116 int i_bookmark;
00117 seekpoint_t **pp_bookmark;
00118
00119
00120 int i_attachment;
00121 input_attachment_t **attachment;
00122
00123
00124
00125
00126 input_item_t *p_item;
00127
00128
00129 input_source_t input;
00130
00131 int i_slave;
00132 input_source_t **slave;
00133
00134
00135 input_resource_t *p_resource;
00136 input_resource_t *p_resource_private;
00137
00138
00139 struct {
00140 counter_t *p_read_packets;
00141 counter_t *p_read_bytes;
00142 counter_t *p_input_bitrate;
00143 counter_t *p_demux_read;
00144 counter_t *p_demux_bitrate;
00145 counter_t *p_demux_corrupted;
00146 counter_t *p_demux_discontinuity;
00147 counter_t *p_decoded_audio;
00148 counter_t *p_decoded_video;
00149 counter_t *p_decoded_sub;
00150 counter_t *p_sout_sent_packets;
00151 counter_t *p_sout_sent_bytes;
00152 counter_t *p_sout_send_bitrate;
00153 counter_t *p_played_abuffers;
00154 counter_t *p_lost_abuffers;
00155 counter_t *p_displayed_pictures;
00156 counter_t *p_lost_pictures;
00157 vlc_mutex_t counters_lock;
00158 } counters;
00159
00160
00161 vlc_mutex_t lock_control;
00162 vlc_cond_t wait_control;
00163 int i_control;
00164 input_control_t control[INPUT_CONTROL_FIFO_SIZE];
00165
00166 bool b_abort;
00167 bool is_running;
00168 vlc_thread_t thread;
00169 };
00170
00171
00172
00173
00174 enum input_control_e
00175 {
00176 INPUT_CONTROL_SET_DIE,
00177
00178 INPUT_CONTROL_SET_STATE,
00179
00180 INPUT_CONTROL_SET_RATE,
00181
00182 INPUT_CONTROL_SET_POSITION,
00183
00184 INPUT_CONTROL_SET_TIME,
00185
00186 INPUT_CONTROL_SET_PROGRAM,
00187
00188 INPUT_CONTROL_SET_TITLE,
00189 INPUT_CONTROL_SET_TITLE_NEXT,
00190 INPUT_CONTROL_SET_TITLE_PREV,
00191
00192 INPUT_CONTROL_SET_SEEKPOINT,
00193 INPUT_CONTROL_SET_SEEKPOINT_NEXT,
00194 INPUT_CONTROL_SET_SEEKPOINT_PREV,
00195
00196 INPUT_CONTROL_SET_BOOKMARK,
00197
00198 INPUT_CONTROL_SET_ES,
00199 INPUT_CONTROL_RESTART_ES,
00200
00201 INPUT_CONTROL_SET_AUDIO_DELAY,
00202 INPUT_CONTROL_SET_SPU_DELAY,
00203
00204 INPUT_CONTROL_ADD_SLAVE,
00205
00206 INPUT_CONTROL_ADD_SUBTITLE,
00207
00208 INPUT_CONTROL_SET_RECORD_STATE,
00209
00210 INPUT_CONTROL_SET_FRAME_NEXT,
00211 };
00212
00213
00214
00215
00216
00217
00218 void input_ControlPush( input_thread_t *, int i_type, vlc_value_t * );
00219
00220
00221 #define INPUT_PTS_DELAY_MAX INT64_C(60000000)
00222
00223
00224
00225
00226
00227
00228 void input_ExtractAttachmentAndCacheArt( input_thread_t *p_input );
00229
00230
00231
00232
00233
00234
00235 void input_ControlVarInit ( input_thread_t * );
00236 void input_ControlVarStop( input_thread_t * );
00237 void input_ControlVarNavigation( input_thread_t * );
00238 void input_ControlVarTitle( input_thread_t *, int i_title );
00239
00240 void input_ConfigVarInit ( input_thread_t * );
00241
00242
00243 char **subtitles_Detect( input_thread_t *, char* path, const char *fname );
00244 int subtitles_Filter( const char *);
00245
00246
00247 void input_SplitMRL( const char **, const char **, const char **,
00248 const char **, char * );
00249
00250 #endif