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