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., 51 Franklin St, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
28 #include <glib-object.h>
29 #include <gst/gstconfig.h>
35 * @GST_LEVEL_NONE: No debugging level specified or desired. Used to deactivate
37 * @GST_LEVEL_ERROR: Error messages are to be used only when an error occurred
38 * that stops the application from keeping working correctly.
39 * An examples is gst_element_error, which outputs a message with this priority.
40 * It does not mean that the application is terminating as with g_error.
41 * @GST_LEVEL_WARNING: Warning messages are to inform about abnormal behaviour
42 * that could lead to problems or weird behaviour later on. An example of this
43 * would be clocking issues ("your computer is pretty slow") or broken input
44 * data ("Can't synchronize to stream.")
45 * @GST_LEVEL_FIXME: Fixme messages are messages that indicate that something
46 * in the executed code path is not fully implemented or handled yet. Note
47 * that this does not replace proper error handling in any way, the purpose
48 * of this message is to make it easier to spot incomplete/unfinished pieces
49 * of code when reading the debug log.
50 * @GST_LEVEL_INFO: Informational messages should be used to keep the developer
51 * updated about what is happening.
52 * Examples where this should be used are when a typefind function has
53 * successfully determined the type of the stream or when an mp3 plugin detects
54 * the format to be used. ("This file has mono sound.")
55 * @GST_LEVEL_DEBUG: Debugging messages should be used when something common
56 * happens that is not the expected default behavior, or something that's
57 * useful to know but doesn't happen all the time (ie. per loop iteration or
58 * buffer processed or event handled).
59 * An example would be notifications about state changes or receiving/sending
61 * @GST_LEVEL_LOG: Log messages are messages that are very common but might be
62 * useful to know. As a rule of thumb a pipeline that is running as expected
63 * should never output anything else but LOG messages whilst processing data.
64 * Use this log level to log recurring information in chain functions and
65 * loop functions, for example.
66 * @GST_LEVEL_TRACE: Tracing-related messages.
67 * Examples for this are referencing/dereferencing of objects.
68 * @GST_LEVEL_MEMDUMP: memory dump messages are used to log (small) chunks of
69 * data as memory dumps in the log. They will be displayed as hexdump with
71 * @GST_LEVEL_COUNT: The number of defined debugging levels.
73 * The level defines the importance of a debugging message. The more important a
74 * message is, the greater the probability that the debugging system outputs it.
79 GST_LEVEL_WARNING = 2,
86 GST_LEVEL_MEMDUMP = 9,
94 * Defines the default debugging level to be used with GStreamer. It is normally
95 * set to #GST_LEVEL_NONE so nothing get printed.
96 * As it can be configured at compile time, developer builds may chose to
97 * override that though.
98 * You can use this as an argument to gst_debug_set_default_threshold() to
99 * reset the debugging output to default behaviour.
101 #ifndef GST_LEVEL_DEFAULT
102 #define GST_LEVEL_DEFAULT GST_LEVEL_NONE
108 * Defines the maximum debugging level to be enabled at compilation time. By default
109 * it is set such that all debugging statements will be enabled.
111 * If you wish to compile GStreamer and plugins with only some debugging statements
112 * (Such as just warnings and errors), you can define it at compile time to the
113 * maximum debug level. Any debug statements above that level will be compiled out.
117 #ifndef GST_LEVEL_MAX
118 #define GST_LEVEL_MAX GST_LEVEL_COUNT
121 /* defines for format (colors etc)
122 * don't change them around, it uses terminal layout
123 * Terminal color strings:
124 * 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
126 * 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
127 * Background color codes:
128 * 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
131 * GstDebugColorFlags:
132 * @GST_DEBUG_FG_BLACK: Use black as foreground color.
133 * @GST_DEBUG_FG_RED: Use red as foreground color.
134 * @GST_DEBUG_FG_GREEN: Use green as foreground color.
135 * @GST_DEBUG_FG_YELLOW: Use yellow as foreground color.
136 * @GST_DEBUG_FG_BLUE: Use blue as foreground color.
137 * @GST_DEBUG_FG_MAGENTA: Use magenta as foreground color.
138 * @GST_DEBUG_FG_CYAN: Use cyan as foreground color.
139 * @GST_DEBUG_FG_WHITE: Use white as foreground color.
140 * @GST_DEBUG_BG_BLACK: Use black as background color.
141 * @GST_DEBUG_BG_RED: Use red as background color.
142 * @GST_DEBUG_BG_GREEN: Use green as background color.
143 * @GST_DEBUG_BG_YELLOW: Use yellow as background color.
144 * @GST_DEBUG_BG_BLUE: Use blue as background color.
145 * @GST_DEBUG_BG_MAGENTA: Use magenta as background color.
146 * @GST_DEBUG_BG_CYAN: Use cyan as background color.
147 * @GST_DEBUG_BG_WHITE: Use white as background color.
148 * @GST_DEBUG_BOLD: Make the output bold.
149 * @GST_DEBUG_UNDERLINE: Underline the output.
151 * These are some terminal style flags you can use when creating your
152 * debugging categories to make them stand out in debugging output.
156 GST_DEBUG_FG_BLACK = 0x0000,
157 GST_DEBUG_FG_RED = 0x0001,
158 GST_DEBUG_FG_GREEN = 0x0002,
159 GST_DEBUG_FG_YELLOW = 0x0003,
160 GST_DEBUG_FG_BLUE = 0x0004,
161 GST_DEBUG_FG_MAGENTA = 0x0005,
162 GST_DEBUG_FG_CYAN = 0x0006,
163 GST_DEBUG_FG_WHITE = 0x0007,
164 /* background colors */
165 GST_DEBUG_BG_BLACK = 0x0000,
166 GST_DEBUG_BG_RED = 0x0010,
167 GST_DEBUG_BG_GREEN = 0x0020,
168 GST_DEBUG_BG_YELLOW = 0x0030,
169 GST_DEBUG_BG_BLUE = 0x0040,
170 GST_DEBUG_BG_MAGENTA = 0x0050,
171 GST_DEBUG_BG_CYAN = 0x0060,
172 GST_DEBUG_BG_WHITE = 0x0070,
174 GST_DEBUG_BOLD = 0x0100,
175 GST_DEBUG_UNDERLINE = 0x0200
176 } GstDebugColorFlags;
179 * GstStackTraceFlags:
180 * @GST_STACK_TRACE_SHOW_FULL: Try to retrieve as much information as
181 * possible when getting the stack trace
184 GST_STACK_TRACE_SHOW_FULL = 1 << 0
185 } GstStackTraceFlags;
189 * @GST_DEBUG_COLOR_MODE_OFF: Do not use colors in logs.
190 * @GST_DEBUG_COLOR_MODE_ON: Paint logs in a platform-specific way.
191 * @GST_DEBUG_COLOR_MODE_UNIX: Paint logs with UNIX terminal color codes
192 * no matter what platform GStreamer is running on.
195 GST_DEBUG_COLOR_MODE_OFF = 0,
196 GST_DEBUG_COLOR_MODE_ON = 1,
197 GST_DEBUG_COLOR_MODE_UNIX = 2
201 #define GST_DEBUG_FG_MASK (0x000F)
202 #define GST_DEBUG_BG_MASK (0x00F0)
203 #define GST_DEBUG_FORMAT_MASK (0xFF00)
205 typedef struct _GstDebugCategory GstDebugCategory;
209 * This is the struct that describes the categories. Once initialized with
210 * #GST_DEBUG_CATEGORY_INIT, its values can't be changed anymore.
212 struct _GstDebugCategory {
215 guint color; /* see defines above */
218 const gchar * description;
221 /********** some convenience macros for debugging **********/
225 * @str: (allow-none): The string to check.
227 * Macro to use when a string must not be %NULL, but may be %NULL. If the string
228 * is %NULL, "(NULL)" is printed instead.
229 * In GStreamer printf string arguments may not be %NULL, because on some
230 * platforms (ie Solaris) the libc crashes in that case. This includes debugging
233 #define GST_STR_NULL(str) ((str) ? (str) : "(NULL)")
235 /* FIXME, not MT safe */
237 * GST_DEBUG_PAD_NAME:
238 * @pad: The pad to debug.
240 * Evaluates to 2 strings, that describe the pad. Often used in debugging
243 #define GST_DEBUG_PAD_NAME(pad) \
245 ((GST_OBJECT_PARENT(pad) != NULL) ? \
246 GST_STR_NULL (GST_OBJECT_NAME (GST_OBJECT_PARENT(pad))) : \
248 (pad != NULL) ? GST_STR_NULL (GST_OBJECT_NAME (pad)) : "''"
253 * This macro should evaluate to the name of the current function and be should
254 * be defined when configuring your project, as it is compiler dependant. If it
255 * is not defined, some default value is used. It is used to provide debugging
256 * output with the function name of the message.
258 * Note that this is different from G_STRFUNC as we do not want the full
259 * function signature in C++ code.
262 #if defined (__STDC__) && defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
263 # define GST_FUNCTION ((const char*) (__func__))
264 #elif defined (__GNUC__) || (defined (_MSC_VER) && _MSC_VER >= 1300)
265 # define GST_FUNCTION ((const char*) (__FUNCTION__))
267 # define GST_FUNCTION ((const char*) ("???"))
269 #endif /* ifndef GST_FUNCTION */
274 * printf format type used to debug GStreamer types. You can use this in
275 * combination with GStreamer's debug logging system as well as the functions
276 * gst_info_vasprintf(), gst_info_strdup_vprintf() and gst_info_strdup_printf()
277 * to pretty-print the following types: #GstCaps, #GstStructure,
278 * #GstCapsFeatures, #GstTagList, #GstDateTime, #GstBuffer, #GstBufferList,
279 * #GstMessage, #GstEvent, #GstQuery, #GstContext, #GstPad, #GstObject. All
280 * #GObject types will be printed as typename plus pointer, and everything
281 * else will simply be printed as pointer address.
283 * This can only be used on types whose size is >= sizeof(gpointer).
285 #define GST_PTR_FORMAT "p\aA"
288 * GST_SEGMENT_FORMAT:
290 * printf format type used to debug GStreamer segments. You can use this in
291 * combination with GStreamer's debug logging system as well as the functions
292 * gst_info_vasprintf(), gst_info_strdup_vprintf() and gst_info_strdup_printf()
293 * to pretty-print #GstSegment structures.
294 * This can only be used on pointers to GstSegment structures.
296 #define GST_SEGMENT_FORMAT "p\aB"
298 typedef struct _GstDebugMessage GstDebugMessage;
302 * @category: a #GstDebugCategory
303 * @level: a #GstDebugLevel
305 * @function: function name
307 * @object: a #GObject
308 * @message: the message
309 * @user_data: user data for the log function
311 * Function prototype for a logging function that can be registered with
312 * gst_debug_add_log_function().
313 * Use G_GNUC_NO_INSTRUMENT on that function.
315 typedef void (*GstLogFunction) (GstDebugCategory * category,
318 const gchar * function,
321 GstDebugMessage * message,
324 void gst_debug_log (GstDebugCategory * category,
327 const gchar * function,
330 const gchar * format,
331 ...) G_GNUC_PRINTF (7, 8) G_GNUC_NO_INSTRUMENT;
333 void gst_debug_log_valist (GstDebugCategory * category,
336 const gchar * function,
339 const gchar * format,
340 va_list args) G_GNUC_NO_INSTRUMENT;
342 /* do not use this function, use the GST_DEBUG_CATEGORY_INIT macro */
343 GstDebugCategory *_gst_debug_category_new (const gchar * name,
345 const gchar * description);
346 /* do not use this function, use the GST_DEBUG_CATEGORY_GET macro */
347 GstDebugCategory *_gst_debug_get_category (const gchar *name);
350 /* do not use this function, use the GST_CAT_MEMDUMP_* macros */
351 void _gst_debug_dump_mem (GstDebugCategory * cat, const gchar * file,
352 const gchar * func, gint line, GObject * obj, const gchar * msg,
353 const guint8 * data, guint length);
355 /* we define this to avoid a compiler warning regarding a cast from a function
356 * pointer to a void pointer
357 * (see https://bugzilla.gnome.org/show_bug.cgi?id=309253)
359 typedef void (* GstDebugFuncPtr) (void);
361 /* do no use these functions, use the GST_DEBUG*_FUNCPTR macros */
362 void _gst_debug_register_funcptr (GstDebugFuncPtr func,
363 const gchar * ptrname);
365 _gst_debug_nameof_funcptr (GstDebugFuncPtr func) G_GNUC_NO_INSTRUMENT;
368 const gchar * gst_debug_message_get (GstDebugMessage * message);
370 void gst_debug_log_default (GstDebugCategory * category,
373 const gchar * function,
376 GstDebugMessage * message,
377 gpointer user_data) G_GNUC_NO_INSTRUMENT;
379 const gchar * gst_debug_level_get_name (GstDebugLevel level);
381 void gst_debug_add_log_function (GstLogFunction func,
383 GDestroyNotify notify);
385 guint gst_debug_remove_log_function (GstLogFunction func);
386 guint gst_debug_remove_log_function_by_data (gpointer data);
388 void gst_debug_set_active (gboolean active);
389 gboolean gst_debug_is_active (void);
391 void gst_debug_set_colored (gboolean colored);
392 void gst_debug_set_color_mode (GstDebugColorMode mode);
393 void gst_debug_set_color_mode_from_string (const gchar * mode);
394 gboolean gst_debug_is_colored (void);
395 GstDebugColorMode gst_debug_get_color_mode (void);
397 void gst_debug_set_default_threshold (GstDebugLevel level);
398 GstDebugLevel gst_debug_get_default_threshold (void);
399 void gst_debug_set_threshold_for_name (const gchar * name,
400 GstDebugLevel level);
401 void gst_debug_set_threshold_from_string (const gchar * list, gboolean reset);
402 void gst_debug_unset_threshold_for_name (const gchar * name);
405 void gst_debug_category_free (GstDebugCategory * category);
406 void gst_debug_category_set_threshold (GstDebugCategory * category,
407 GstDebugLevel level);
408 void gst_debug_category_reset_threshold (GstDebugCategory * category);
409 GstDebugLevel gst_debug_category_get_threshold (GstDebugCategory * category);
410 const gchar * gst_debug_category_get_name (GstDebugCategory * category);
411 guint gst_debug_category_get_color (GstDebugCategory * category);
412 const gchar * gst_debug_category_get_description (GstDebugCategory * category);
413 GSList * gst_debug_get_all_categories (void);
416 gchar * gst_debug_construct_term_color (guint colorinfo);
417 gint gst_debug_construct_win_color (guint colorinfo);
419 gint gst_info_vasprintf (gchar ** result,
420 const gchar * format,
421 va_list args) G_GNUC_PRINTF (2, 0);
422 gchar * gst_info_strdup_vprintf (const gchar *format, va_list args) G_GNUC_PRINTF (1, 0);
423 gchar * gst_info_strdup_printf (const gchar *format, ...) G_GNUC_PRINTF (1, 2);
425 void gst_print (const gchar * format, ...) G_GNUC_PRINTF (1, 2);
426 void gst_println (const gchar * format, ...) G_GNUC_PRINTF (1, 2);
428 void gst_printerr (const gchar * format, ...) G_GNUC_PRINTF (1, 2);
429 void gst_printerrln (const gchar * format, ...) G_GNUC_PRINTF (1, 2);
431 #ifndef GST_DISABLE_GST_DEBUG
433 /* cast to void * avoids a warning with gcc 6
434 * see https://bugzilla.gnome.org/show_bug.cgi?id=764526 */
435 #define gst_debug_add_log_function(func,data,notify) \
437 if (func == (void *) gst_debug_log_default) { \
438 gst_debug_add_log_function(NULL,data,notify); \
440 gst_debug_add_log_function(func,data,notify); \
444 #define gst_debug_remove_log_function(func) \
445 (func == (void *) gst_debug_log_default) ? \
446 gst_debug_remove_log_function(NULL) : \
447 gst_debug_remove_log_function(func)
450 * GST_DEBUG_CATEGORY:
453 * Defines a GstDebugCategory variable.
454 * This macro expands to nothing if debugging is disabled.
456 #define GST_DEBUG_CATEGORY(cat) GstDebugCategory *cat = NULL
458 * GST_DEBUG_CATEGORY_EXTERN:
461 * Declares a GstDebugCategory variable as extern. Use in header files.
462 * This macro expands to nothing if debugging is disabled.
464 #define GST_DEBUG_CATEGORY_EXTERN(cat) extern GstDebugCategory *cat
467 * GST_DEBUG_CATEGORY_STATIC:
470 * Defines a static GstDebugCategory variable.
471 * This macro expands to nothing if debugging is disabled.
473 #define GST_DEBUG_CATEGORY_STATIC(cat) static GstDebugCategory *cat = NULL
476 * GST_DEBUG_CATEGORY_INIT:
477 * @cat: the category to initialize.
478 * @name: the name of the category.
479 * @color: the colors to use for a color representation or 0 for no color.
480 * @description: optional description of the category.
482 * Initializes a new #GstDebugCategory with the given properties and set to
483 * the default threshold.
485 * > This macro expands to nothing if debugging is disabled.
487 * > When naming your category, please follow the following conventions to ensure
488 * > that the pattern matching for categories works as expected. It is not
489 * > earth-shattering if you don't follow these conventions, but it would be nice
492 * > If you define a category for a plugin or a feature of it, name the category
493 * > like the feature. So if you wanted to write a "filesrc" element, you would
494 * > name the category "filesrc". Use lowercase letters only.
495 * > If you define more than one category for the same element, append an
496 * > underscore and an identifier to your categories, like this: "filesrc_cache"
498 * > If you create a library or an application using debugging categories, use a
499 * > common prefix followed by an underscore for all your categories. GStreamer
500 * > uses the GST prefix so GStreamer categories look like "GST_STATES". Be sure
501 * > to include uppercase letters.
504 #define GST_DEBUG_CATEGORY_INIT(cat,name,color,description) G_STMT_START{\
506 cat = _gst_debug_category_new (name,color,description); \
510 * GST_DEBUG_CATEGORY_GET:
511 * @cat: the category to initialize.
512 * @name: log category name
514 * Looks up an existing #GstDebugCategory by its @name and sets @cat. If the
515 * category is not found, but GST_CAT_DEFAULT is defined, that is assigned to
516 * @cat. Otherwise @cat will be %NULL.
518 * |[<!-- language="C" -->
519 * GST_DEBUG_CATEGORY_STATIC (gst_myplugin_debug);
520 * #define GST_CAT_DEFAULT gst_myplugin_debug
521 * GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE);
523 * GST_DEBUG_CATEGORY_INIT (gst_myplugin_debug, "myplugin", 0, "nice element");
524 * GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "GST_PERFORMANCE");
527 #ifdef GST_CAT_DEFAULT
528 #define GST_DEBUG_CATEGORY_GET(cat,name) G_STMT_START{\
529 cat = _gst_debug_get_category (name); \
531 cat = GST_CAT_DEFAULT; \
535 #define GST_DEBUG_CATEGORY_GET(cat,name) G_STMT_START{\
536 cat = _gst_debug_get_category (name); \
543 * Default gstreamer core debug log category. Please define your own.
545 GST_EXPORT GstDebugCategory * GST_CAT_DEFAULT;
546 /* this symbol may not be used */
547 GST_EXPORT gboolean _gst_debug_enabled;
549 /* the min debug level, used for quickly discarding debug
550 * messages that fall under the threshold. */
551 GST_EXPORT GstDebugLevel _gst_debug_min;
555 * @cat: category to use
556 * @level: the severity of the message
557 * @object: (allow-none): the #GObject the message belongs to or %NULL if none
558 * @...: A printf-style message to output
560 * Outputs a debugging message. This is the most general macro for outputting
561 * debugging messages. You will probably want to use one of the ones described
564 #ifdef G_HAVE_ISO_VARARGS
565 #define GST_CAT_LEVEL_LOG(cat,level,object,...) G_STMT_START{ \
566 if (G_UNLIKELY (level <= GST_LEVEL_MAX && level <= _gst_debug_min)) { \
567 gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, \
568 (GObject *) (object), __VA_ARGS__); \
571 #else /* G_HAVE_GNUC_VARARGS */
572 #ifdef G_HAVE_GNUC_VARARGS
573 #define GST_CAT_LEVEL_LOG(cat,level,object,args...) G_STMT_START{ \
574 if (G_UNLIKELY (level <= GST_LEVEL_MAX && level <= _gst_debug_min)) { \
575 gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, \
576 (GObject *) (object), ##args ); \
579 #else /* no variadic macros, use inline */
581 GST_CAT_LEVEL_LOG_valist (GstDebugCategory * cat,
582 GstDebugLevel level, gpointer object, const char *format, va_list varargs)
584 if (G_UNLIKELY (level <= GST_LEVEL_MAX && level <= _gst_debug_min)) {
585 gst_debug_log_valist (cat, level, "", "", 0, (GObject *) object, format,
591 GST_CAT_LEVEL_LOG (GstDebugCategory * cat, GstDebugLevel level,
592 gpointer object, const char *format, ...)
596 va_start (varargs, format);
597 GST_CAT_LEVEL_LOG_valist (cat, level, object, format, varargs);
601 #endif /* G_HAVE_ISO_VARARGS */
603 /* This one doesn't have varargs in the macro, so it's different than all the
604 * other macros and hence in a separate block right here. Docs chunks are
605 * with the other doc chunks below though. */
606 #define __GST_CAT_MEMDUMP_LOG(cat,object,msg,data,length) G_STMT_START{ \
607 if (G_UNLIKELY (GST_LEVEL_MEMDUMP <= GST_LEVEL_MAX && \
608 GST_LEVEL_MEMDUMP <= _gst_debug_min)) { \
609 _gst_debug_dump_mem ((cat), __FILE__, GST_FUNCTION, __LINE__, \
610 (GObject *) (object), (msg), (data), (length)); \
614 #define GST_CAT_MEMDUMP_OBJECT(cat,obj,msg,data,length) \
615 __GST_CAT_MEMDUMP_LOG(cat,obj,msg,data,length)
616 #define GST_CAT_MEMDUMP(cat,msg,data,length) \
617 __GST_CAT_MEMDUMP_LOG(cat,NULL,msg,data,length)
618 #define GST_MEMDUMP_OBJECT(obj,msg,data,length) \
619 __GST_CAT_MEMDUMP_LOG(GST_CAT_DEFAULT,obj,msg,data,length)
620 #define GST_MEMDUMP(msg,data,length) \
621 __GST_CAT_MEMDUMP_LOG(GST_CAT_DEFAULT,NULL,msg,data,length)
624 * GST_CAT_ERROR_OBJECT:
625 * @cat: category to use
626 * @obj: the #GObject the message belongs to
627 * @...: printf-style message to output
629 * Output an error message belonging to the given object in the given category.
632 * GST_CAT_WARNING_OBJECT:
633 * @cat: category to use
634 * @obj: the #GObject the message belongs to
635 * @...: printf-style message to output
637 * Output a warning message belonging to the given object in the given category.
640 * GST_CAT_INFO_OBJECT:
641 * @cat: category to use
642 * @obj: the #GObject the message belongs to
643 * @...: printf-style message to output
645 * Output an informational message belonging to the given object in the given
649 * GST_CAT_DEBUG_OBJECT:
650 * @cat: category to use
651 * @obj: the #GObject the message belongs to
652 * @...: printf-style message to output
654 * Output an debugging message belonging to the given object in the given category.
657 * GST_CAT_LOG_OBJECT:
658 * @cat: category to use
659 * @obj: the #GObject the message belongs to
660 * @...: printf-style message to output
662 * Output an logging message belonging to the given object in the given category.
665 * GST_CAT_FIXME_OBJECT:
666 * @cat: category to use
667 * @obj: the #GObject the message belongs to
668 * @...: printf-style message to output
670 * Output a fixme message belonging to the given object in the given category.
673 * GST_CAT_TRACE_OBJECT:
674 * @cat: category to use
675 * @obj: the #GObject the message belongs to
676 * @...: printf-style message to output
678 * Output a tracing message belonging to the given object in the given
682 * GST_CAT_MEMDUMP_OBJECT:
683 * @cat: category to use
684 * @obj: the #GObject the message belongs to
685 * @msg: message string to log with the data
686 * @data: pointer to the data to output
687 * @length: length of the data to output
689 * Output a hexdump of @data relating to the given object in the given
696 * @cat: category to use
697 * @...: printf-style message to output
699 * Output an error message in the given category.
703 * @cat: category to use
704 * @...: printf-style message to output
706 * Output an warning message in the given category.
710 * @cat: category to use
711 * @...: printf-style message to output
713 * Output an informational message in the given category.
717 * @cat: category to use
718 * @...: printf-style message to output
720 * Output an debugging message in the given category.
724 * @cat: category to use
725 * @...: printf-style message to output
727 * Output an logging message in the given category.
731 * @cat: category to use
732 * @...: printf-style message to output
734 * Output an fixme message in the given category.
738 * @cat: category to use
739 * @...: printf-style message to output
741 * Output a tracing message in the given category.
745 * @cat: category to use
746 * @msg: message string to log with the data
747 * @data: pointer to the data to output
748 * @length: length of the data to output
750 * Output a hexdump of @data in the given category.
756 * @obj: the #GObject the message belongs to
757 * @...: printf-style message to output
759 * Output an error message belonging to the given object in the default category.
762 * GST_WARNING_OBJECT:
763 * @obj: the #GObject the message belongs to
764 * @...: printf-style message to output
766 * Output a warning message belonging to the given object in the default category.
770 * @obj: the #GObject the message belongs to
771 * @...: printf-style message to output
773 * Output an informational message belonging to the given object in the default
778 * @obj: the #GObject the message belongs to
779 * @...: printf-style message to output
781 * Output a debugging message belonging to the given object in the default
786 * @obj: the #GObject the message belongs to
787 * @...: printf-style message to output
789 * Output a logging message belonging to the given object in the default category.
793 * @obj: the #GObject the message belongs to
794 * @...: printf-style message to output
796 * Output a fixme message belonging to the given object in the default category.
800 * @obj: the #GObject the message belongs to
801 * @...: printf-style message to output
803 * Output a tracing message belonging to the given object in the default category.
806 * GST_MEMDUMP_OBJECT:
807 * @obj: the #GObject the message belongs to
808 * @msg: message string to log with the data
809 * @data: pointer to the data to output
810 * @length: length of the data to output
812 * Output a logging message belonging to the given object in the default category.
818 * @...: printf-style message to output
820 * Output an error message in the default category.
824 * @...: printf-style message to output
826 * Output a warning message in the default category.
830 * @...: printf-style message to output
832 * Output an informational message in the default category.
836 * @...: printf-style message to output
838 * Output a debugging message in the default category.
842 * @...: printf-style message to output
844 * Output a logging message in the default category.
848 * @...: printf-style message to output
850 * Output a fixme message in the default category.
854 * @...: printf-style message to output
856 * Output a tracing message in the default category.
860 * @msg: message string to log with the data
861 * @data: pointer to the data to output
862 * @length: length of the data to output
864 * Output a hexdump of @data.
867 #ifdef G_HAVE_ISO_VARARGS
869 #define GST_CAT_ERROR_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, obj, __VA_ARGS__)
870 #define GST_CAT_WARNING_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, obj, __VA_ARGS__)
871 #define GST_CAT_INFO_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, obj, __VA_ARGS__)
872 #define GST_CAT_DEBUG_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, obj, __VA_ARGS__)
873 #define GST_CAT_LOG_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, obj, __VA_ARGS__)
874 #define GST_CAT_FIXME_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME, obj, __VA_ARGS__)
875 #define GST_CAT_TRACE_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE, obj, __VA_ARGS__)
877 #define GST_CAT_ERROR(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, NULL, __VA_ARGS__)
878 #define GST_CAT_WARNING(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
879 #define GST_CAT_INFO(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, NULL, __VA_ARGS__)
880 #define GST_CAT_DEBUG(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, NULL, __VA_ARGS__)
881 #define GST_CAT_LOG(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, NULL, __VA_ARGS__)
882 #define GST_CAT_FIXME(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME, NULL, __VA_ARGS__)
883 #define GST_CAT_TRACE(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE, NULL, __VA_ARGS__)
885 #define GST_ERROR_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, obj, __VA_ARGS__)
886 #define GST_WARNING_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj, __VA_ARGS__)
887 #define GST_INFO_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, obj, __VA_ARGS__)
888 #define GST_DEBUG_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, obj, __VA_ARGS__)
889 #define GST_LOG_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, obj, __VA_ARGS__)
890 #define GST_FIXME_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME, obj, __VA_ARGS__)
891 #define GST_TRACE_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE, obj, __VA_ARGS__)
893 #define GST_ERROR(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, NULL, __VA_ARGS__)
894 #define GST_WARNING(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
895 #define GST_INFO(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, __VA_ARGS__)
896 #define GST_DEBUG(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, __VA_ARGS__)
897 #define GST_LOG(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, NULL, __VA_ARGS__)
898 #define GST_FIXME(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME, NULL, __VA_ARGS__)
899 #define GST_TRACE(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE, NULL, __VA_ARGS__)
902 #ifdef G_HAVE_GNUC_VARARGS
904 #define GST_CAT_ERROR_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, obj, ##args )
905 #define GST_CAT_WARNING_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, obj, ##args )
906 #define GST_CAT_INFO_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, obj, ##args )
907 #define GST_CAT_DEBUG_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, obj, ##args )
908 #define GST_CAT_LOG_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, obj, ##args )
909 #define GST_CAT_FIXME_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME, obj, ##args )
910 #define GST_CAT_TRACE_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE, obj, ##args )
912 #define GST_CAT_ERROR(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, NULL, ##args )
913 #define GST_CAT_WARNING(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, NULL, ##args )
914 #define GST_CAT_INFO(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, NULL, ##args )
915 #define GST_CAT_DEBUG(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, NULL, ##args )
916 #define GST_CAT_LOG(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, NULL, ##args )
917 #define GST_CAT_FIXME(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME, NULL, ##args )
918 #define GST_CAT_TRACE(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE, NULL, ##args )
920 #define GST_ERROR_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, obj, ##args )
921 #define GST_WARNING_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj, ##args )
922 #define GST_INFO_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, obj, ##args )
923 #define GST_DEBUG_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, obj, ##args )
924 #define GST_LOG_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, obj, ##args )
925 #define GST_FIXME_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME, obj, ##args )
926 #define GST_TRACE_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE, obj, ##args )
928 #define GST_ERROR(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, NULL, ##args )
929 #define GST_WARNING(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, ##args )
930 #define GST_INFO(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, ##args )
931 #define GST_DEBUG(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, ##args )
932 #define GST_LOG(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, NULL, ##args )
933 #define GST_FIXME(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME, NULL, ##args )
934 #define GST_TRACE(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE, NULL, ##args )
937 /* no variadic macros, use inline */
939 GST_CAT_ERROR_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
944 va_start (varargs, format);
945 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_ERROR, obj, format, varargs);
950 GST_CAT_WARNING_OBJECT (GstDebugCategory * cat, gpointer obj,
951 const char *format, ...)
955 va_start (varargs, format);
956 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_WARNING, obj, format, varargs);
961 GST_CAT_INFO_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
966 va_start (varargs, format);
967 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_INFO, obj, format, varargs);
972 GST_CAT_DEBUG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
977 va_start (varargs, format);
978 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_DEBUG, obj, format, varargs);
983 GST_CAT_LOG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
988 va_start (varargs, format);
989 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_LOG, obj, format, varargs);
994 GST_CAT_FIXME_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
999 va_start (varargs, format);
1000 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_FIXME, obj, format, varargs);
1005 GST_CAT_TRACE_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1010 va_start (varargs, format);
1011 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_TRACE, obj, format, varargs);
1016 GST_CAT_ERROR (GstDebugCategory * cat, const char *format, ...)
1020 va_start (varargs, format);
1021 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_ERROR, NULL, format, varargs);
1026 GST_CAT_WARNING (GstDebugCategory * cat, const char *format, ...)
1030 va_start (varargs, format);
1031 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_WARNING, NULL, format, varargs);
1036 GST_CAT_INFO (GstDebugCategory * cat, const char *format, ...)
1040 va_start (varargs, format);
1041 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_INFO, NULL, format, varargs);
1046 GST_CAT_DEBUG (GstDebugCategory * cat, const char *format, ...)
1050 va_start (varargs, format);
1051 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_DEBUG, NULL, format, varargs);
1056 GST_CAT_LOG (GstDebugCategory * cat, const char *format, ...)
1060 va_start (varargs, format);
1061 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_LOG, NULL, format, varargs);
1066 GST_CAT_FIXME (GstDebugCategory * cat, const char *format, ...)
1070 va_start (varargs, format);
1071 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_FIXME, NULL, format, varargs);
1076 GST_CAT_TRACE (GstDebugCategory * cat, const char *format, ...)
1080 va_start (varargs, format);
1081 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_TRACE, NULL, format, varargs);
1086 GST_ERROR_OBJECT (gpointer obj, const char *format, ...)
1090 va_start (varargs, format);
1091 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_ERROR, obj, format,
1097 GST_WARNING_OBJECT (gpointer obj, const char *format, ...)
1101 va_start (varargs, format);
1102 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj, format,
1108 GST_INFO_OBJECT (gpointer obj, const char *format, ...)
1112 va_start (varargs, format);
1113 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_INFO, obj, format,
1119 GST_DEBUG_OBJECT (gpointer obj, const char *format, ...)
1123 va_start (varargs, format);
1124 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, obj, format,
1130 GST_LOG_OBJECT (gpointer obj, const char *format, ...)
1134 va_start (varargs, format);
1135 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_LOG, obj, format,
1141 GST_FIXME_OBJECT (gpointer obj, const char *format, ...)
1145 va_start (varargs, format);
1146 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_FIXME, obj, format,
1152 GST_TRACE_OBJECT (gpointer obj, const char *format, ...)
1156 va_start (varargs, format);
1157 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_TRACE, obj, format,
1163 GST_ERROR (const char *format, ...)
1167 va_start (varargs, format);
1168 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_ERROR, NULL, format,
1174 GST_WARNING (const char *format, ...)
1178 va_start (varargs, format);
1179 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, format,
1185 GST_INFO (const char *format, ...)
1189 va_start (varargs, format);
1190 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, format,
1196 GST_DEBUG (const char *format, ...)
1200 va_start (varargs, format);
1201 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, format,
1207 GST_LOG (const char *format, ...)
1211 va_start (varargs, format);
1212 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_LOG, NULL,
1218 GST_FIXME (const char *format, ...)
1222 va_start (varargs, format);
1223 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_FIXME, NULL, format,
1229 GST_TRACE (const char *format, ...)
1233 va_start (varargs, format);
1234 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_TRACE, NULL, format,
1242 /********** function pointer stuff **********/
1245 * GST_DEBUG_REGISTER_FUNCPTR:
1246 * @ptr: pointer to the function to register
1248 * Register a pointer to a function with its name, so it can later be used by
1249 * GST_DEBUG_FUNCPTR_NAME().
1251 * Use this variant of #GST_DEBUG_FUNCPTR if you do not need to use @ptr.
1253 #define GST_DEBUG_REGISTER_FUNCPTR(ptr) \
1254 _gst_debug_register_funcptr((GstDebugFuncPtr)(ptr), #ptr)
1256 * GST_DEBUG_FUNCPTR:
1257 * @ptr: pointer to the function to register
1259 * Register a pointer to a function with its name, so it can later be used by
1260 * GST_DEBUG_FUNCPTR_NAME().
1262 * Returns: the value passed to @ptr.
1264 #define GST_DEBUG_FUNCPTR(ptr) \
1265 (_gst_debug_register_funcptr((GstDebugFuncPtr)(ptr), #ptr) , ptr)
1268 * GST_DEBUG_FUNCPTR_NAME:
1269 * @ptr: address of the function of which to look up the name
1271 * Retrieves the name of the function, if it was previously registered with
1272 * GST_DEBUG_FUNCPTR(). If not, it returns a description of the pointer.
1274 * This macro returns a constant string which must not be modified or
1275 * freed by the caller.
1277 #define GST_DEBUG_FUNCPTR_NAME(ptr) \
1278 _gst_debug_nameof_funcptr((GstDebugFuncPtr)ptr)
1281 #else /* GST_DISABLE_GST_DEBUG */
1286 #if defined(__GNUC__) && __GNUC__ >= 3
1287 # pragma GCC poison gst_debug_log
1288 # pragma GCC poison gst_debug_log_valist
1289 # pragma GCC poison _gst_debug_category_new
1292 #define _gst_debug_min GST_LEVEL_NONE
1294 #define gst_debug_set_default_threshold(level) G_STMT_START{ }G_STMT_END
1295 #define gst_debug_get_default_threshold() (GST_LEVEL_NONE)
1297 #define gst_debug_level_get_name(level) ("NONE")
1298 #define gst_debug_message_get(message) ("")
1299 #define gst_debug_add_log_function(func,data,notify) G_STMT_START{ }G_STMT_END
1300 #define gst_debug_set_active(active) G_STMT_START{ }G_STMT_END
1301 #define gst_debug_is_active() (FALSE)
1302 #define gst_debug_set_colored(colored) G_STMT_START{ }G_STMT_END
1303 #define gst_debug_set_color_mode(mode) G_STMT_START{ }G_STMT_END
1304 #define gst_debug_set_color_mode_from_string(mode) G_STMT_START{ }G_STMT_END
1305 #define gst_debug_is_colored() (FALSE)
1306 #define gst_debug_get_color_mode() (GST_DEBUG_COLOR_MODE_OFF)
1307 #define gst_debug_set_default_threshold(level) G_STMT_START{ }G_STMT_END
1308 #define gst_debug_get_default_threshold() (GST_LEVEL_NONE)
1309 #define gst_debug_set_threshold_for_name(name,level) G_STMT_START{ }G_STMT_END
1310 #define gst_debug_unset_threshold_for_name(name) G_STMT_START{ }G_STMT_END
1312 /* we are using dummy function prototypes here to eat ';' as these macros are
1313 * used outside of functions */
1314 #define GST_DEBUG_CATEGORY(var) void _gst_debug_dummy_##var (void)
1315 #define GST_DEBUG_CATEGORY_EXTERN(var) void _gst_debug_dummy_extern_##var (void)
1316 #define GST_DEBUG_CATEGORY_STATIC(var) void _gst_debug_dummy_static_##var (void)
1318 #define GST_DEBUG_CATEGORY_INIT(var,name,color,desc) G_STMT_START{ }G_STMT_END
1319 #define GST_DEBUG_CATEGORY_GET(var,name) G_STMT_START{ }G_STMT_END
1320 #define gst_debug_category_free(category) G_STMT_START{ }G_STMT_END
1321 #define gst_debug_category_set_threshold(category,level) G_STMT_START{ }G_STMT_END
1322 #define gst_debug_category_reset_threshold(category) G_STMT_START{ }G_STMT_END
1323 #define gst_debug_category_get_threshold(category) (GST_LEVEL_NONE)
1324 #define gst_debug_category_get_name(cat) ("")
1325 #define gst_debug_category_get_color(cat) (0)
1326 #define gst_debug_category_get_description(cat) ("")
1327 #define gst_debug_get_all_categories() (NULL)
1328 #define gst_debug_construct_term_color(colorinfo) (g_strdup ("00"))
1329 #define gst_debug_construct_win_color(colorinfo) (0)
1331 #endif /* !GST_INFO_C */
1333 #ifdef G_HAVE_ISO_VARARGS
1335 #define GST_CAT_LEVEL_LOG(cat,level,...) G_STMT_START{ }G_STMT_END
1337 #define GST_CAT_ERROR_OBJECT(...) G_STMT_START{ }G_STMT_END
1338 #define GST_CAT_WARNING_OBJECT(...) G_STMT_START{ }G_STMT_END
1339 #define GST_CAT_INFO_OBJECT(...) G_STMT_START{ }G_STMT_END
1340 #define GST_CAT_DEBUG_OBJECT(...) G_STMT_START{ }G_STMT_END
1341 #define GST_CAT_LOG_OBJECT(...) G_STMT_START{ }G_STMT_END
1342 #define GST_CAT_FIXME_OBJECT(...) G_STMT_START{ }G_STMT_END
1343 #define GST_CAT_TRACE_OBJECT(...) G_STMT_START{ }G_STMT_END
1345 #define GST_CAT_ERROR(...) G_STMT_START{ }G_STMT_END
1346 #define GST_CAT_WARNING(...) G_STMT_START{ }G_STMT_END
1347 #define GST_CAT_INFO(...) G_STMT_START{ }G_STMT_END
1348 #define GST_CAT_DEBUG(...) G_STMT_START{ }G_STMT_END
1349 #define GST_CAT_LOG(...) G_STMT_START{ }G_STMT_END
1350 #define GST_CAT_FIXME(...) G_STMT_START{ }G_STMT_END
1351 #define GST_CAT_TRACE(...) G_STMT_START{ }G_STMT_END
1353 #define GST_ERROR_OBJECT(...) G_STMT_START{ }G_STMT_END
1354 #define GST_WARNING_OBJECT(...) G_STMT_START{ }G_STMT_END
1355 #define GST_INFO_OBJECT(...) G_STMT_START{ }G_STMT_END
1356 #define GST_DEBUG_OBJECT(...) G_STMT_START{ }G_STMT_END
1357 #define GST_LOG_OBJECT(...) G_STMT_START{ }G_STMT_END
1358 #define GST_FIXME_OBJECT(...) G_STMT_START{ }G_STMT_END
1359 #define GST_TRACE_OBJECT(...) G_STMT_START{ }G_STMT_END
1361 #define GST_ERROR(...) G_STMT_START{ }G_STMT_END
1362 #define GST_WARNING(...) G_STMT_START{ }G_STMT_END
1363 #define GST_INFO(...) G_STMT_START{ }G_STMT_END
1364 #define GST_DEBUG(...) G_STMT_START{ }G_STMT_END
1365 #define GST_LOG(...) G_STMT_START{ }G_STMT_END
1366 #define GST_FIXME(...) G_STMT_START{ }G_STMT_END
1367 #define GST_TRACE(...) G_STMT_START{ }G_STMT_END
1369 #else /* !G_HAVE_ISO_VARARGS */
1370 #ifdef G_HAVE_GNUC_VARARGS
1372 #define GST_CAT_LEVEL_LOG(cat,level,args...) G_STMT_START{ }G_STMT_END
1374 #define GST_CAT_ERROR_OBJECT(args...) G_STMT_START{ }G_STMT_END
1375 #define GST_CAT_WARNING_OBJECT(args...) G_STMT_START{ }G_STMT_END
1376 #define GST_CAT_INFO_OBJECT(args...) G_STMT_START{ }G_STMT_END
1377 #define GST_CAT_DEBUG_OBJECT(args...) G_STMT_START{ }G_STMT_END
1378 #define GST_CAT_LOG_OBJECT(args...) G_STMT_START{ }G_STMT_END
1379 #define GST_CAT_FIXME_OBJECT(args...) G_STMT_START{ }G_STMT_END
1380 #define GST_CAT_TRACE_OBJECT(args...) G_STMT_START{ }G_STMT_END
1382 #define GST_CAT_ERROR(args...) G_STMT_START{ }G_STMT_END
1383 #define GST_CAT_WARNING(args...) G_STMT_START{ }G_STMT_END
1384 #define GST_CAT_INFO(args...) G_STMT_START{ }G_STMT_END
1385 #define GST_CAT_DEBUG(args...) G_STMT_START{ }G_STMT_END
1386 #define GST_CAT_LOG(args...) G_STMT_START{ }G_STMT_END
1387 #define GST_CAT_FIXME(args...) G_STMT_START{ }G_STMT_END
1388 #define GST_CAT_TRACE(args...) G_STMT_START{ }G_STMT_END
1390 #define GST_ERROR_OBJECT(args...) G_STMT_START{ }G_STMT_END
1391 #define GST_WARNING_OBJECT(args...) G_STMT_START{ }G_STMT_END
1392 #define GST_INFO_OBJECT(args...) G_STMT_START{ }G_STMT_END
1393 #define GST_DEBUG_OBJECT(args...) G_STMT_START{ }G_STMT_END
1394 #define GST_LOG_OBJECT(args...) G_STMT_START{ }G_STMT_END
1395 #define GST_FIXME_OBJECT(args...) G_STMT_START{ }G_STMT_END
1396 #define GST_TRACE_OBJECT(args...) G_STMT_START{ }G_STMT_END
1398 #define GST_ERROR(args...) G_STMT_START{ }G_STMT_END
1399 #define GST_WARNING(args...) G_STMT_START{ }G_STMT_END
1400 #define GST_INFO(args...) G_STMT_START{ }G_STMT_END
1401 #define GST_DEBUG(args...) G_STMT_START{ }G_STMT_END
1402 #define GST_LOG(args...) G_STMT_START{ }G_STMT_END
1403 #define GST_FIXME(args...) G_STMT_START{ }G_STMT_END
1404 #define GST_TRACE(args...) G_STMT_START{ }G_STMT_END
1406 #else /* !G_HAVE_GNUC_VARARGS */
1408 GST_CAT_LEVEL_LOG_valist (GstDebugCategory * cat,
1409 GstDebugLevel level, gpointer object, const char *format, va_list varargs)
1414 GST_CAT_ERROR_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1420 GST_CAT_WARNING_OBJECT (GstDebugCategory * cat, gpointer obj,
1421 const char *format, ...)
1426 GST_CAT_INFO_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1432 GST_CAT_DEBUG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1438 GST_CAT_LOG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1444 GST_CAT_FIXME_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1450 GST_CAT_TRACE_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1456 GST_CAT_ERROR (GstDebugCategory * cat, const char *format, ...)
1461 GST_CAT_WARNING (GstDebugCategory * cat, const char *format, ...)
1466 GST_CAT_INFO (GstDebugCategory * cat, const char *format, ...)
1471 GST_CAT_DEBUG (GstDebugCategory * cat, const char *format, ...)
1476 GST_CAT_LOG (GstDebugCategory * cat, const char *format, ...)
1481 GST_CAT_FIXME (GstDebugCategory * cat, const char *format, ...)
1486 GST_CAT_TRACE (GstDebugCategory * cat, const char *format, ...)
1491 GST_ERROR_OBJECT (gpointer obj, const char *format, ...)
1496 GST_WARNING_OBJECT (gpointer obj, const char *format, ...)
1501 GST_INFO_OBJECT (gpointer obj, const char *format, ...)
1506 GST_DEBUG_OBJECT (gpointer obj, const char *format, ...)
1511 GST_LOG_OBJECT (gpointer obj, const char *format, ...)
1516 GST_FIXME_OBJECT (gpointer obj, const char *format, ...)
1521 GST_TRACE_OBJECT (gpointer obj, const char *format, ...)
1526 GST_ERROR (const char *format, ...)
1531 GST_WARNING (const char *format, ...)
1536 GST_INFO (const char *format, ...)
1541 GST_DEBUG (const char *format, ...)
1546 GST_LOG (const char *format, ...)
1551 GST_FIXME (const char *format, ...)
1556 GST_TRACE (const char *format, ...)
1560 #endif /* G_HAVE_GNUC_VARARGS */
1561 #endif /* G_HAVE_ISO_VARARGS */
1563 #define GST_DEBUG_REGISTER_FUNCPTR(ptr) G_STMT_START{ }G_STMT_END
1564 #define GST_DEBUG_FUNCPTR(ptr) (ptr)
1565 #define GST_DEBUG_FUNCPTR_NAME(ptr) (g_strdup_printf ("%p", ptr))
1567 #define GST_CAT_MEMDUMP_OBJECT(cat,obj,msg,data,length) G_STMT_START{ }G_STMT_END
1568 #define GST_CAT_MEMDUMP(cat,msg,data,length) G_STMT_START{ }G_STMT_END
1569 #define GST_MEMDUMP_OBJECT(obj,msg,data,length) G_STMT_START{ }G_STMT_END
1570 #define GST_MEMDUMP(msg,data,length) G_STMT_START{ }G_STMT_END
1572 #endif /* GST_DISABLE_GST_DEBUG */
1575 void gst_debug_print_stack_trace (void);
1576 gchar * gst_debug_get_stack_trace (GstStackTraceFlags flags);
1580 #endif /* __GSTINFO_H__ */