00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef LIBVLC_LIBVLC_H
00026 # define LIBVLC_LIBVLC_H 1
00027
00028 extern const char psz_vlc_changeset[];
00029
00030 typedef struct variable_t variable_t;
00031
00032
00033 struct vlc_actions;
00034 struct vlc_actions *vlc_InitActions (libvlc_int_t *);
00035 extern void vlc_DeinitActions (libvlc_int_t *, struct vlc_actions *);
00036
00037 size_t vlc_towc (const char *str, uint32_t *restrict pwc);
00038
00039
00040
00041
00042 void system_Init ( void );
00043 void system_Configure ( libvlc_int_t *, int, const char *const [] );
00044 void system_End ( void );
00045
00046 void vlc_CPU_init(void);
00047 void vlc_CPU_dump(vlc_object_t *);
00048
00049
00050
00051
00052
00053
00054 int vlc_clone_detach (vlc_thread_t *, void *(*)(void *), void *, int);
00055
00056 int vlc_object_waitpipe (vlc_object_t *obj);
00057
00058 int vlc_set_priority( vlc_thread_t, int );
00059
00060 void vlc_threads_setup (libvlc_int_t *);
00061
00062 void vlc_trace (const char *fn, const char *file, unsigned line);
00063 #define vlc_backtrace() vlc_trace(__func__, __FILE__, __LINE__)
00064
00065 #if defined (LIBVLC_USE_PTHREAD) && !defined (NDEBUG)
00066 void vlc_assert_locked (vlc_mutex_t *);
00067 #else
00068 # define vlc_assert_locked( m ) (void)m
00069 #endif
00070
00071
00072
00073
00074 typedef struct vlc_exit
00075 {
00076 vlc_mutex_t lock;
00077 void (*handler) (void *);
00078 void *opaque;
00079 bool killed;
00080 } vlc_exit_t;
00081
00082 void vlc_ExitInit( vlc_exit_t * );
00083 void vlc_ExitDestroy( vlc_exit_t * );
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102 extern void *
00103 vlc_custom_create (vlc_object_t *p_this, size_t i_size, const char *psz_type);
00104 #define vlc_custom_create(o, s, n) \
00105 vlc_custom_create(VLC_OBJECT(o), s, n)
00106
00107
00108
00109
00110 extern int vlc_object_set_name(vlc_object_t *, const char *);
00111 #define vlc_object_set_name(o, n) vlc_object_set_name(VLC_OBJECT(o), n)
00112
00113
00114 typedef void (*vlc_destructor_t) (struct vlc_object_t *);
00115 void vlc_object_set_destructor (vlc_object_t *, vlc_destructor_t);
00116 #define vlc_object_set_destructor(a,b) \
00117 vlc_object_set_destructor (VLC_OBJECT(a), b)
00118
00119
00120
00121
00122 module_t *module_find_by_shortcut (const char *psz_shortcut);
00123
00124
00125
00126
00127 typedef struct vlc_object_internals vlc_object_internals_t;
00128
00129 struct vlc_object_internals
00130 {
00131 char *psz_name;
00132
00133
00134 void *var_root;
00135 vlc_mutex_t var_lock;
00136 vlc_cond_t var_wait;
00137
00138
00139 int pipes[2];
00140
00141
00142 vlc_spinlock_t ref_spin;
00143 unsigned i_refcount;
00144 vlc_destructor_t pf_destructor;
00145
00146
00147 vlc_object_internals_t *next;
00148 vlc_object_internals_t *prev;
00149 vlc_object_internals_t *first;
00150 };
00151
00152 #define ZOOM_SECTION N_("Zoom")
00153 #define ZOOM_QUARTER_KEY_TEXT N_("1:4 Quarter")
00154 #define ZOOM_HALF_KEY_TEXT N_("1:2 Half")
00155 #define ZOOM_ORIGINAL_KEY_TEXT N_("1:1 Original")
00156 #define ZOOM_DOUBLE_KEY_TEXT N_("2:1 Double")
00157
00158 #define vlc_internals( obj ) (((vlc_object_internals_t*)(VLC_OBJECT(obj)))-1)
00159 #define vlc_externals( priv ) ((vlc_object_t *)((priv) + 1))
00160
00161 typedef struct sap_handler_t sap_handler_t;
00162
00163
00164
00165
00166 typedef struct libvlc_priv_t
00167 {
00168 libvlc_int_t public_data;
00169
00170 bool playlist_active;
00171
00172
00173 signed char i_verbose;
00174 bool b_color;
00175 bool b_stats;
00176
00177
00178 module_t *p_memcpy_module;
00179 playlist_t *p_playlist;
00180 struct media_library_t *p_ml;
00181 vlc_mutex_t ml_lock;
00182 vlm_t *p_vlm;
00183 vlc_object_t *p_dialog_provider;
00184 #ifdef ENABLE_SOUT
00185 sap_handler_t *p_sap;
00186 #endif
00187 struct vlc_actions *actions;
00188
00189
00190 struct intf_thread_t *p_intf;
00191
00192
00193 vlc_mutex_t structure_lock;
00194
00195
00196 vlc_exit_t exit;
00197 } libvlc_priv_t;
00198
00199 static inline libvlc_priv_t *libvlc_priv (libvlc_int_t *libvlc)
00200 {
00201 return (libvlc_priv_t *)libvlc;
00202 }
00203
00204 void playlist_ServicesDiscoveryKillAll( playlist_t *p_playlist );
00205 void intf_DestroyAll( libvlc_int_t * );
00206
00207 #define libvlc_stats( o ) (libvlc_priv((VLC_OBJECT(o))->p_libvlc)->b_stats)
00208
00209
00210
00211
00212 void var_OptionParse (vlc_object_t *, const char *, bool trusted);
00213
00214
00215
00216
00217 enum
00218 {
00219 STATS_COUNTER,
00220 STATS_DERIVATIVE,
00221 };
00222
00223 typedef struct counter_sample_t
00224 {
00225 uint64_t value;
00226 mtime_t date;
00227 } counter_sample_t;
00228
00229 typedef struct counter_t
00230 {
00231 int i_compute_type;
00232 int i_samples;
00233 counter_sample_t ** pp_samples;
00234
00235 mtime_t last_update;
00236 } counter_t;
00237
00238 enum
00239 {
00240 STATS_INPUT_BITRATE,
00241 STATS_READ_BYTES,
00242 STATS_READ_PACKETS,
00243 STATS_DEMUX_READ,
00244 STATS_DEMUX_BITRATE,
00245 STATS_DEMUX_CORRUPTED,
00246 STATS_DEMUX_DISCONTINUITY,
00247 STATS_PLAYED_ABUFFERS,
00248 STATS_LOST_ABUFFERS,
00249 STATS_DECODED_AUDIO,
00250 STATS_DECODED_VIDEO,
00251 STATS_DECODED_SUB,
00252 STATS_CLIENT_CONNECTIONS,
00253 STATS_ACTIVE_CONNECTIONS,
00254 STATS_SOUT_SENT_PACKETS,
00255 STATS_SOUT_SENT_BYTES,
00256 STATS_SOUT_SEND_BITRATE,
00257 STATS_DISPLAYED_PICTURES,
00258 STATS_LOST_PICTURES,
00259 };
00260
00261 counter_t * stats_CounterCreate (int);
00262 void stats_Update (counter_t *, uint64_t, uint64_t *);
00263 void stats_CounterClean (counter_t * );
00264
00265 void stats_ComputeInputStats(input_thread_t*, input_stats_t*);
00266 void stats_ReinitInputStats(input_stats_t *);
00267
00268 #endif