optimized debugging.
[platform/upstream/gstreamer.git] / gst / gstinfo.h
1 /* GStreamer
2  * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3  *                    2000 Wim Taymans <wtay@chello.be>
4  *                    2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
5  *
6  * gstinfo.h: debugging functions
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23
24 #ifndef __GSTINFO_H__
25 #define __GSTINFO_H__
26
27 #include <glib.h>
28 #include <glib-object.h>
29 #include <gst/gstatomic.h>
30 #include <gst/gstlog.h>
31 #include <gst/gstconfig.h>
32
33 G_BEGIN_DECLS
34
35 /*
36  * GStreamer's debugging subsystem is an easy way to get information about what
37  * the application is doing.
38  * It is not meant for programming errors. Use GLibs methods (g_warning and so
39  * on for that.
40  */
41
42 /* log levels */
43 typedef enum {
44   GST_LEVEL_NONE = 0,
45   GST_LEVEL_ERROR,
46   GST_LEVEL_WARNING,
47   GST_LEVEL_INFO,
48   GST_LEVEL_DEBUG,
49   GST_LEVEL_LOG,
50   /* add more */
51   GST_LEVEL_COUNT
52 } GstDebugLevel;
53
54 /* we can now override this to be more general in maintainer builds or cvs checkouts */
55 #ifndef GST_LEVEL_DEFAULT
56 #define GST_LEVEL_DEFAULT GST_LEVEL_ERROR 
57 #endif
58
59 /* defines for format (colors etc) - don't change them around, it uses terminal layout 
60  * Terminal color strings:
61  * 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
62  * Text color codes:
63  * 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
64  * Background color codes:
65  * 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
66  */
67 typedef enum {
68   /* colors */
69   GST_DEBUG_FG_BLACK            = 0x0000,
70   GST_DEBUG_FG_RED              = 0x0001,
71   GST_DEBUG_FG_GREEN            = 0x0002,
72   GST_DEBUG_FG_YELLOW           = 0x0003,
73   GST_DEBUG_FG_BLUE             = 0x0004,
74   GST_DEBUG_FG_MAGENTA          = 0x0005,
75   GST_DEBUG_FG_CYAN             = 0x0006,
76   GST_DEBUG_FG_WHITE            = 0x0007,
77   /* background colors */
78   GST_DEBUG_BG_BLACK            = 0x0000,
79   GST_DEBUG_BG_RED              = 0x0010,
80   GST_DEBUG_BG_GREEN            = 0x0020,
81   GST_DEBUG_BG_YELLOW           = 0x0030,
82   GST_DEBUG_BG_BLUE             = 0x0040,
83   GST_DEBUG_BG_MAGENTA          = 0x0050,
84   GST_DEBUG_BG_CYAN             = 0x0060,
85   GST_DEBUG_BG_WHITE            = 0x0070,
86   /* other formats */
87   GST_DEBUG_BOLD                = 0x0100,
88   GST_DEBUG_UNDERLINE           = 0x0200
89 } GstDebugColorFlags;
90
91 #define GST_DEBUG_FG_MASK       (0x000F)
92 #define GST_DEBUG_BG_MASK       (0x00F0)
93 #define GST_DEBUG_FORMAT_MASK   (0xFF00)
94
95 typedef struct _GstDebugCategory GstDebugCategory;
96 struct _GstDebugCategory {
97   /*< private >*/
98   GstAtomicInt *        threshold;
99   guint                 color;          /* see defines above */
100
101   const gchar *         name;
102   const gchar *         description;
103 };
104
105 /********** some convenience macros for debugging **********/
106
107 /* This is needed in printf's if a char* might be NULL. Solaris crashes then */
108 #define GST_STR_NULL(str) ((str) ? (str) : "(NULL)")
109
110 /* easier debugging for pad names */
111 #define GST_DEBUG_PAD_NAME(pad) \
112   (GST_OBJECT_PARENT(pad) != NULL) ? \
113   GST_STR_NULL (GST_OBJECT_NAME (GST_OBJECT_PARENT(pad))) : \
114   "''", GST_OBJECT_NAME (pad)
115
116 /* You might want to define GST_FUNCTION in apps' configure script */
117
118 #ifndef GST_FUNCTION
119 #ifdef G_GNUC_PRETTY_FUNCTION
120 #define GST_FUNCTION G_GNUC_PRETTY_FUNCTION
121 #elif HAVE_FUNC
122 #define GST_FUNCTION __func__
123 #elif HAVE_PRETTY_FUNCTION
124 #define GST_FUNCTION __PRETTY_FUNCTION__
125 #elif HAVE_FUNCTION
126 #define GST_FUNCTION __FUNCTION__
127 #else
128 #define GST_FUNCTION ""
129 #endif
130 #endif /* ifndef GST_FUNCTION */
131
132 typedef void (*GstLogFunction)  (GstDebugCategory *     category,
133                                  GstDebugLevel          level,
134                                  const gchar *          file,
135                                  const gchar *          function,
136                                  gint                   line,
137                                  GObject *              object,
138                                  gchar *                message,
139                                  gpointer               data);
140
141 /* Disable this subsystem if no varargs macro can be found. 
142    Use a trick so the core builds the functions nonetheless if it wasn't
143    explicitly disabled. */
144 #if !defined(G_HAVE_ISO_VARARGS) && !defined(G_HAVE_GNUC_VARARGS)
145 #define __GST_DISABLE_GST_DEBUG
146 #endif
147 #ifdef GST_DISABLE_GST_DEBUG
148 #ifndef __GST_DISABLE_GST_DEBUG
149 #define __GST_DISABLE_GST_DEBUG
150 #endif
151 #endif
152
153 #ifndef __GST_DISABLE_GST_DEBUG
154
155 void            _gst_debug_init                 (void);
156
157 void            gst_debug_log                   (GstDebugCategory *     category,
158                                                  GstDebugLevel          level,
159                                                  const gchar *          file,
160                                                  const gchar *          function,
161                                                  gint                   line,
162                                                  GObject *              object,
163                                                  gchar *                format,
164                                                  ...)  G_GNUC_PRINTF (7, 8) G_GNUC_NO_INSTRUMENT;
165 void            gst_debug_logv                  (GstDebugCategory *     category,
166                                                  GstDebugLevel          level,
167                                                  const gchar *          file,
168                                                  const gchar *          function,
169                                                  gint                   line,
170                                                  GObject *              object,
171                                                  gchar *                format,
172                                                  va_list                args) G_GNUC_NO_INSTRUMENT;
173
174 void            gst_debug_log_default           (GstDebugCategory *     category,
175                                                  GstDebugLevel          level,
176                                                  const gchar *          file,
177                                                  const gchar *          function,
178                                                  gint                   line,
179                                                  GObject *              object,
180                                                  gchar *                message,
181                                                  gpointer               unused) G_GNUC_NO_INSTRUMENT;
182
183 const gchar *   gst_debug_level_get_name        (GstDebugLevel          level);
184
185 void            gst_debug_add_log_function      (GstLogFunction         func,
186                                                  gpointer data);
187 guint           gst_debug_remove_log_function   (GstLogFunction         func);
188 guint           gst_debug_remove_log_function_by_data (gpointer         data);
189
190 void            gst_debug_set_active            (gboolean active);
191 gboolean        gst_debug_is_active             (void);
192
193 void            gst_debug_set_colored           (gboolean colored);
194 gboolean        gst_debug_is_colored            (void);
195
196 void            gst_debug_set_default_threshold (GstDebugLevel          level);
197 GstDebugLevel   gst_debug_get_default_threshold (void);
198 void            gst_debug_set_threshold_for_name (const gchar *         name,
199                                                  GstDebugLevel          level);
200 void            gst_debug_unset_threshold_for_name (const gchar *       name);
201
202 /**
203  * GST_DEBUG_CATEGORY:
204  * @cat: the category
205  * 
206  * Defines a GstCategory variable.
207  * This macro expands to nothing if debugging is disabled.
208  */
209 #define GST_DEBUG_CATEGORY(cat) GstDebugCategory *cat = NULL
210 /**
211  * GST_DEBUG_CATEGORY_EXTERN:
212  * @cat: the category
213  * 
214  * Defines an extern GstCategory variable. Use in header files.
215  * This macro expands to nothing if debugging is disabled.
216  */
217 #define GST_DEBUG_CATEGORY_EXTERN(cat) extern GstDebugCategory *cat
218 /**
219  * GST_DEBUG_CATEGORY_STATIC:
220  * @cat: the category
221  * 
222  * Defines a static GstCategory variable.
223  * This macro expands to nothing if debugging is disabled.
224  */
225 #define GST_DEBUG_CATEGORY_STATIC(cat) static GstDebugCategory *cat = NULL
226 /* do not use this function, use the macros below */
227 GstDebugCategory *_gst_debug_category_new       (gchar *                name,
228                                                  guint                  color,
229                                                  gchar *                description);
230 /**
231  * GST_DEBUG_CATEGORY_INIT:
232  * @cat: the category to initialize
233  * @name: the name of the category
234  * @color: the colors to use for a color representation or 0 for no color
235  * @description: optional description of the category
236  * 
237  * Creates a new #GstDebugCategory cat with the given properties and sets it to
238  * the default threshold.
239  * This macro expands to nothing if debugging is disabled.
240  * <note>
241  * <para>
242  * When naming your category, please follow the following definitions to ensure
243  * that the pattern matching for categories works as expected. It is not
244  * earth-shattering if you don't follow these conventions, but it would be nice
245  * for everyone.
246  * </para>
247  * <para>
248  * If you define a category for a plugin or a feature of it, name the category 
249  * like the feature. So if you wanted to write a "filesrc" element, you would 
250  * name the category "filesrc". Use lowercase letters only.
251  * If you define more than one category for the same element, append an 
252  * underscore and an identifier to your categories, like this: "filesrc_cache"
253  * </para>
254  * <para>
255  * If you create a library or an application using debugging categories, use a
256  * common prefix followed by an underscore for all your categories. GStreamer
257  * uses the GST prefix so GStreamer categories look like "GST_STATES". Be sure
258  * to include uppercase letters.
259  * </para>
260  * </note>
261  */
262 #define GST_DEBUG_CATEGORY_INIT(cat,name,color,description) G_STMT_START{       \
263   if (cat == NULL)                                                              \
264     cat = _gst_debug_category_new (name,color,description);                     \
265 }G_STMT_END
266 void            gst_debug_category_free         (GstDebugCategory *     category);
267 void            gst_debug_category_set_threshold (GstDebugCategory *    category,
268                                                  GstDebugLevel          level);
269 void            gst_debug_category_reset_threshold (GstDebugCategory *  category);
270 GstDebugLevel   gst_debug_category_get_threshold (GstDebugCategory *    category);
271 const gchar *   gst_debug_category_get_name     (GstDebugCategory *     category);
272 guint           gst_debug_category_get_color    (GstDebugCategory *     category);
273 const gchar *   gst_debug_category_get_description (GstDebugCategory *  category);
274 GSList *        gst_debug_get_all_categories    (void);
275
276 gchar *         gst_debug_construct_term_color  (guint colorinfo);
277
278
279 extern GstDebugCategory *       GST_CAT_DEFAULT;
280 /* this symbol may not be used */
281 extern gboolean                 __gst_debug_enabled;
282 #ifdef G_HAVE_ISO_VARARGS
283 #define GST_CAT_LEVEL_LOG(cat,level,object,...) G_STMT_START{                   \
284   if (__gst_debug_enabled) {                            \
285     gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, (GObject *) (object), __VA_ARGS__); \
286   }                                                                             \
287 }G_STMT_END
288 #else /* G_HAVE_GNUC_VARARGS */
289 #define GST_CAT_LEVEL_LOG(cat,level,object,args...) G_STMT_START{                       \
290   if (__gst_debug_enabled) {                            \
291     gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, (GObject *) (object), ##args ); \
292   }                                                                             \
293 }G_STMT_END
294 #endif /* G_HAVE_ISO_VARARGS */
295
296 #ifndef GST_DEBUG_ENABLE_DEPRECATED
297
298 #ifdef G_HAVE_ISO_VARARGS
299
300 #define GST_CAT_ERROR_OBJECT(cat,obj,...)       GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR,   obj,  __VA_ARGS__)
301 #define GST_CAT_WARNING_OBJECT(cat,obj,...)     GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, obj,  __VA_ARGS__)
302 #define GST_CAT_INFO_OBJECT(cat,obj,...)        GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO,    obj,  __VA_ARGS__)
303 #define GST_CAT_DEBUG_OBJECT(cat,obj,...)       GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG,   obj,  __VA_ARGS__)
304 #define GST_CAT_LOG_OBJECT(cat,obj,...)         GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG,     obj,  __VA_ARGS__)
305
306 #define GST_CAT_ERROR(cat,...)                  GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR,   NULL, __VA_ARGS__)
307 #define GST_CAT_WARNING(cat,...)                GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
308 #define GST_CAT_INFO(cat,...)                   GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO,    NULL, __VA_ARGS__)
309 #define GST_CAT_DEBUG(cat,...)                  GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG,   NULL, __VA_ARGS__)
310 #define GST_CAT_LOG(cat,...)                    GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG,     NULL, __VA_ARGS__)
311
312 #define GST_ERROR_OBJECT(obj,...)       GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR,   obj,  __VA_ARGS__)
313 #define GST_WARNING_OBJECT(obj,...)     GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj,  __VA_ARGS__)
314 #define GST_INFO_OBJECT(obj,...)        GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO,    obj,  __VA_ARGS__)
315 #define GST_DEBUG_OBJECT(obj,...)       GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   obj,  __VA_ARGS__)
316 #define GST_LOG_OBJECT(obj,...)         GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG,     obj,  __VA_ARGS__)
317
318 #define GST_ERROR(...)                  GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR,   NULL, __VA_ARGS__)
319 #define GST_WARNING(...)                GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
320 #define GST_INFO(...)                   GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO,    NULL, __VA_ARGS__)
321 #define GST_DEBUG(...)                  GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   NULL, __VA_ARGS__)
322 #define GST_LOG(...)                    GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG,     NULL, __VA_ARGS__)
323
324 #else /* G_HAVE_GNUC_VARARGS */
325
326 #define GST_CAT_ERROR_OBJECT(cat,obj,args...)   GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR,   obj,  ##args )
327 #define GST_CAT_WARNING_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, obj,  ##args )
328 #define GST_CAT_INFO_OBJECT(cat,obj,args...)    GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO,    obj,  ##args )
329 #define GST_CAT_DEBUG_OBJECT(cat,obj,args...)   GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG,   obj,  ##args )
330 #define GST_CAT_LOG_OBJECT(cat,obj,args...)     GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG,     obj,  ##args )
331
332 #define GST_CAT_ERROR(cat,args...)              GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR,   NULL, ##args )
333 #define GST_CAT_WARNING(cat,args...)            GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, NULL, ##args )
334 #define GST_CAT_INFO(cat,args...)               GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO,    NULL, ##args )
335 #define GST_CAT_DEBUG(cat,args...)              GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG,   NULL, ##args )
336 #define GST_CAT_LOG(cat,args...)                GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG,     NULL, ##args )
337
338 #define GST_ERROR_OBJECT(obj,args...)   GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR,   obj,  ##args )
339 #define GST_WARNING_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj,  ##args )
340 #define GST_INFO_OBJECT(obj,args...)    GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO,    obj,  ##args )
341 #define GST_DEBUG_OBJECT(obj,args...)   GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   obj,  ##args )
342 #define GST_LOG_OBJECT(obj,args...)     GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG,     obj,  ##args )
343
344 #define GST_ERROR(args...)              GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR,   NULL, ##args )
345 #define GST_WARNING(args...)            GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, ##args )
346 #define GST_INFO(args...)               GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO,    NULL, ##args )
347 #define GST_DEBUG(args...)              GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   NULL, ##args )
348 #define GST_LOG(args...)                GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG,     NULL, ##args )
349
350 #endif /* G_HAVE_ISO_VARARGS */
351
352 #else /* GST_DEBUG_ENABLE_DEPRECATED */
353 /* This is a workaround so the old debugging stuff of Gstreamer 0.6 works.
354    This is undocumented and will go when 0.8 comes out. */
355
356 #ifdef G_HAVE_ISO_VARARGS
357 #  define GST_INFO(cat,...)                     GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO,    NULL, __VA_ARGS__)
358 #  define GST_DEBUG(cat,...)                    GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   NULL, __VA_ARGS__)
359 #  define GST_INFO_ELEMENT(cat,obj,...)         GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO,    obj, __VA_ARGS__)
360 #  define GST_DEBUG_ELEMENT(cat,obj,...)        GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   obj, __VA_ARGS__)
361 #  define GST_DEBUG_ENTER(...)                  GST_DEBUG ("entering: " __VA_ARGS__ )
362 #  define GST_DEBUG_LEAVE(...)                  GST_DEBUG ("leaving: "  __VA_ARGS__ )
363 #  define GST_INFO_ENTER(...)                   GST_INFO ("entering: " __VA_ARGS__ )
364 #  define GST_INFO_LEAVE(...)                   GST_INFO ("leaving: "  __VA_ARGS__ )
365 #else /* G_HAVE_GNUC_VARARGS */
366 #  define GST_INFO(cat,args...)                 GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO,    NULL, ##args )
367 #  define GST_DEBUG(cat,args...)                GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   NULL, ##args )
368 #  define GST_INFO_ELEMENT(cat,obj,args...)     GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO,    obj, ##args )
369 #  define GST_DEBUG_ELEMENT(cat,obj,args...)    GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   obj, ##args )
370 #  define GST_DEBUG_ENTER(args...)              GST_DEBUG ("entering: " ##args )
371 #  define GST_DEBUG_LEAVE(args...)              GST_DEBUG ("leaving: "  ##args )
372 #  define GST_INFO_ENTER(args...)               GST_INFO ("entering: " ##args )
373 #  define GST_INFO_LEAVE(args...)               GST_INFO ("leaving: "  ##args )
374 #endif /* G_HAVE_ISO_VARARGS */
375
376 #endif /* !GST_DEBUG_ENABLE_DEPRECATED */
377
378
379 /********** function pointer stuff **********/
380 void*           _gst_debug_register_funcptr     (void *                 ptr,
381                                                  gchar *                ptrname);
382 gchar*          _gst_debug_nameof_funcptr       (void *                 ptr);
383
384 #define GST_DEBUG_FUNCPTR(ptr) (_gst_debug_register_funcptr((void *)(ptr), #ptr) , ptr)
385 #define GST_DEBUG_FUNCPTR_NAME(ptr) _gst_debug_nameof_funcptr((void *)ptr)
386
387 #else /* GST_DISABLE_GST_DEBUG */
388
389 #ifdef __GNUC__
390 #  pragma GCC poison gst_debug_log
391 #  pragma GCC poison gst_debug_logv
392 #  pragma GCC poison gst_debug_log_default
393 #  pragma GCC poison _gst_debug_category_new
394 #endif
395
396 #define _gst_debug_init()                               /* NOP */
397
398 #define gst_debug_set_log_function(func,data)           /* NOP */
399 #define gst_debug_reset_log_function(void)              /* NOP */
400 #define gst_debug_set_default_threshold(level)          /* NOP */
401 #define gst_debug_get_default_threshold()               (GST_LEVEL_NONE)
402 #define gst_debug_category_set_threshold_for_name(name, level) /* NOP */
403 #define gst_debug_category_unset_threshold_for_name(name) /* NOP */
404
405 #define gst_debug_level_get_name(level)                 ("NONE")
406 #define gst_debug_add_log_function(func,data)           (FALSE)
407 #define gst_debug_remove_log_function(func)             (0)
408 #define gst_debug_remove_log_function_by_data(data)     (0)
409 #define gst_debug_set_active(active)                    /* NOP */
410 #define gst_debug_is_active()                           (FALSE)
411 #define gst_debug_set_colored(colored)                  /* NOP */
412 #define gst_debug_is_colored()                          (FALSE)
413 #define gst_debug_set_default_threshold(level)          /* NOP */
414 #define gst_debug_get_default_threshold()               (GST_LEVEL_NONE)
415 #define gst_debug_set_threshold_for_name(name,level)    /* NOP */
416 #define gst_debug_unset_threshold_for_name(name)        /* NOP */
417
418 #define GST_DEBUG_CATEGORY(var)                         /* NOP */
419 #define GST_DEBUG_CATEGORY_EXTERN(var)                  /* NOP */
420 #define GST_DEBUG_CATEGORY_STATIC(var)                  /* NOP */
421 #define GST_DEBUG_CATEGORY_INIT(var,name,color,desc)    /* NOP */
422 #define gst_debug_category_free(category)               /* NOP */
423 #define gst_debug_category_set_threshold(category,level) /* NOP */
424 #define gst_debug_category_reset_threshold(category)    /* NOP */
425 #define gst_debug_category_get_threshold(category)      (GST_LEVEL_NONE)
426 #define gst_debug_category_get_name(cat)                ("")
427 #define gst_debug_category_get_color(cat)               (0)
428 #define gst_debug_category_get_description(cat)         ("")
429 #define gst_debug_get_all_categories()                  (NULL)
430 #define gst_debug_construct_term_color(colorinfo)       (g_strdup ("00"))
431
432 #ifdef G_HAVE_ISO_VARARGS
433
434 #define GST_CAT_LEVEL_LOG(cat,level,...)                /* NOP */
435
436 #define GST_CAT_ERROR_OBJECT(...)                       /* NOP */
437 #define GST_CAT_WARNING_OBJECT(...)                     /* NOP */
438 #define GST_CAT_INFO_OBJECT(...)                        /* NOP */
439 #define GST_CAT_DEBUG_OBJECT(...)                       /* NOP */
440 #define GST_CAT_LOG_OBJECT(...)                         /* NOP */
441
442 #define GST_CAT_ERROR(...)                              /* NOP */
443 #define GST_CAT_WARNING(...)                            /* NOP */
444 #define GST_CAT_INFO(...)                               /* NOP */
445 #define GST_CAT_DEBUG(...)                              /* NOP */
446 #define GST_CAT_LOG(...)                                /* NOP */
447
448 #define GST_ERROR_OBJECT(...)                           /* NOP */
449 #define GST_WARNING_OBJECT(...)                         /* NOP */
450 #define GST_INFO_OBJECT(...)                            /* NOP */
451 #define GST_DEBUG_OBJECT(...)                           /* NOP */
452 #define GST_LOG_OBJECT(...)                             /* NOP */
453
454 #define GST_ERROR(...)                                  /* NOP */
455 #define GST_WARNING(...)                                /* NOP */
456 #define GST_INFO(...)                                   /* NOP */
457 #define GST_DEBUG(...)                                  /* NOP */
458 #define GST_LOG(...)                                    /* NOP */
459
460 #ifdef GST_DEBUG_ENABLE_DEPRECATED
461 #define GST_INFO_ELEMENT(cat,obj,...) /* NOP */
462 #define GST_DEBUG_ELEMENT(cat,obj,...) /* NOP */
463 #define GST_DEBUG_ENTER(...) /* NOP */
464 #define GST_DEBUG_LEAVE(...) /* NOP */
465 #define GST_INFO_ENTER(...) /* NOP */
466 #define GST_INFO_LEAVE(...) /* NOP */
467 #endif /* GST_DEBUG_ENABLE_DEPRECATED */
468
469 #else /* !G_HAVE_ISO_VARARGS */
470
471 #define GST_CAT_LEVEL_LOG(cat,level,args...)            /* NOP */
472
473 #define GST_CAT_ERROR_OBJECT(args...)                   /* NOP */
474 #define GST_CAT_WARNING_OBJECT(args...)                 /* NOP */
475 #define GST_CAT_INFO_OBJECT(args...)                    /* NOP */
476 #define GST_CAT_DEBUG_OBJECT(args...)                   /* NOP */
477 #define GST_CAT_LOG_OBJECT(args...)                     /* NOP */
478
479 #define GST_CAT_ERROR(args...)                          /* NOP */
480 #define GST_CAT_WARNING(args...)                        /* NOP */
481 #define GST_CAT_INFO(args...)                           /* NOP */
482 #define GST_CAT_DEBUG(args...)                          /* NOP */
483 #define GST_CAT_LOG(args...)                            /* NOP */
484
485 #define GST_ERROR_OBJECT(args...)                       /* NOP */
486 #define GST_WARNING_OBJECT(args...)                     /* NOP */
487 #define GST_INFO_OBJECT(args...)                        /* NOP */
488 #define GST_DEBUG_OBJECT(args...)                       /* NOP */
489 #define GST_LOG_OBJECT(args...)                         /* NOP */
490
491 #define GST_ERROR(args...)                              /* NOP */
492 #define GST_WARNING(args...)                            /* NOP */
493 #define GST_INFO(args...)                               /* NOP */
494 #define GST_DEBUG(args...)                              /* NOP */
495 #define GST_LOG(args...)                                /* NOP */
496
497 #ifdef GST_DEBUG_ENABLE_DEPRECATED
498 #define GST_INFO_ELEMENT(cat,obj,args...) /* NOP */
499 #define GST_DEBUG_ELEMENT(cat,obj,args...) /* NOP */
500 #define GST_DEBUG_ENTER(args...) /* NOP */
501 #define GST_DEBUG_LEAVE(args...) /* NOP */
502 #define GST_INFO_ENTER(args...) /* NOP */
503 #define GST_INFO_LEAVE(args...) /* NOP */
504 #endif /* GST_DEBUG_ENABLE_DEPRECATED */
505
506 #endif /* G_HAVE_ISO_VARARGS */
507
508 #define GST_DEBUG_FUNCPTR(ptr) (ptr)
509 #define GST_DEBUG_FUNCPTR_NAME(ptr) (g_strdup_printf ("%p", ptr))
510
511 #endif /* GST_DISABLE_GST_DEBUG */
512
513 void gst_debug_print_stack_trace (void);
514
515 G_END_DECLS
516
517 #endif /* __GSTINFO_H__ */