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