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>
6 * gstinfo.h: debugging functions
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.
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.
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.
28 #include <glib-object.h>
29 #include <gst/gstatomic.h>
30 #include <gst/gstconfig.h>
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
53 /* we can now override this to be more general in maintainer builds or cvs checkouts */
54 #ifndef GST_LEVEL_DEFAULT
55 #define GST_LEVEL_DEFAULT GST_LEVEL_NONE
58 /* defines for format (colors etc) - don't change them around, it uses terminal layout
59 * Terminal color strings:
60 * 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
62 * 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
63 * Background color codes:
64 * 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
68 GST_DEBUG_FG_BLACK = 0x0000,
69 GST_DEBUG_FG_RED = 0x0001,
70 GST_DEBUG_FG_GREEN = 0x0002,
71 GST_DEBUG_FG_YELLOW = 0x0003,
72 GST_DEBUG_FG_BLUE = 0x0004,
73 GST_DEBUG_FG_MAGENTA = 0x0005,
74 GST_DEBUG_FG_CYAN = 0x0006,
75 GST_DEBUG_FG_WHITE = 0x0007,
76 /* background colors */
77 GST_DEBUG_BG_BLACK = 0x0000,
78 GST_DEBUG_BG_RED = 0x0010,
79 GST_DEBUG_BG_GREEN = 0x0020,
80 GST_DEBUG_BG_YELLOW = 0x0030,
81 GST_DEBUG_BG_BLUE = 0x0040,
82 GST_DEBUG_BG_MAGENTA = 0x0050,
83 GST_DEBUG_BG_CYAN = 0x0060,
84 GST_DEBUG_BG_WHITE = 0x0070,
86 GST_DEBUG_BOLD = 0x0100,
87 GST_DEBUG_UNDERLINE = 0x0200
90 #define GST_DEBUG_FG_MASK (0x000F)
91 #define GST_DEBUG_BG_MASK (0x00F0)
92 #define GST_DEBUG_FORMAT_MASK (0xFF00)
94 typedef struct _GstDebugCategory GstDebugCategory;
95 struct _GstDebugCategory {
97 GstAtomicInt * threshold;
98 guint color; /* see defines above */
101 const gchar * description;
104 /********** some convenience macros for debugging **********/
106 /* This is needed in printf's if a char* might be NULL. Solaris crashes then */
107 #define GST_STR_NULL(str) ((str) ? (str) : "(NULL)")
109 /* easier debugging for pad names */
110 #define GST_DEBUG_PAD_NAME(pad) \
111 (GST_OBJECT_PARENT(pad) != NULL) ? \
112 GST_STR_NULL (GST_OBJECT_NAME (GST_OBJECT_PARENT(pad))) : \
113 "''", GST_OBJECT_NAME (pad)
115 /* You might want to define GST_FUNCTION in apps' configure script */
118 #if defined (__GNUC__)
119 # define GST_FUNCTION ((const char*) (__PRETTY_FUNCTION__))
120 #elif defined (G_HAVE_ISO_VARARGS)
121 # define GST_FUNCTION ((const char*) (__func__))
123 # define GST_FUNCTION ((const char*) ("???"))
125 #endif /* ifndef GST_FUNCTION */
128 typedef struct _GstDebugMessage GstDebugMessage;
129 typedef void (*GstLogFunction) (GstDebugCategory * category,
132 const gchar * function,
135 GstDebugMessage * message,
138 #ifndef GST_DISABLE_GST_DEBUG
140 void _gst_debug_init (void);
142 /* note we can't use G_GNUC_PRINTF (7, 8) because gcc chokes on %P, which
143 * we use for GST_PTR_FORMAT. */
144 void gst_debug_log (GstDebugCategory * category,
147 const gchar * function,
150 const gchar * format,
151 ...) G_GNUC_NO_INSTRUMENT;
152 void gst_debug_log_valist (GstDebugCategory * category,
155 const gchar * function,
158 const gchar * format,
159 va_list args) G_GNUC_NO_INSTRUMENT;
161 const gchar * gst_debug_message_get (GstDebugMessage * message);
163 void gst_debug_log_default (GstDebugCategory * category,
166 const gchar * function,
169 GstDebugMessage * message,
170 gpointer unused) G_GNUC_NO_INSTRUMENT;
172 G_CONST_RETURN gchar *
173 gst_debug_level_get_name (GstDebugLevel level);
175 void gst_debug_add_log_function (GstLogFunction func,
177 guint gst_debug_remove_log_function (GstLogFunction func);
178 guint gst_debug_remove_log_function_by_data (gpointer data);
180 void gst_debug_set_active (gboolean active);
181 gboolean gst_debug_is_active (void);
183 void gst_debug_set_colored (gboolean colored);
184 gboolean gst_debug_is_colored (void);
186 void gst_debug_set_default_threshold (GstDebugLevel level);
187 GstDebugLevel gst_debug_get_default_threshold (void);
188 void gst_debug_set_threshold_for_name (const gchar * name,
189 GstDebugLevel level);
190 void gst_debug_unset_threshold_for_name (const gchar * name);
193 * GST_DEBUG_CATEGORY:
196 * Defines a GstDebugCategory variable.
197 * This macro expands to nothing if debugging is disabled.
199 #define GST_DEBUG_CATEGORY(cat) GstDebugCategory *cat = NULL
201 * GST_DEBUG_CATEGORY_EXTERN:
204 * Declares a GstDebugCategory variable as extern. Use in header files.
205 * This macro expands to nothing if debugging is disabled.
207 #define GST_DEBUG_CATEGORY_EXTERN(cat) extern GstDebugCategory *cat
209 * GST_DEBUG_CATEGORY_STATIC:
212 * Defines a static GstDebugCategory variable.
213 * This macro expands to nothing if debugging is disabled.
215 #define GST_DEBUG_CATEGORY_STATIC(cat) static GstDebugCategory *cat = NULL
216 /* do not use this function, use the macros below */
217 GstDebugCategory *_gst_debug_category_new (gchar * name,
219 gchar * description);
221 * GST_DEBUG_CATEGORY_INIT:
222 * @cat: the category to initialize.
223 * @name: the name of the category.
224 * @color: the colors to use for a color representation or 0 for no color.
225 * @description: optional description of the category.
227 * Initializes a new #GstDebugCategory with the given properties and set to
228 * the default threshold.
232 * This macro expands to nothing if debugging is disabled.
235 * When naming your category, please follow the following conventions to ensure
236 * that the pattern matching for categories works as expected. It is not
237 * earth-shattering if you don't follow these conventions, but it would be nice
241 * If you define a category for a plugin or a feature of it, name the category
242 * like the feature. So if you wanted to write a "filesrc" element, you would
243 * name the category "filesrc". Use lowercase letters only.
244 * If you define more than one category for the same element, append an
245 * underscore and an identifier to your categories, like this: "filesrc_cache"
248 * If you create a library or an application using debugging categories, use a
249 * common prefix followed by an underscore for all your categories. GStreamer
250 * uses the GST prefix so GStreamer categories look like "GST_STATES". Be sure
251 * to include uppercase letters.
255 #define GST_DEBUG_CATEGORY_INIT(cat,name,color,description) G_STMT_START{ \
257 cat = _gst_debug_category_new (name,color,description); \
260 void gst_debug_category_free (GstDebugCategory * category);
261 void gst_debug_category_set_threshold (GstDebugCategory * category,
262 GstDebugLevel level);
263 void gst_debug_category_reset_threshold (GstDebugCategory * category);
264 GstDebugLevel gst_debug_category_get_threshold (GstDebugCategory * category);
265 G_CONST_RETURN gchar *
266 gst_debug_category_get_name (GstDebugCategory * category);
267 guint gst_debug_category_get_color (GstDebugCategory * category);
268 G_CONST_RETURN gchar *
269 gst_debug_category_get_description (GstDebugCategory * category);
270 GSList * gst_debug_get_all_categories (void);
272 gchar * gst_debug_construct_term_color (guint colorinfo);
275 extern GstDebugCategory * GST_CAT_DEFAULT;
276 /* this symbol may not be used */
277 extern gboolean __gst_debug_enabled;
279 #ifdef G_HAVE_ISO_VARARGS
280 #define GST_CAT_LEVEL_LOG(cat,level,object,...) G_STMT_START{ \
281 if (__gst_debug_enabled) { \
282 gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, (GObject *) (object), __VA_ARGS__); \
285 #else /* G_HAVE_GNUC_VARARGS */
286 #ifdef G_HAVE_GNUC_VARARGS
287 #define GST_CAT_LEVEL_LOG(cat,level,object,args...) G_STMT_START{ \
288 if (__gst_debug_enabled) { \
289 gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, (GObject *) (object), ##args ); \
292 #else /* no variadic macros, use inline */
294 GST_CAT_LEVEL_LOG_valist (GstDebugCategory * cat,
295 GstDebugLevel level, gpointer object, const char *format, va_list varargs)
297 gst_debug_log_valist (cat, level, "", "", 0, (GObject *) object, format,
302 GST_CAT_LEVEL_LOG (GstDebugCategory * cat, GstDebugLevel level,
303 gpointer object, const char *format, ...)
305 if (__gst_debug_enabled) {
308 va_start (varargs, format);
309 GST_CAT_LEVEL_LOG_valist (cat, level, object, format, varargs);
314 #endif /* G_HAVE_ISO_VARARGS */
316 #ifdef G_HAVE_ISO_VARARGS
318 #define GST_CAT_ERROR_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, obj, __VA_ARGS__)
319 #define GST_CAT_WARNING_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, obj, __VA_ARGS__)
320 #define GST_CAT_INFO_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, obj, __VA_ARGS__)
321 #define GST_CAT_DEBUG_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, obj, __VA_ARGS__)
322 #define GST_CAT_LOG_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, obj, __VA_ARGS__)
324 #define GST_CAT_ERROR(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, NULL, __VA_ARGS__)
325 #define GST_CAT_WARNING(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
326 #define GST_CAT_INFO(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, NULL, __VA_ARGS__)
327 #define GST_CAT_DEBUG(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, NULL, __VA_ARGS__)
328 #define GST_CAT_LOG(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, NULL, __VA_ARGS__)
330 #define GST_ERROR_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, obj, __VA_ARGS__)
331 #define GST_WARNING_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj, __VA_ARGS__)
332 #define GST_INFO_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, obj, __VA_ARGS__)
333 #define GST_DEBUG_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, obj, __VA_ARGS__)
334 #define GST_LOG_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, obj, __VA_ARGS__)
336 #define GST_ERROR(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, NULL, __VA_ARGS__)
337 #define GST_WARNING(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
338 #define GST_INFO(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, __VA_ARGS__)
339 #define GST_DEBUG(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, __VA_ARGS__)
340 #define GST_LOG(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, NULL, __VA_ARGS__)
343 #ifdef G_HAVE_GNUC_VARARGS
345 #define GST_CAT_ERROR_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, obj, ##args )
346 #define GST_CAT_WARNING_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, obj, ##args )
347 #define GST_CAT_INFO_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, obj, ##args )
348 #define GST_CAT_DEBUG_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, obj, ##args )
349 #define GST_CAT_LOG_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, obj, ##args )
351 #define GST_CAT_ERROR(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, NULL, ##args )
352 #define GST_CAT_WARNING(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, NULL, ##args )
353 #define GST_CAT_INFO(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, NULL, ##args )
354 #define GST_CAT_DEBUG(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, NULL, ##args )
355 #define GST_CAT_LOG(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, NULL, ##args )
357 #define GST_ERROR_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, obj, ##args )
358 #define GST_WARNING_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj, ##args )
359 #define GST_INFO_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, obj, ##args )
360 #define GST_DEBUG_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, obj, ##args )
361 #define GST_LOG_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, obj, ##args )
363 #define GST_ERROR(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, NULL, ##args )
364 #define GST_WARNING(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, ##args )
365 #define GST_INFO(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, ##args )
366 #define GST_DEBUG(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, ##args )
367 #define GST_LOG(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, NULL, ##args )
370 /* no variadic macros, use inline */
372 GST_CAT_ERROR_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
377 va_start (varargs, format);
378 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_ERROR, obj, format, varargs);
383 GST_CAT_WARNING_OBJECT (GstDebugCategory * cat, gpointer obj,
384 const char *format, ...)
388 va_start (varargs, format);
389 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_WARNING, obj, format, varargs);
394 GST_CAT_INFO_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
399 va_start (varargs, format);
400 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_INFO, obj, format, varargs);
405 GST_CAT_DEBUG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
410 va_start (varargs, format);
411 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_DEBUG, obj, format, varargs);
416 GST_CAT_LOG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
421 va_start (varargs, format);
422 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_LOG, obj, format, varargs);
427 GST_CAT_ERROR (GstDebugCategory * cat, const char *format, ...)
431 va_start (varargs, format);
432 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_ERROR, NULL, format, varargs);
437 GST_CAT_WARNING (GstDebugCategory * cat, const char *format, ...)
441 va_start (varargs, format);
442 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_WARNING, NULL, format, varargs);
447 GST_CAT_INFO (GstDebugCategory * cat, const char *format, ...)
451 va_start (varargs, format);
452 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_INFO, NULL, format, varargs);
457 GST_CAT_DEBUG (GstDebugCategory * cat, const char *format, ...)
461 va_start (varargs, format);
462 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_DEBUG, NULL, format, varargs);
467 GST_CAT_LOG (GstDebugCategory * cat, const char *format, ...)
471 va_start (varargs, format);
472 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_LOG, NULL, format, varargs);
477 GST_ERROR_OBJECT (gpointer obj, const char *format, ...)
481 va_start (varargs, format);
482 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_ERROR, obj, format,
488 GST_WARNING_OBJECT (gpointer obj, const char *format, ...)
492 va_start (varargs, format);
493 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj, format,
499 GST_INFO_OBJECT (gpointer obj, const char *format, ...)
503 va_start (varargs, format);
504 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_INFO, obj, format,
510 GST_DEBUG_OBJECT (gpointer obj, const char *format, ...)
514 va_start (varargs, format);
515 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, obj, format,
521 GST_LOG_OBJECT (gpointer obj, const char *format, ...)
525 va_start (varargs, format);
526 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_LOG, obj, format,
532 GST_ERROR (const char *format, ...)
536 va_start (varargs, format);
537 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_ERROR, NULL, format,
543 GST_WARNING (const char *format, ...)
547 va_start (varargs, format);
548 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, format,
554 GST_INFO (const char *format, ...)
558 va_start (varargs, format);
559 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, format,
565 GST_DEBUG (const char *format, ...)
569 va_start (varargs, format);
570 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, format,
576 GST_LOG (const char *format, ...)
580 va_start (varargs, format);
581 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_LOG, NULL,
589 /********** function pointer stuff **********/
590 void* _gst_debug_register_funcptr (void * ptr,
592 G_CONST_RETURN gchar*
593 _gst_debug_nameof_funcptr (void * ptr);
595 #define GST_DEBUG_FUNCPTR(ptr) (_gst_debug_register_funcptr((void *)(ptr), #ptr) , ptr)
596 #define GST_DEBUG_FUNCPTR_NAME(ptr) _gst_debug_nameof_funcptr((void *)ptr)
598 #else /* GST_DISABLE_GST_DEBUG */
601 # pragma GCC poison gst_debug_log
602 # pragma GCC poison gst_debug_log_valist
603 # pragma GCC poison _gst_debug_category_new
606 #define _gst_debug_init() /* NOP */
608 #define gst_debug_set_log_function(func,data) /* NOP */
609 #define gst_debug_reset_log_function(void) /* NOP */
610 #define gst_debug_set_default_threshold(level) /* NOP */
611 #define gst_debug_get_default_threshold() (GST_LEVEL_NONE)
612 #define gst_debug_category_set_threshold_for_name(name, level) /* NOP */
613 #define gst_debug_category_unset_threshold_for_name(name) /* NOP */
615 #define gst_debug_level_get_name(level) ("NONE")
616 #define gst_debug_add_log_function(func,data) (FALSE)
617 #define gst_debug_remove_log_function(func) (0)
618 #define gst_debug_remove_log_function_by_data(data) (0)
619 #define gst_debug_set_active(active) /* NOP */
620 #define gst_debug_is_active() (FALSE)
621 #define gst_debug_set_colored(colored) /* NOP */
622 #define gst_debug_is_colored() (FALSE)
623 #define gst_debug_set_default_threshold(level) /* NOP */
624 #define gst_debug_get_default_threshold() (GST_LEVEL_NONE)
625 #define gst_debug_set_threshold_for_name(name,level) /* NOP */
626 #define gst_debug_unset_threshold_for_name(name) /* NOP */
628 #define GST_DEBUG_CATEGORY(var) /* NOP */
629 #define GST_DEBUG_CATEGORY_EXTERN(var) /* NOP */
630 #define GST_DEBUG_CATEGORY_STATIC(var) /* NOP */
631 #define GST_DEBUG_CATEGORY_INIT(var,name,color,desc) /* NOP */
632 #define gst_debug_category_free(category) /* NOP */
633 #define gst_debug_category_set_threshold(category,level) /* NOP */
634 #define gst_debug_category_reset_threshold(category) /* NOP */
635 #define gst_debug_category_get_threshold(category) (GST_LEVEL_NONE)
636 #define gst_debug_category_get_name(cat) ("")
637 #define gst_debug_category_get_color(cat) (0)
638 #define gst_debug_category_get_description(cat) ("")
639 #define gst_debug_get_all_categories() (NULL)
640 #define gst_debug_construct_term_color(colorinfo) (g_strdup ("00"))
642 #ifdef G_HAVE_ISO_VARARGS
644 #define GST_CAT_LEVEL_LOG(cat,level,...) /* NOP */
646 #define GST_CAT_ERROR_OBJECT(...) /* NOP */
647 #define GST_CAT_WARNING_OBJECT(...) /* NOP */
648 #define GST_CAT_INFO_OBJECT(...) /* NOP */
649 #define GST_CAT_DEBUG_OBJECT(...) /* NOP */
650 #define GST_CAT_LOG_OBJECT(...) /* NOP */
652 #define GST_CAT_ERROR(...) /* NOP */
653 #define GST_CAT_WARNING(...) /* NOP */
654 #define GST_CAT_INFO(...) /* NOP */
655 #define GST_CAT_DEBUG(...) /* NOP */
656 #define GST_CAT_LOG(...) /* NOP */
658 #define GST_ERROR_OBJECT(...) /* NOP */
659 #define GST_WARNING_OBJECT(...) /* NOP */
660 #define GST_INFO_OBJECT(...) /* NOP */
661 #define GST_DEBUG_OBJECT(...) /* NOP */
662 #define GST_LOG_OBJECT(...) /* NOP */
664 #define GST_ERROR(...) /* NOP */
665 #define GST_WARNING(...) /* NOP */
666 #define GST_INFO(...) /* NOP */
667 #define GST_DEBUG(...) /* NOP */
668 #define GST_LOG(...) /* NOP */
671 #ifdef G_HAVE_GNUC_VARARGS
673 #define GST_CAT_LEVEL_LOG(cat,level,args...) /* NOP */
675 #define GST_CAT_ERROR_OBJECT(args...) /* NOP */
676 #define GST_CAT_WARNING_OBJECT(args...) /* NOP */
677 #define GST_CAT_INFO_OBJECT(args...) /* NOP */
678 #define GST_CAT_DEBUG_OBJECT(args...) /* NOP */
679 #define GST_CAT_LOG_OBJECT(args...) /* NOP */
681 #define GST_CAT_ERROR(args...) /* NOP */
682 #define GST_CAT_WARNING(args...) /* NOP */
683 #define GST_CAT_INFO(args...) /* NOP */
684 #define GST_CAT_DEBUG(args...) /* NOP */
685 #define GST_CAT_LOG(args...) /* NOP */
687 #define GST_ERROR_OBJECT(args...) /* NOP */
688 #define GST_WARNING_OBJECT(args...) /* NOP */
689 #define GST_INFO_OBJECT(args...) /* NOP */
690 #define GST_DEBUG_OBJECT(args...) /* NOP */
691 #define GST_LOG_OBJECT(args...) /* NOP */
693 #define GST_ERROR(args...) /* NOP */
694 #define GST_WARNING(args...) /* NOP */
695 #define GST_INFO(args...) /* NOP */
696 #define GST_DEBUG(args...) /* NOP */
697 #define GST_LOG(args...) /* NOP */
701 GST_CAT_ERROR_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
707 GST_CAT_WARNING_OBJECT (GstDebugCategory * cat, gpointer obj,
708 const char *format, ...)
713 GST_CAT_INFO_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
719 GST_CAT_DEBUG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
725 GST_CAT_LOG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
731 GST_CAT_ERROR (GstDebugCategory * cat, const char *format, ...)
736 GST_CAT_WARNING (GstDebugCategory * cat, const char *format, ...)
741 GST_CAT_INFO (GstDebugCategory * cat, const char *format, ...)
746 GST_CAT_DEBUG (GstDebugCategory * cat, const char *format, ...)
751 GST_CAT_LOG (GstDebugCategory * cat, const char *format, ...)
756 GST_ERROR_OBJECT (gpointer obj, const char *format, ...)
761 GST_WARNING_OBJECT (gpointer obj, const char *format, ...)
766 GST_INFO_OBJECT (gpointer obj, const char *format, ...)
771 GST_DEBUG_OBJECT (gpointer obj, const char *format, ...)
776 GST_LOG_OBJECT (gpointer obj, const char *format, ...)
781 GST_ERROR (const char *format, ...)
786 GST_WARNING (const char *format, ...)
791 GST_INFO (const char *format, ...)
796 GST_DEBUG (const char *format, ...)
801 GST_LOG (const char *format, ...)
807 #define GST_DEBUG_FUNCPTR(ptr) (ptr)
808 #define GST_DEBUG_FUNCPTR_NAME(ptr) (g_strdup_printf ("%p", ptr))
810 #endif /* GST_DISABLE_GST_DEBUG */
812 void gst_debug_print_stack_trace (void);
814 /* timestamp debugging macros */
815 #define GST_TIME_FORMAT "u:%02u:%02u.%09u"
816 #define GST_TIME_ARGS(t) \
817 (guint) (t / (GST_SECOND * 60 * 60)), \
818 (guint) ((t / (GST_SECOND * 60)) % 60), \
819 (guint) ((t / GST_SECOND) % 60), \
820 (guint) (t % GST_SECOND)
824 #endif /* __GSTINFO_H__ */