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 typedef struct variable_t variable_t;
00029
00030
00031 typedef struct action
00032 {
00033 char name[24];
00034 int value;
00035 } action_t;
00036 extern const struct action libvlc_actions[];
00037 extern const size_t libvlc_actions_count;
00038 extern int vlc_key_to_action (vlc_object_t *, const char *,
00039 vlc_value_t, vlc_value_t, void *);
00040
00041
00042
00043
00044 void system_Init ( libvlc_int_t *, int *, const char *[] );
00045 void system_Configure ( libvlc_int_t *, int *, const char *[] );
00046 void system_End ( libvlc_int_t * );
00047
00048
00049
00050
00051 #define vlc_object_signal_unlocked( obj )
00052
00053 vlc_list_t *vlc_list_find( vlc_object_t *, int, int );
00054
00055
00056
00057
00058
00059
00060 void vlc_detach (vlc_thread_t);
00061
00062
00063 void vlc_thread_cancel (vlc_object_t *);
00064 int vlc_object_waitpipe (vlc_object_t *obj);
00065
00066 void vlc_threads_setup (libvlc_int_t *);
00067
00068 void vlc_trace (const char *fn, const char *file, unsigned line);
00069 #define vlc_backtrace() vlc_trace(__func__, __FILE__, __LINE__)
00070
00071 #if defined (LIBVLC_USE_PTHREAD) && !defined (NDEBUG)
00072 void vlc_assert_locked (vlc_mutex_t *);
00073 #else
00074 # define vlc_assert_locked( m ) (void)m
00075 #endif
00076
00077
00078
00079
00080 extern uint32_t cpu_flags;
00081 uint32_t CPUCapabilities( void );
00082
00083
00084
00085
00086
00087
00088
00089
00090 typedef struct msg_bank_t
00091 {
00092
00093 vlc_rwlock_t lock;
00094
00095
00096 int i_sub;
00097 msg_subscription_t **pp_sub;
00098
00099
00100 #ifdef UNDER_CE
00101 FILE *logfile;
00102 #endif
00103 } msg_bank_t;
00104
00105 void msg_Create (libvlc_int_t *);
00106 void msg_Destroy (libvlc_int_t *);
00107
00108
00109 void msg_StackSet ( int, const char*, ... );
00110 void msg_StackAdd ( const char*, ... );
00111 const char* msg_StackMsg ( void );
00112 void msg_StackDestroy (void *);
00113
00114
00115
00116
00117 char *vlc_fix_readdir (const char *);
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137 extern void *
00138 __vlc_custom_create (vlc_object_t *p_this, size_t i_size, int i_type,
00139 const char *psz_type);
00140 #define vlc_custom_create(o, s, t, n) \
00141 __vlc_custom_create(VLC_OBJECT(o), s, t, n)
00142
00143
00144
00145
00146 extern int vlc_object_set_name(vlc_object_t *, const char *);
00147 #define vlc_object_set_name(o, n) vlc_object_set_name(VLC_OBJECT(o), n)
00148
00149
00150
00151
00152 extern char *psz_vlcpath;
00153
00154
00155
00156
00157 char **module_GetModulesNamesForCapability (const char * psz_capability,
00158 char ***psz_longname);
00159 module_t *module_find_by_shortcut (const char *psz_shortcut);
00160
00161
00162
00163
00164 typedef struct vlc_object_internals_t
00165 {
00166 int i_object_type;
00167 char *psz_name;
00168
00169
00170 variable_t * p_vars;
00171 vlc_mutex_t var_lock;
00172 vlc_cond_t var_wait;
00173 int i_vars;
00174
00175
00176 vlc_thread_t thread_id;
00177 bool b_thread;
00178
00179
00180 int pipes[2];
00181
00182
00183 vlc_spinlock_t ref_spin;
00184 unsigned i_refcount;
00185 vlc_destructor_t pf_destructor;
00186
00187
00188 vlc_object_t **pp_children;
00189 int i_children;
00190 } vlc_object_internals_t;
00191
00192 #define ZOOM_SECTION N_("Zoom")
00193 #define ZOOM_QUARTER_KEY_TEXT N_("1:4 Quarter")
00194 #define ZOOM_HALF_KEY_TEXT N_("1:2 Half")
00195 #define ZOOM_ORIGINAL_KEY_TEXT N_("1:1 Original")
00196 #define ZOOM_DOUBLE_KEY_TEXT N_("2:1 Double")
00197
00198 #define vlc_internals( obj ) (((vlc_object_internals_t*)(VLC_OBJECT(obj)))-1)
00199
00200 typedef struct sap_handler_t sap_handler_t;
00201
00202
00203
00204
00205 typedef struct libvlc_priv_t
00206 {
00207 libvlc_int_t public_data;
00208 vlc_cond_t exiting;
00209
00210 int i_last_input_id ;
00211
00212
00213 msg_bank_t msg_bank;
00214 int i_verbose;
00215 bool b_color;
00216 vlc_dictionary_t msg_enabled_objects;
00217 bool msg_all_objects_enabled;
00218
00219
00220 vlc_mutex_t timer_lock;
00221 counter_t **pp_timers;
00222 int i_timers;
00223 bool b_stats;
00224
00225
00226 module_t *p_memcpy_module;
00227 playlist_t *p_playlist;
00228 vlm_t *p_vlm;
00229 vlc_object_t *p_dialog_provider;
00230 httpd_t *p_httpd;
00231 #ifdef ENABLE_SOUT
00232 sap_handler_t *p_sap;
00233 #endif
00234
00235
00236 struct intf_thread_t *p_intf;
00237
00238
00239 vlc_mutex_t structure_lock;
00240 } libvlc_priv_t;
00241
00242 static inline libvlc_priv_t *libvlc_priv (libvlc_int_t *libvlc)
00243 {
00244 return (libvlc_priv_t *)libvlc;
00245 }
00246
00247 void playlist_ServicesDiscoveryKillAll( playlist_t *p_playlist );
00248 void intf_DestroyAll( libvlc_int_t * );
00249
00250 #define libvlc_stats( o ) (libvlc_priv((VLC_OBJECT(o))->p_libvlc)->b_stats)
00251
00252
00253
00254
00255 extern module_config_t libvlc_config[];
00256 extern const size_t libvlc_config_count;
00257
00258
00259
00260
00261 void var_OptionParse (vlc_object_t *, const char *, bool trusted);
00262
00263
00264
00265
00266
00267 #define stats_Update(a,b,c) __stats_Update( VLC_OBJECT(a), b, c )
00268 int __stats_Update (vlc_object_t*, counter_t *, vlc_value_t, vlc_value_t *);
00269 #define stats_CounterCreate(a,b,c) __stats_CounterCreate( VLC_OBJECT(a), b, c )
00270 counter_t * __stats_CounterCreate (vlc_object_t*, int, int);
00271 #define stats_Get(a,b,c) __stats_Get( VLC_OBJECT(a), b, c)
00272 int __stats_Get (vlc_object_t*, counter_t *, vlc_value_t*);
00273
00274 void stats_CounterClean (counter_t * );
00275
00276 #define stats_GetInteger(a,b,c) __stats_GetInteger( VLC_OBJECT(a), b, c )
00277 static inline int __stats_GetInteger( vlc_object_t *p_obj, counter_t *p_counter,
00278 int *value )
00279 {
00280 int i_ret;
00281 vlc_value_t val; val.i_int = 0;
00282 if( !p_counter ) return VLC_EGENERIC;
00283 i_ret = __stats_Get( p_obj, p_counter, &val );
00284 *value = val.i_int;
00285 return i_ret;
00286 }
00287
00288 #define stats_GetFloat(a,b,c) __stats_GetFloat( VLC_OBJECT(a), b, c )
00289 static inline int __stats_GetFloat( vlc_object_t *p_obj, counter_t *p_counter,
00290 float *value )
00291 {
00292 int i_ret;
00293 vlc_value_t val; val.f_float = 0.0;
00294 if( !p_counter ) return VLC_EGENERIC;
00295 i_ret = __stats_Get( p_obj, p_counter, &val );
00296 *value = val.f_float;
00297 return i_ret;
00298 }
00299 #define stats_UpdateInteger(a,b,c,d) __stats_UpdateInteger( VLC_OBJECT(a),b,c,d )
00300 static inline int __stats_UpdateInteger( vlc_object_t *p_obj,counter_t *p_co,
00301 int i, int *pi_new )
00302 {
00303 int i_ret;
00304 vlc_value_t val;
00305 vlc_value_t new_val; new_val.i_int = 0;
00306 if( !p_co ) return VLC_EGENERIC;
00307 val.i_int = i;
00308 i_ret = __stats_Update( p_obj, p_co, val, &new_val );
00309 if( pi_new )
00310 *pi_new = new_val.i_int;
00311 return i_ret;
00312 }
00313 #define stats_UpdateFloat(a,b,c,d) __stats_UpdateFloat( VLC_OBJECT(a),b,c,d )
00314 static inline int __stats_UpdateFloat( vlc_object_t *p_obj, counter_t *p_co,
00315 float f, float *pf_new )
00316 {
00317 vlc_value_t val;
00318 int i_ret;
00319 vlc_value_t new_val;new_val.f_float = 0.0;
00320 if( !p_co ) return VLC_EGENERIC;
00321 val.f_float = f;
00322 i_ret = __stats_Update( p_obj, p_co, val, &new_val );
00323 if( pf_new )
00324 *pf_new = new_val.f_float;
00325 return i_ret;
00326 }
00327
00328 VLC_EXPORT( void, stats_ComputeInputStats, (input_thread_t*, input_stats_t*) );
00329 VLC_EXPORT( void, stats_ReinitInputStats, (input_stats_t *) );
00330 VLC_EXPORT( void, stats_DumpInputStats, (input_stats_t *) );
00331
00332
00333
00334
00335 # ifndef HAVE_DIRENT_H
00336 typedef void DIR;
00337 # ifndef FILENAME_MAX
00338 # define FILENAME_MAX (260)
00339 # endif
00340 struct dirent
00341 {
00342 long d_ino;
00343 unsigned short d_reclen;
00344 unsigned short d_namlen;
00345 char d_name[FILENAME_MAX];
00346 };
00347 # define opendir vlc_opendir
00348 # define readdir vlc_readdir
00349 # define closedir vlc_closedir
00350 # define rewinddir vlc_rewindir
00351 void *vlc_opendir (const char *);
00352 void *vlc_readdir (void *);
00353 int vlc_closedir(void *);
00354 void vlc_rewinddir(void *);
00355 # endif
00356
00357 #if defined (WIN32)
00358 # include <dirent.h>
00359 void *vlc_wopendir (const wchar_t *);
00360
00361 struct _wdirent *vlc_wreaddir (void *);
00362 void vlc_rewinddir (void *);
00363 # define _wopendir vlc_wopendir
00364 # define _wreaddir vlc_wreaddir
00365 # define _wclosedir vlc_wclosedir
00366 # define rewinddir vlc_rewinddir
00367 #endif
00368
00369 #endif