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
00026
00027 #ifndef VLC_MESSAGES_H_
00028 #define VLC_MESSAGES_H_
00029
00030
00031
00032
00033
00034
00035 #include <stdarg.h>
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 typedef struct
00049 {
00050 int i_type;
00051 uintptr_t i_object_id;
00052 const char *psz_object_type;
00053 char * psz_module;
00054 char * psz_msg;
00055 char * psz_header;
00056
00057 mtime_t date;
00058 gc_object_t vlc_gc_data;
00059 } msg_item_t;
00060
00061
00062
00063 #define VLC_MSG_INFO 0
00064
00065 #define VLC_MSG_ERR 1
00066
00067 #define VLC_MSG_WARN 2
00068
00069 #define VLC_MSG_DBG 3
00070
00071 static inline msg_item_t *msg_Hold (msg_item_t *msg)
00072 {
00073 vlc_hold (&msg->vlc_gc_data);
00074 return msg;
00075 }
00076
00077 static inline void msg_Release (msg_item_t *msg)
00078 {
00079 vlc_release (&msg->vlc_gc_data);
00080 }
00081
00082
00083
00084
00085 typedef struct msg_subscription_t msg_subscription_t;
00086
00087
00088
00089
00090 VLC_EXPORT( void, __msg_Generic, ( vlc_object_t *, int, const char *, const char *, ... ) LIBVLC_FORMAT( 4, 5 ) );
00091 VLC_EXPORT( void, __msg_GenericVa, ( vlc_object_t *, int, const char *, const char *, va_list args ) );
00092 #define msg_GenericVa(a, b, c, d, e) __msg_GenericVa(VLC_OBJECT(a), b, c, d, e)
00093
00094 #define msg_Info( p_this, ... ) \
00095 __msg_Generic( VLC_OBJECT(p_this), VLC_MSG_INFO, \
00096 MODULE_STRING, __VA_ARGS__ )
00097 #define msg_Err( p_this, ... ) \
00098 __msg_Generic( VLC_OBJECT(p_this), VLC_MSG_ERR, \
00099 MODULE_STRING, __VA_ARGS__ )
00100 #define msg_Warn( p_this, ... ) \
00101 __msg_Generic( VLC_OBJECT(p_this), VLC_MSG_WARN, \
00102 MODULE_STRING, __VA_ARGS__ )
00103 #define msg_Dbg( p_this, ... ) \
00104 __msg_Generic( VLC_OBJECT(p_this), VLC_MSG_DBG, \
00105 MODULE_STRING, __VA_ARGS__ )
00106
00107 typedef struct msg_cb_data_t msg_cb_data_t;
00108
00109
00110
00111
00112
00113 typedef void (*msg_callback_t) (msg_cb_data_t *, msg_item_t *, unsigned);
00114
00115 VLC_EXPORT( msg_subscription_t*, msg_Subscribe, ( libvlc_int_t *, msg_callback_t, msg_cb_data_t * ) );
00116 VLC_EXPORT( void, msg_Unsubscribe, ( msg_subscription_t * ) );
00117
00118
00119 #define msg_EnableObjectPrinting(a,b) __msg_EnableObjectPrinting(VLC_OBJECT(a),b)
00120 #define msg_DisableObjectPrinting(a,b) __msg_DisableObjectPrinting(VLC_OBJECT(a),b)
00121 VLC_EXPORT( void, __msg_EnableObjectPrinting, ( vlc_object_t *, char * psz_object ) );
00122 VLC_EXPORT( void, __msg_DisableObjectPrinting, ( vlc_object_t *, char * psz_object ) );
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137 enum
00138 {
00139 STATS_LAST,
00140 STATS_COUNTER,
00141 STATS_MAX,
00142 STATS_MIN,
00143 STATS_DERIVATIVE,
00144 STATS_TIMER
00145 };
00146
00147 struct counter_sample_t
00148 {
00149 vlc_value_t value;
00150 mtime_t date;
00151 };
00152
00153 struct counter_t
00154 {
00155 unsigned int i_id;
00156 char * psz_name;
00157 int i_type;
00158 void * p_obj;
00159 int i_compute_type;
00160 int i_samples;
00161 counter_sample_t ** pp_samples;
00162
00163 mtime_t update_interval;
00164 mtime_t last_update;
00165 };
00166
00167 enum
00168 {
00169 STATS_INPUT_BITRATE,
00170 STATS_READ_BYTES,
00171 STATS_READ_PACKETS,
00172 STATS_DEMUX_READ,
00173 STATS_DEMUX_BITRATE,
00174 STATS_DEMUX_CORRUPTED,
00175 STATS_DEMUX_DISCONTINUITY,
00176 STATS_PLAYED_ABUFFERS,
00177 STATS_LOST_ABUFFERS,
00178 STATS_DECODED_AUDIO,
00179 STATS_DECODED_VIDEO,
00180 STATS_DECODED_SUB,
00181 STATS_CLIENT_CONNECTIONS,
00182 STATS_ACTIVE_CONNECTIONS,
00183 STATS_SOUT_SENT_PACKETS,
00184 STATS_SOUT_SENT_BYTES,
00185 STATS_SOUT_SEND_BITRATE,
00186 STATS_DISPLAYED_PICTURES,
00187 STATS_LOST_PICTURES,
00188
00189 STATS_TIMER_PLAYLIST_BUILD,
00190 STATS_TIMER_ML_LOAD,
00191 STATS_TIMER_ML_DUMP,
00192 STATS_TIMER_INTERACTION,
00193 STATS_TIMER_PREPARSE,
00194 STATS_TIMER_INPUT_LAUNCHING,
00195 STATS_TIMER_MODULE_NEED,
00196 STATS_TIMER_VIDEO_FRAME_ENCODING,
00197 STATS_TIMER_AUDIO_FRAME_ENCODING,
00198
00199 STATS_TIMER_SKINS_PLAYTREE_IMAGE,
00200 };
00201
00202
00203
00204
00205 #define stats_TimerStart(a,b,c) __stats_TimerStart( VLC_OBJECT(a), b,c )
00206 #define stats_TimerStop(a,b) __stats_TimerStop( VLC_OBJECT(a), b )
00207 #define stats_TimerDump(a,b) __stats_TimerDump( VLC_OBJECT(a), b )
00208 #define stats_TimersDumpAll(a) __stats_TimersDumpAll( VLC_OBJECT(a) )
00209 VLC_EXPORT( void,__stats_TimerStart, (vlc_object_t*, const char *, unsigned int ) );
00210 VLC_EXPORT( void,__stats_TimerStop, (vlc_object_t*, unsigned int) );
00211 VLC_EXPORT( void,__stats_TimerDump, (vlc_object_t*, unsigned int) );
00212 VLC_EXPORT( void,__stats_TimersDumpAll, (vlc_object_t*) );
00213 #define stats_TimersCleanAll(a) __stats_TimersCleanAll( VLC_OBJECT(a) )
00214 VLC_EXPORT( void, __stats_TimersCleanAll, (vlc_object_t * ) );
00215
00216 #define stats_TimerClean(a,b) __stats_TimerClean( VLC_OBJECT(a), b )
00217 VLC_EXPORT( void, __stats_TimerClean, (vlc_object_t *, unsigned int ) );
00218
00219
00220
00221
00222 #endif