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 * ) LIBVLC_USED );
00116 VLC_EXPORT( void, msg_Unsubscribe, ( msg_subscription_t * ) );
00117 VLC_EXPORT( void, msg_SubscriptionSetVerbosity, ( msg_subscription_t *, const int) );
00118
00119
00120 VLC_EXPORT( void, msg_EnableObjectPrinting, ( vlc_object_t *, const char * psz_object ) );
00121 #define msg_EnableObjectPrinting(a,b) msg_EnableObjectPrinting(VLC_OBJECT(a),b)
00122 VLC_EXPORT( void, msg_DisableObjectPrinting, ( vlc_object_t *, const char * psz_object ) );
00123 #define msg_DisableObjectPrinting(a,b) msg_DisableObjectPrinting(VLC_OBJECT(a),b)
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139 enum
00140 {
00141 STATS_LAST,
00142 STATS_COUNTER,
00143 STATS_MAX,
00144 STATS_MIN,
00145 STATS_DERIVATIVE,
00146 STATS_TIMER
00147 };
00148
00149 struct counter_sample_t
00150 {
00151 vlc_value_t value;
00152 mtime_t date;
00153 };
00154
00155 struct counter_t
00156 {
00157 unsigned int i_id;
00158 char * psz_name;
00159 int i_type;
00160 void * p_obj;
00161 int i_compute_type;
00162 int i_samples;
00163 counter_sample_t ** pp_samples;
00164
00165 mtime_t update_interval;
00166 mtime_t last_update;
00167 };
00168
00169 enum
00170 {
00171 STATS_INPUT_BITRATE,
00172 STATS_READ_BYTES,
00173 STATS_READ_PACKETS,
00174 STATS_DEMUX_READ,
00175 STATS_DEMUX_BITRATE,
00176 STATS_DEMUX_CORRUPTED,
00177 STATS_DEMUX_DISCONTINUITY,
00178 STATS_PLAYED_ABUFFERS,
00179 STATS_LOST_ABUFFERS,
00180 STATS_DECODED_AUDIO,
00181 STATS_DECODED_VIDEO,
00182 STATS_DECODED_SUB,
00183 STATS_CLIENT_CONNECTIONS,
00184 STATS_ACTIVE_CONNECTIONS,
00185 STATS_SOUT_SENT_PACKETS,
00186 STATS_SOUT_SENT_BYTES,
00187 STATS_SOUT_SEND_BITRATE,
00188 STATS_DISPLAYED_PICTURES,
00189 STATS_LOST_PICTURES,
00190
00191 STATS_TIMER_PLAYLIST_BUILD,
00192 STATS_TIMER_ML_LOAD,
00193 STATS_TIMER_ML_DUMP,
00194 STATS_TIMER_INTERACTION,
00195 STATS_TIMER_PREPARSE,
00196 STATS_TIMER_INPUT_LAUNCHING,
00197 STATS_TIMER_MODULE_NEED,
00198 STATS_TIMER_VIDEO_FRAME_ENCODING,
00199 STATS_TIMER_AUDIO_FRAME_ENCODING,
00200
00201 STATS_TIMER_SKINS_PLAYTREE_IMAGE,
00202 };
00203
00204
00205
00206
00207 VLC_EXPORT( void, stats_TimerStart, (vlc_object_t*, const char *, unsigned int ) );
00208 VLC_EXPORT( void, stats_TimerStop, (vlc_object_t*, unsigned int) );
00209 VLC_EXPORT( void, stats_TimerDump, (vlc_object_t*, unsigned int) );
00210 VLC_EXPORT( void, stats_TimersDumpAll, (vlc_object_t*) );
00211 #define stats_TimerStart(a,b,c) stats_TimerStart( VLC_OBJECT(a), b,c )
00212 #define stats_TimerStop(a,b) stats_TimerStop( VLC_OBJECT(a), b )
00213 #define stats_TimerDump(a,b) stats_TimerDump( VLC_OBJECT(a), b )
00214 #define stats_TimersDumpAll(a) stats_TimersDumpAll( VLC_OBJECT(a) )
00215
00216 VLC_EXPORT( void, stats_TimersCleanAll, (vlc_object_t * ) );
00217 #define stats_TimersCleanAll(a) stats_TimersCleanAll( VLC_OBJECT(a) )
00218
00219 VLC_EXPORT( void, stats_TimerClean, (vlc_object_t *, unsigned int ) );
00220 #define stats_TimerClean(a,b) stats_TimerClean( VLC_OBJECT(a), b )
00221
00222
00223
00224
00225 #endif