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.
154 typedef enum { /*< flags >*/
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_NONE: Try to retrieve the minimum information
181 * available, which may be none on some platforms
183 * @GST_STACK_TRACE_SHOW_FULL: Try to retrieve as much information as possible,
184 * including source information when getting the
190 GST_STACK_TRACE_SHOW_NONE = 0,
191 GST_STACK_TRACE_SHOW_FULL = 1 << 0
192 } GstStackTraceFlags;
196 * @GST_DEBUG_COLOR_MODE_OFF: Do not use colors in logs.
197 * @GST_DEBUG_COLOR_MODE_ON: Paint logs in a platform-specific way.
198 * @GST_DEBUG_COLOR_MODE_UNIX: Paint logs with UNIX terminal color codes
199 * no matter what platform GStreamer is running on.
202 GST_DEBUG_COLOR_MODE_OFF = 0,
203 GST_DEBUG_COLOR_MODE_ON = 1,
204 GST_DEBUG_COLOR_MODE_UNIX = 2
208 #define GST_DEBUG_FG_MASK (0x000F)
209 #define GST_DEBUG_BG_MASK (0x00F0)
210 #define GST_DEBUG_FORMAT_MASK (0xFF00)
212 typedef struct _GstDebugCategory GstDebugCategory;
216 * This is the struct that describes the categories. Once initialized with
217 * #GST_DEBUG_CATEGORY_INIT, its values can't be changed anymore.
219 struct _GstDebugCategory {
222 guint color; /* see defines above */
225 const gchar * description;
228 /********** some convenience macros for debugging **********/
232 * @str: (allow-none): The string to check.
234 * Macro to use when a string must not be %NULL, but may be %NULL. If the string
235 * is %NULL, "(NULL)" is printed instead.
236 * In GStreamer printf string arguments may not be %NULL, because on some
237 * platforms (ie Solaris) the libc crashes in that case. This includes debugging
240 #define GST_STR_NULL(str) ((str) ? (str) : "(NULL)")
242 /* FIXME, not MT safe */
244 * GST_DEBUG_PAD_NAME:
245 * @pad: The pad to debug.
247 * Evaluates to 2 strings, that describe the pad. Often used in debugging
250 #define GST_DEBUG_PAD_NAME(pad) \
252 ((GST_OBJECT_PARENT(pad) != NULL) ? \
253 GST_STR_NULL (GST_OBJECT_NAME (GST_OBJECT_PARENT(pad))) : \
255 (pad != NULL) ? GST_STR_NULL (GST_OBJECT_NAME (pad)) : "''"
260 * This macro should evaluate to the name of the current function and be should
261 * be defined when configuring your project, as it is compiler dependent. If it
262 * is not defined, some default value is used. It is used to provide debugging
263 * output with the function name of the message.
265 * Note that this is different from G_STRFUNC as we do not want the full
266 * function signature in C++ code.
269 #if defined (__STDC__) && defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
270 # define GST_FUNCTION ((const char*) (__func__))
271 #elif defined (__GNUC__) || (defined (_MSC_VER) && _MSC_VER >= 1300)
272 # define GST_FUNCTION ((const char*) (__FUNCTION__))
274 # define GST_FUNCTION ((const char*) ("???"))
276 #endif /* ifndef GST_FUNCTION */
279 * GST_PTR_FORMAT: (skip):
281 * printf format type used to debug GStreamer types. You can use this in
282 * combination with GStreamer's debug logging system as well as the functions
283 * gst_info_vasprintf(), gst_info_strdup_vprintf() and gst_info_strdup_printf()
284 * to pretty-print the following types: #GstCaps, #GstStructure,
285 * #GstCapsFeatures, #GstTagList, #GstDateTime, #GstBuffer, #GstBufferList,
286 * #GstMessage, #GstEvent, #GstQuery, #GstContext, #GstPad, #GstObject. All
287 * #GObject types will be printed as typename plus pointer, and everything
288 * else will simply be printed as pointer address.
290 * This can only be used on types whose size is >= sizeof(gpointer).
292 #define GST_PTR_FORMAT "p\aA"
295 * GST_SEGMENT_FORMAT: (skip):
297 * printf format type used to debug GStreamer segments. You can use this in
298 * combination with GStreamer's debug logging system as well as the functions
299 * gst_info_vasprintf(), gst_info_strdup_vprintf() and gst_info_strdup_printf()
300 * to pretty-print #GstSegment structures.
301 * This can only be used on pointers to GstSegment structures.
303 #define GST_SEGMENT_FORMAT "p\aB"
306 * GST_TIMEP_FORMAT: (skip):
308 * printf format type used to debug GStreamer ClockTime pointers. You can use
309 * this in combination with GStreamer's debug logging system as well as the
310 * functions gst_info_vasprintf(), gst_info_strdup_vprintf() and
311 * gst_info_strdup_printf() to pretty-print #GstClockTime pointers. This can
312 * only be used on pointers to GstClockTime values.
316 #define GST_TIMEP_FORMAT "p\aT"
319 * GST_STIMEP_FORMAT: (skip):
321 * printf format type used to debug GStreamer signed time value pointers. You
322 * can use this in combination with GStreamer's debug logging system as well as
323 * the functions gst_info_vasprintf(), gst_info_strdup_vprintf() and
324 * gst_info_strdup_printf() to pretty-print signed time (pointers to
325 * #GstClockTimeDiff or #gint64).
329 #define GST_STIMEP_FORMAT "p\aS"
331 typedef struct _GstDebugMessage GstDebugMessage;
335 * @category: a #GstDebugCategory
336 * @level: a #GstDebugLevel
338 * @function: function name
340 * @object: a #GObject
341 * @message: the message
342 * @user_data: user data for the log function
344 * Function prototype for a logging function that can be registered with
345 * gst_debug_add_log_function().
346 * Use G_GNUC_NO_INSTRUMENT on that function.
348 typedef void (*GstLogFunction) (GstDebugCategory * category,
351 const gchar * function,
354 GstDebugMessage * message,
358 void gst_debug_log (GstDebugCategory * category,
361 const gchar * function,
364 const gchar * format,
365 ...) G_GNUC_PRINTF (7, 8) G_GNUC_NO_INSTRUMENT;
367 void gst_debug_log_valist (GstDebugCategory * category,
370 const gchar * function,
373 const gchar * format,
374 va_list args) G_GNUC_NO_INSTRUMENT;
376 /* do not use this function, use the GST_DEBUG_CATEGORY_INIT macro */
379 GstDebugCategory *_gst_debug_category_new (const gchar * name,
381 const gchar * description);
383 /* do not use this function, use the GST_DEBUG_CATEGORY_GET macro */
386 GstDebugCategory *_gst_debug_get_category (const gchar *name);
389 /* do not use this function, use the GST_CAT_MEMDUMP_* macros */
392 void _gst_debug_dump_mem (GstDebugCategory * cat, const gchar * file,
393 const gchar * func, gint line, GObject * obj, const gchar * msg,
394 const guint8 * data, guint length);
397 * GstDebugFuncPtr: (attributes doc.skip=true)
398 * we define this to avoid a compiler warning regarding a cast from a function
399 * pointer to a void pointer
400 * (see https://bugzilla.gnome.org/show_bug.cgi?id=309253)
402 typedef void (* GstDebugFuncPtr) (void);
404 /* do no use these functions, use the GST_DEBUG*_FUNCPTR macros */
407 void _gst_debug_register_funcptr (GstDebugFuncPtr func,
408 const gchar * ptrname);
411 _gst_debug_nameof_funcptr (GstDebugFuncPtr func) G_GNUC_NO_INSTRUMENT;
415 const gchar * gst_debug_message_get (GstDebugMessage * message);
418 gchar * gst_debug_log_get_line (GstDebugCategory * category,
421 const gchar * function,
424 GstDebugMessage * message) G_GNUC_NO_INSTRUMENT;
427 void gst_debug_log_default (GstDebugCategory * category,
430 const gchar * function,
433 GstDebugMessage * message,
434 gpointer user_data) G_GNUC_NO_INSTRUMENT;
437 const gchar * gst_debug_level_get_name (GstDebugLevel level);
440 void gst_debug_add_log_function (GstLogFunction func,
442 GDestroyNotify notify);
444 guint gst_debug_remove_log_function (GstLogFunction func);
447 guint gst_debug_remove_log_function_by_data (gpointer data);
450 void gst_debug_set_active (gboolean active);
453 gboolean gst_debug_is_active (void);
456 void gst_debug_set_colored (gboolean colored);
459 void gst_debug_set_color_mode (GstDebugColorMode mode);
462 void gst_debug_set_color_mode_from_string (const gchar * mode);
465 gboolean gst_debug_is_colored (void);
468 GstDebugColorMode gst_debug_get_color_mode (void);
471 void gst_debug_set_default_threshold (GstDebugLevel level);
474 GstDebugLevel gst_debug_get_default_threshold (void);
477 void gst_debug_set_threshold_for_name (const gchar * name,
478 GstDebugLevel level);
480 void gst_debug_set_threshold_from_string (const gchar * list, gboolean reset);
483 void gst_debug_unset_threshold_for_name (const gchar * name);
486 void gst_debug_category_free (GstDebugCategory * category);
489 void gst_debug_category_set_threshold (GstDebugCategory * category,
490 GstDebugLevel level);
493 void gst_debug_category_reset_threshold (GstDebugCategory * category);
496 GstDebugLevel gst_debug_category_get_threshold (GstDebugCategory * category);
499 const gchar * gst_debug_category_get_name (GstDebugCategory * category);
502 guint gst_debug_category_get_color (GstDebugCategory * category);
505 const gchar * gst_debug_category_get_description (GstDebugCategory * category);
508 GSList * gst_debug_get_all_categories (void);
512 gchar * gst_debug_construct_term_color (guint colorinfo);
515 gint gst_debug_construct_win_color (guint colorinfo);
518 gint gst_info_vasprintf (gchar ** result,
519 const gchar * format,
520 va_list args) G_GNUC_PRINTF (2, 0);
522 gchar * gst_info_strdup_vprintf (const gchar *format, va_list args) G_GNUC_PRINTF (1, 0);
525 gchar * gst_info_strdup_printf (const gchar *format, ...) G_GNUC_PRINTF (1, 2);
528 void gst_print (const gchar * format, ...) G_GNUC_PRINTF (1, 2);
531 void gst_println (const gchar * format, ...) G_GNUC_PRINTF (1, 2);
534 void gst_printerr (const gchar * format, ...) G_GNUC_PRINTF (1, 2);
537 void gst_printerrln (const gchar * format, ...) G_GNUC_PRINTF (1, 2);
539 #ifndef GST_DISABLE_GST_DEBUG
541 /* cast to void * avoids a warning with gcc 6
542 * see https://bugzilla.gnome.org/show_bug.cgi?id=764526 */
543 #define gst_debug_add_log_function(func,data,notify) \
545 if ((func) == (void *) gst_debug_log_default) { \
546 gst_debug_add_log_function(NULL,data,notify); \
548 gst_debug_add_log_function(func,data,notify); \
552 #define gst_debug_remove_log_function(func) \
553 ((func) == (void *) gst_debug_log_default) ? \
554 gst_debug_remove_log_function(NULL) : \
555 gst_debug_remove_log_function(func)
558 * GST_DEBUG_CATEGORY:
561 * Defines a GstDebugCategory variable.
562 * This macro expands to nothing if debugging is disabled.
564 #define GST_DEBUG_CATEGORY(cat) GstDebugCategory *cat = NULL
566 * GST_DEBUG_CATEGORY_EXTERN:
569 * Declares a GstDebugCategory variable as extern. Use in header files.
570 * This macro expands to nothing if debugging is disabled.
572 #define GST_DEBUG_CATEGORY_EXTERN(cat) extern GstDebugCategory *cat
575 * GST_DEBUG_CATEGORY_STATIC:
578 * Defines a static GstDebugCategory variable.
579 * This macro expands to nothing if debugging is disabled.
581 #define GST_DEBUG_CATEGORY_STATIC(cat) static GstDebugCategory *cat = NULL
584 * GST_DEBUG_CATEGORY_INIT:
585 * @cat: the category to initialize.
586 * @name: the name of the category.
587 * @color: the colors to use for a color representation or 0 for no color.
588 * @description: optional description of the category.
590 * Initializes a new #GstDebugCategory with the given properties and set to
591 * the default threshold.
593 * > This macro expands to nothing if debugging is disabled.
595 * > When naming your category, please follow the following conventions to ensure
596 * > that the pattern matching for categories works as expected. It is not
597 * > earth-shattering if you don't follow these conventions, but it would be nice
600 * > If you define a category for a plugin or a feature of it, name the category
601 * > like the feature. So if you wanted to write a "filesrc" element, you would
602 * > name the category "filesrc". Use lowercase letters only.
603 * > If you define more than one category for the same element, append an
604 * > underscore and an identifier to your categories, like this: "filesrc_cache"
606 * > If you create a library or an application using debugging categories, use a
607 * > common prefix followed by an underscore for all your categories. GStreamer
608 * > uses the GST prefix so GStreamer categories look like "GST_STATES". Be sure
609 * > to include uppercase letters.
612 #define GST_DEBUG_CATEGORY_INIT(cat,name,color,description) G_STMT_START{\
614 cat = _gst_debug_category_new (name,color,description); \
618 * GST_DEBUG_CATEGORY_GET:
619 * @cat: the category to initialize.
620 * @name: log category name
622 * Looks up an existing #GstDebugCategory by its @name and sets @cat. If the
623 * category is not found, but GST_CAT_DEFAULT is defined, that is assigned to
624 * @cat. Otherwise @cat will be %NULL.
626 * |[<!-- language="C" -->
627 * GST_DEBUG_CATEGORY_STATIC (gst_myplugin_debug);
628 * #define GST_CAT_DEFAULT gst_myplugin_debug
629 * GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE);
631 * GST_DEBUG_CATEGORY_INIT (gst_myplugin_debug, "myplugin", 0, "nice element");
632 * GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "GST_PERFORMANCE");
635 #ifdef GST_CAT_DEFAULT
636 #define GST_DEBUG_CATEGORY_GET(cat,name) G_STMT_START{\
637 cat = _gst_debug_get_category (name); \
639 cat = GST_CAT_DEFAULT; \
643 #define GST_DEBUG_CATEGORY_GET(cat,name) G_STMT_START{\
644 cat = _gst_debug_get_category (name); \
651 * Default gstreamer core debug log category. Please define your own.
654 GST_API GstDebugCategory * GST_CAT_DEFAULT;
655 /* this symbol may not be used */
657 GST_API gboolean _gst_debug_enabled;
659 /* the min debug level, used for quickly discarding debug
660 * messages that fall under the threshold. */
662 GST_API GstDebugLevel _gst_debug_min;
666 * @cat: category to use
667 * @level: the severity of the message
668 * @object: (allow-none): the #GObject the message belongs to or %NULL if none
669 * @...: A printf-style message to output
671 * Outputs a debugging message. This is the most general macro for outputting
672 * debugging messages. You will probably want to use one of the ones described
675 * There is no need to finish the end of the debug message with a newline
676 * character, a newline character will be added automatically.
678 #ifdef G_HAVE_ISO_VARARGS
679 #define GST_CAT_LEVEL_LOG(cat,level,object,...) G_STMT_START{ \
680 if (G_UNLIKELY ((level) <= GST_LEVEL_MAX && (level) <= _gst_debug_min)) { \
681 gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, \
682 (GObject *) (object), __VA_ARGS__); \
685 #else /* G_HAVE_GNUC_VARARGS */
686 #ifdef G_HAVE_GNUC_VARARGS
687 #define GST_CAT_LEVEL_LOG(cat,level,object,args...) G_STMT_START{ \
688 if (G_UNLIKELY ((level) <= GST_LEVEL_MAX && (level) <= _gst_debug_min)) { \
689 gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, \
690 (GObject *) (object), ##args ); \
693 #else /* no variadic macros, use inline */
695 GST_CAT_LEVEL_LOG_valist (GstDebugCategory * cat,
696 GstDebugLevel level, gpointer object, const char *format, va_list varargs)
698 if (G_UNLIKELY ((level) <= GST_LEVEL_MAX && (level) <= _gst_debug_min)) {
699 gst_debug_log_valist (cat, level, "", "", 0, (GObject *) object, format,
705 GST_CAT_LEVEL_LOG (GstDebugCategory * cat, GstDebugLevel level,
706 gpointer object, const char *format, ...)
710 va_start (varargs, format);
711 GST_CAT_LEVEL_LOG_valist (cat, level, object, format, varargs);
715 #endif /* G_HAVE_ISO_VARARGS */
717 /* This one doesn't have varargs in the macro, so it's different than all the
718 * other macros and hence in a separate block right here. Docs chunks are
719 * with the other doc chunks below though. */
720 #define __GST_CAT_MEMDUMP_LOG(cat,object,msg,data,length) G_STMT_START{ \
721 if (G_UNLIKELY (GST_LEVEL_MEMDUMP <= GST_LEVEL_MAX && \
722 GST_LEVEL_MEMDUMP <= _gst_debug_min)) { \
723 _gst_debug_dump_mem ((cat), __FILE__, GST_FUNCTION, __LINE__, \
724 (GObject *) (object), (msg), (data), (length)); \
728 #define GST_CAT_MEMDUMP_OBJECT(cat,obj,msg,data,length) \
729 __GST_CAT_MEMDUMP_LOG(cat,obj,msg,data,length)
730 #define GST_CAT_MEMDUMP(cat,msg,data,length) \
731 __GST_CAT_MEMDUMP_LOG(cat,NULL,msg,data,length)
732 #define GST_MEMDUMP_OBJECT(obj,msg,data,length) \
733 __GST_CAT_MEMDUMP_LOG(GST_CAT_DEFAULT,obj,msg,data,length)
734 #define GST_MEMDUMP(msg,data,length) \
735 __GST_CAT_MEMDUMP_LOG(GST_CAT_DEFAULT,NULL,msg,data,length)
738 * GST_CAT_ERROR_OBJECT:
739 * @cat: category to use
740 * @obj: the #GObject the message belongs to
741 * @...: printf-style message to output
743 * Output an error message belonging to the given object in the given category.
745 * There is no need to finish the end of the message string with a newline
746 * character, a newline character will be added automatically.
749 * GST_CAT_WARNING_OBJECT:
750 * @cat: category to use
751 * @obj: the #GObject the message belongs to
752 * @...: printf-style message to output
754 * Output a warning message belonging to the given object in the given category.
756 * There is no need to finish the end of the message string with a newline
757 * character, a newline character will be added automatically.
760 * GST_CAT_INFO_OBJECT:
761 * @cat: category to use
762 * @obj: the #GObject the message belongs to
763 * @...: printf-style message to output
765 * Output an informational message belonging to the given object in the given
768 * There is no need to finish the end of the message string with a newline
769 * character, a newline character will be added automatically.
772 * GST_CAT_DEBUG_OBJECT:
773 * @cat: category to use
774 * @obj: the #GObject the message belongs to
775 * @...: printf-style message to output
777 * Output an debugging message belonging to the given object in the given category.
779 * There is no need to finish the end of the message string with a newline
780 * character, a newline character will be added automatically.
783 * GST_CAT_LOG_OBJECT:
784 * @cat: category to use
785 * @obj: the #GObject the message belongs to
786 * @...: printf-style message to output
788 * Output an logging message belonging to the given object in the given category.
790 * There is no need to finish the end of the message string with a newline
791 * character, a newline character will be added automatically.
794 * GST_CAT_FIXME_OBJECT:
795 * @cat: category to use
796 * @obj: the #GObject the message belongs to
797 * @...: printf-style message to output
799 * Output a fixme message belonging to the given object in the given category.
801 * There is no need to finish the end of the message string with a newline
802 * character, a newline character will be added automatically.
805 * GST_CAT_TRACE_OBJECT:
806 * @cat: category to use
807 * @obj: the #GObject the message belongs to
808 * @...: printf-style message to output
810 * Output a tracing message belonging to the given object in the given
813 * There is no need to finish the end of the message string with a newline
814 * character, a newline character will be added automatically.
817 * GST_CAT_MEMDUMP_OBJECT:
818 * @cat: category to use
819 * @obj: the #GObject the message belongs to
820 * @msg: message string to log with the data
821 * @data: pointer to the data to output
822 * @length: length of the data to output
824 * Output a hexdump of @data relating to the given object in the given
827 * There is no need to finish the end of the message string with a newline
828 * character, a newline character will be added automatically.
834 * @cat: category to use
835 * @...: printf-style message to output
837 * Output an error message in the given category.
839 * There is no need to finish the end of the message string with a newline
840 * character, a newline character will be added automatically.
844 * @cat: category to use
845 * @...: printf-style message to output
847 * Output an warning message in the given category.
849 * There is no need to finish the end of the message string with a newline
850 * character, a newline character will be added automatically.
854 * @cat: category to use
855 * @...: printf-style message to output
857 * Output an informational message in the given category.
859 * There is no need to finish the end of the message string with a newline
860 * character, a newline character will be added automatically.
864 * @cat: category to use
865 * @...: printf-style message to output
867 * Output an debugging message in the given category.
869 * There is no need to finish the end of the message string with a newline
870 * character, a newline character will be added automatically.
874 * @cat: category to use
875 * @...: printf-style message to output
877 * Output an logging message in the given category.
879 * There is no need to finish the end of the message string with a newline
880 * character, a newline character will be added automatically.
884 * @cat: category to use
885 * @...: printf-style message to output
887 * Output an fixme message in the given category.
889 * There is no need to finish the end of the message string with a newline
890 * character, a newline character will be added automatically.
894 * @cat: category to use
895 * @...: printf-style message to output
897 * Output a tracing message in the given category.
899 * There is no need to finish the end of the message string with a newline
900 * character, a newline character will be added automatically.
904 * @cat: category to use
905 * @msg: message string to log with the data
906 * @data: pointer to the data to output
907 * @length: length of the data to output
909 * Output a hexdump of @data in the given category.
911 * There is no need to finish the end of the message string with a newline
912 * character, a newline character will be added automatically.
918 * @obj: the #GObject the message belongs to
919 * @...: printf-style message to output
921 * Output an error message belonging to the given object in the default category.
923 * There is no need to finish the end of the message string with a newline
924 * character, a newline character will be added automatically.
927 * GST_WARNING_OBJECT:
928 * @obj: the #GObject the message belongs to
929 * @...: printf-style message to output
931 * Output a warning message belonging to the given object in the default category.
933 * There is no need to finish the end of the message string with a newline
934 * character, a newline character will be added automatically.
938 * @obj: the #GObject the message belongs to
939 * @...: printf-style message to output
941 * Output an informational message belonging to the given object in the default
944 * There is no need to finish the end of the message string with a newline
945 * character, a newline character will be added automatically.
949 * @obj: the #GObject the message belongs to
950 * @...: printf-style message to output
952 * Output a debugging message belonging to the given object in the default
955 * There is no need to finish the end of the message string with a newline
956 * character, a newline character will be added automatically.
960 * @obj: the #GObject the message belongs to
961 * @...: printf-style message to output
963 * Output a logging message belonging to the given object in the default category.
965 * There is no need to finish the end of the message string with a newline
966 * character, a newline character will be added automatically.
970 * @obj: the #GObject the message belongs to
971 * @...: printf-style message to output
973 * Output a fixme message belonging to the given object in the default category.
975 * There is no need to finish the end of the message string with a newline
976 * character, a newline character will be added automatically.
980 * @obj: the #GObject the message belongs to
981 * @...: printf-style message to output
983 * Output a tracing message belonging to the given object in the default category.
985 * There is no need to finish the end of the message string with a newline
986 * character, a newline character will be added automatically.
989 * GST_MEMDUMP_OBJECT:
990 * @obj: the #GObject the message belongs to
991 * @msg: message string to log with the data
992 * @data: pointer to the data to output
993 * @length: length of the data to output
995 * Output a logging message belonging to the given object in the default category.
997 * There is no need to finish the end of the message string with a newline
998 * character, a newline character will be added automatically.
1004 * @...: printf-style message to output
1006 * Output an error message in the default category.
1008 * There is no need to finish the end of the message string with a newline
1009 * character, a newline character will be added automatically.
1013 * @...: printf-style message to output
1015 * Output a warning message in the default category.
1017 * There is no need to finish the end of the message string with a newline
1018 * character, a newline character will be added automatically.
1022 * @...: printf-style message to output
1024 * Output an informational message in the default category.
1026 * There is no need to finish the end of the message string with a newline
1027 * character, a newline character will be added automatically.
1031 * @...: printf-style message to output
1033 * Output a debugging message in the default category.
1035 * There is no need to finish the end of the message string with a newline
1036 * character, a newline character will be added automatically.
1040 * @...: printf-style message to output
1042 * Output a logging message in the default category.
1044 * There is no need to finish the end of the message string with a newline
1045 * character, a newline character will be added automatically.
1049 * @...: printf-style message to output
1051 * Output a fixme message in the default category.
1053 * There is no need to finish the end of the message string with a newline
1054 * character, a newline character will be added automatically.
1058 * @...: printf-style message to output
1060 * Output a tracing message in the default category.
1062 * There is no need to finish the end of the message string with a newline
1063 * character, a newline character will be added automatically.
1067 * @msg: message string to log with the data
1068 * @data: pointer to the data to output
1069 * @length: length of the data to output
1071 * Output a hexdump of @data.
1073 * There is no need to finish the end of the message string with a newline
1074 * character, a newline character will be added automatically.
1077 #ifdef G_HAVE_ISO_VARARGS
1079 #define GST_CAT_ERROR_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, obj, __VA_ARGS__)
1080 #define GST_CAT_WARNING_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, obj, __VA_ARGS__)
1081 #define GST_CAT_INFO_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, obj, __VA_ARGS__)
1082 #define GST_CAT_DEBUG_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, obj, __VA_ARGS__)
1083 #define GST_CAT_LOG_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, obj, __VA_ARGS__)
1084 #define GST_CAT_FIXME_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME, obj, __VA_ARGS__)
1085 #define GST_CAT_TRACE_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE, obj, __VA_ARGS__)
1087 #define GST_CAT_ERROR(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, NULL, __VA_ARGS__)
1088 #define GST_CAT_WARNING(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
1089 #define GST_CAT_INFO(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, NULL, __VA_ARGS__)
1090 #define GST_CAT_DEBUG(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, NULL, __VA_ARGS__)
1091 #define GST_CAT_LOG(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, NULL, __VA_ARGS__)
1092 #define GST_CAT_FIXME(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME, NULL, __VA_ARGS__)
1093 #define GST_CAT_TRACE(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE, NULL, __VA_ARGS__)
1095 #define GST_ERROR_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, obj, __VA_ARGS__)
1096 #define GST_WARNING_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj, __VA_ARGS__)
1097 #define GST_INFO_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, obj, __VA_ARGS__)
1098 #define GST_DEBUG_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, obj, __VA_ARGS__)
1099 #define GST_LOG_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, obj, __VA_ARGS__)
1100 #define GST_FIXME_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME, obj, __VA_ARGS__)
1101 #define GST_TRACE_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE, obj, __VA_ARGS__)
1103 #define GST_ERROR(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, NULL, __VA_ARGS__)
1104 #define GST_WARNING(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
1105 #define GST_INFO(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, __VA_ARGS__)
1106 #define GST_DEBUG(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, __VA_ARGS__)
1107 #define GST_LOG(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, NULL, __VA_ARGS__)
1108 #define GST_FIXME(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME, NULL, __VA_ARGS__)
1109 #define GST_TRACE(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE, NULL, __VA_ARGS__)
1112 #ifdef G_HAVE_GNUC_VARARGS
1114 #define GST_CAT_ERROR_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, obj, ##args )
1115 #define GST_CAT_WARNING_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, obj, ##args )
1116 #define GST_CAT_INFO_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, obj, ##args )
1117 #define GST_CAT_DEBUG_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, obj, ##args )
1118 #define GST_CAT_LOG_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, obj, ##args )
1119 #define GST_CAT_FIXME_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME, obj, ##args )
1120 #define GST_CAT_TRACE_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE, obj, ##args )
1122 #define GST_CAT_ERROR(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, NULL, ##args )
1123 #define GST_CAT_WARNING(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, NULL, ##args )
1124 #define GST_CAT_INFO(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, NULL, ##args )
1125 #define GST_CAT_DEBUG(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, NULL, ##args )
1126 #define GST_CAT_LOG(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, NULL, ##args )
1127 #define GST_CAT_FIXME(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME, NULL, ##args )
1128 #define GST_CAT_TRACE(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE, NULL, ##args )
1130 #define GST_ERROR_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, obj, ##args )
1131 #define GST_WARNING_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj, ##args )
1132 #define GST_INFO_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, obj, ##args )
1133 #define GST_DEBUG_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, obj, ##args )
1134 #define GST_LOG_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, obj, ##args )
1135 #define GST_FIXME_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME, obj, ##args )
1136 #define GST_TRACE_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE, obj, ##args )
1138 #define GST_ERROR(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, NULL, ##args )
1139 #define GST_WARNING(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, ##args )
1140 #define GST_INFO(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, ##args )
1141 #define GST_DEBUG(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, ##args )
1142 #define GST_LOG(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, NULL, ##args )
1143 #define GST_FIXME(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME, NULL, ##args )
1144 #define GST_TRACE(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE, NULL, ##args )
1147 /* no variadic macros, use inline */
1149 GST_CAT_ERROR_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1154 va_start (varargs, format);
1155 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_ERROR, obj, format, varargs);
1160 GST_CAT_WARNING_OBJECT (GstDebugCategory * cat, gpointer obj,
1161 const char *format, ...)
1165 va_start (varargs, format);
1166 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_WARNING, obj, format, varargs);
1171 GST_CAT_INFO_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1176 va_start (varargs, format);
1177 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_INFO, obj, format, varargs);
1182 GST_CAT_DEBUG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1187 va_start (varargs, format);
1188 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_DEBUG, obj, format, varargs);
1193 GST_CAT_LOG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1198 va_start (varargs, format);
1199 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_LOG, obj, format, varargs);
1204 GST_CAT_FIXME_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1209 va_start (varargs, format);
1210 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_FIXME, obj, format, varargs);
1215 GST_CAT_TRACE_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1220 va_start (varargs, format);
1221 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_TRACE, obj, format, varargs);
1226 GST_CAT_ERROR (GstDebugCategory * cat, const char *format, ...)
1230 va_start (varargs, format);
1231 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_ERROR, NULL, format, varargs);
1236 GST_CAT_WARNING (GstDebugCategory * cat, const char *format, ...)
1240 va_start (varargs, format);
1241 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_WARNING, NULL, format, varargs);
1246 GST_CAT_INFO (GstDebugCategory * cat, const char *format, ...)
1250 va_start (varargs, format);
1251 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_INFO, NULL, format, varargs);
1256 GST_CAT_DEBUG (GstDebugCategory * cat, const char *format, ...)
1260 va_start (varargs, format);
1261 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_DEBUG, NULL, format, varargs);
1266 GST_CAT_LOG (GstDebugCategory * cat, const char *format, ...)
1270 va_start (varargs, format);
1271 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_LOG, NULL, format, varargs);
1276 GST_CAT_FIXME (GstDebugCategory * cat, const char *format, ...)
1280 va_start (varargs, format);
1281 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_FIXME, NULL, format, varargs);
1286 GST_CAT_TRACE (GstDebugCategory * cat, const char *format, ...)
1290 va_start (varargs, format);
1291 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_TRACE, NULL, format, varargs);
1296 GST_ERROR_OBJECT (gpointer obj, const char *format, ...)
1300 va_start (varargs, format);
1301 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_ERROR, obj, format,
1307 GST_WARNING_OBJECT (gpointer obj, const char *format, ...)
1311 va_start (varargs, format);
1312 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj, format,
1318 GST_INFO_OBJECT (gpointer obj, const char *format, ...)
1322 va_start (varargs, format);
1323 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_INFO, obj, format,
1329 GST_DEBUG_OBJECT (gpointer obj, const char *format, ...)
1333 va_start (varargs, format);
1334 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, obj, format,
1340 GST_LOG_OBJECT (gpointer obj, const char *format, ...)
1344 va_start (varargs, format);
1345 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_LOG, obj, format,
1351 GST_FIXME_OBJECT (gpointer obj, const char *format, ...)
1355 va_start (varargs, format);
1356 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_FIXME, obj, format,
1362 GST_TRACE_OBJECT (gpointer obj, const char *format, ...)
1366 va_start (varargs, format);
1367 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_TRACE, obj, format,
1373 GST_ERROR (const char *format, ...)
1377 va_start (varargs, format);
1378 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_ERROR, NULL, format,
1384 GST_WARNING (const char *format, ...)
1388 va_start (varargs, format);
1389 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, format,
1395 GST_INFO (const char *format, ...)
1399 va_start (varargs, format);
1400 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, format,
1406 GST_DEBUG (const char *format, ...)
1410 va_start (varargs, format);
1411 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, format,
1417 GST_LOG (const char *format, ...)
1421 va_start (varargs, format);
1422 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_LOG, NULL,
1428 GST_FIXME (const char *format, ...)
1432 va_start (varargs, format);
1433 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_FIXME, NULL, format,
1439 GST_TRACE (const char *format, ...)
1443 va_start (varargs, format);
1444 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_TRACE, NULL, format,
1452 /********** function pointer stuff **********/
1455 * GST_DEBUG_REGISTER_FUNCPTR:
1456 * @ptr: pointer to the function to register
1458 * Register a pointer to a function with its name, so it can later be used by
1459 * GST_DEBUG_FUNCPTR_NAME().
1461 * Use this variant of #GST_DEBUG_FUNCPTR if you do not need to use @ptr.
1463 #define GST_DEBUG_REGISTER_FUNCPTR(ptr) \
1464 _gst_debug_register_funcptr((GstDebugFuncPtr)(ptr), #ptr)
1466 * GST_DEBUG_FUNCPTR:
1467 * @ptr: pointer to the function to register
1469 * Register a pointer to a function with its name, so it can later be used by
1470 * GST_DEBUG_FUNCPTR_NAME().
1472 * Returns: the value passed to @ptr.
1474 #define GST_DEBUG_FUNCPTR(ptr) \
1475 (_gst_debug_register_funcptr((GstDebugFuncPtr)(ptr), #ptr) , ptr)
1478 * GST_DEBUG_FUNCPTR_NAME:
1479 * @ptr: address of the function of which to look up the name
1481 * Retrieves the name of the function, if it was previously registered with
1482 * GST_DEBUG_FUNCPTR(). If not, it returns a description of the pointer.
1484 * This macro returns a constant string which must not be modified or
1485 * freed by the caller.
1487 #define GST_DEBUG_FUNCPTR_NAME(ptr) \
1488 _gst_debug_nameof_funcptr((GstDebugFuncPtr)ptr)
1491 #else /* GST_DISABLE_GST_DEBUG */
1496 #if defined(__GNUC__) && __GNUC__ >= 3
1497 # pragma GCC poison gst_debug_log
1498 # pragma GCC poison gst_debug_log_valist
1499 # pragma GCC poison _gst_debug_category_new
1502 #define _gst_debug_min GST_LEVEL_NONE
1504 #define gst_debug_set_default_threshold(level) G_STMT_START{ }G_STMT_END
1505 #define gst_debug_get_default_threshold() (GST_LEVEL_NONE)
1507 #define gst_debug_level_get_name(level) ("NONE")
1508 #define gst_debug_message_get(message) ("")
1509 #define gst_debug_add_log_function(func,data,notify) G_STMT_START{ }G_STMT_END
1510 #define gst_debug_set_active(active) G_STMT_START{ }G_STMT_END
1511 #define gst_debug_is_active() (FALSE)
1512 #define gst_debug_set_colored(colored) G_STMT_START{ }G_STMT_END
1513 #define gst_debug_set_color_mode(mode) G_STMT_START{ }G_STMT_END
1514 #define gst_debug_set_color_mode_from_string(mode) G_STMT_START{ }G_STMT_END
1515 #define gst_debug_is_colored() (FALSE)
1516 #define gst_debug_get_color_mode() (GST_DEBUG_COLOR_MODE_OFF)
1517 #define gst_debug_set_default_threshold(level) G_STMT_START{ }G_STMT_END
1518 #define gst_debug_get_default_threshold() (GST_LEVEL_NONE)
1519 #define gst_debug_set_threshold_for_name(name,level) G_STMT_START{ }G_STMT_END
1520 #define gst_debug_unset_threshold_for_name(name) G_STMT_START{ }G_STMT_END
1522 /* we are using dummy function prototypes here to eat ';' as these macros are
1523 * used outside of functions */
1524 #define GST_DEBUG_CATEGORY(var) void _gst_debug_dummy_##var (void)
1525 #define GST_DEBUG_CATEGORY_EXTERN(var) void _gst_debug_dummy_extern_##var (void)
1526 #define GST_DEBUG_CATEGORY_STATIC(var) void _gst_debug_dummy_static_##var (void)
1528 #define GST_DEBUG_CATEGORY_INIT(var,name,color,desc) G_STMT_START{ }G_STMT_END
1529 #define GST_DEBUG_CATEGORY_GET(var,name) G_STMT_START{ }G_STMT_END
1530 #ifndef GST_DISABLE_DEPRECATED
1531 #define gst_debug_category_free(category) G_STMT_START{ }G_STMT_END
1533 #define gst_debug_category_set_threshold(category,level) G_STMT_START{ }G_STMT_END
1534 #define gst_debug_category_reset_threshold(category) G_STMT_START{ }G_STMT_END
1535 #define gst_debug_category_get_threshold(category) (GST_LEVEL_NONE)
1536 #define gst_debug_category_get_name(cat) ("")
1537 #define gst_debug_category_get_color(cat) (0)
1538 #define gst_debug_category_get_description(cat) ("")
1539 #define gst_debug_get_all_categories() (NULL)
1540 #define gst_debug_construct_term_color(colorinfo) (g_strdup ("00"))
1541 #define gst_debug_construct_win_color(colorinfo) (0)
1543 #endif /* !GST_INFO_C */
1545 #ifdef G_HAVE_ISO_VARARGS
1547 #define GST_CAT_LEVEL_LOG(cat,level,...) G_STMT_START{ }G_STMT_END
1549 #define GST_CAT_ERROR_OBJECT(...) G_STMT_START{ }G_STMT_END
1550 #define GST_CAT_WARNING_OBJECT(...) G_STMT_START{ }G_STMT_END
1551 #define GST_CAT_INFO_OBJECT(...) G_STMT_START{ }G_STMT_END
1552 #define GST_CAT_DEBUG_OBJECT(...) G_STMT_START{ }G_STMT_END
1553 #define GST_CAT_LOG_OBJECT(...) G_STMT_START{ }G_STMT_END
1554 #define GST_CAT_FIXME_OBJECT(...) G_STMT_START{ }G_STMT_END
1555 #define GST_CAT_TRACE_OBJECT(...) G_STMT_START{ }G_STMT_END
1557 #define GST_CAT_ERROR(...) G_STMT_START{ }G_STMT_END
1558 #define GST_CAT_WARNING(...) G_STMT_START{ }G_STMT_END
1559 #define GST_CAT_INFO(...) G_STMT_START{ }G_STMT_END
1560 #define GST_CAT_DEBUG(...) G_STMT_START{ }G_STMT_END
1561 #define GST_CAT_LOG(...) G_STMT_START{ }G_STMT_END
1562 #define GST_CAT_FIXME(...) G_STMT_START{ }G_STMT_END
1563 #define GST_CAT_TRACE(...) G_STMT_START{ }G_STMT_END
1565 #define GST_ERROR_OBJECT(...) G_STMT_START{ }G_STMT_END
1566 #define GST_WARNING_OBJECT(...) G_STMT_START{ }G_STMT_END
1567 #define GST_INFO_OBJECT(...) G_STMT_START{ }G_STMT_END
1568 #define GST_DEBUG_OBJECT(...) G_STMT_START{ }G_STMT_END
1569 #define GST_LOG_OBJECT(...) G_STMT_START{ }G_STMT_END
1570 #define GST_FIXME_OBJECT(...) G_STMT_START{ }G_STMT_END
1571 #define GST_TRACE_OBJECT(...) G_STMT_START{ }G_STMT_END
1573 #define GST_ERROR(...) G_STMT_START{ }G_STMT_END
1574 #define GST_WARNING(...) G_STMT_START{ }G_STMT_END
1575 #define GST_INFO(...) G_STMT_START{ }G_STMT_END
1576 #define GST_DEBUG(...) G_STMT_START{ }G_STMT_END
1577 #define GST_LOG(...) G_STMT_START{ }G_STMT_END
1578 #define GST_FIXME(...) G_STMT_START{ }G_STMT_END
1579 #define GST_TRACE(...) G_STMT_START{ }G_STMT_END
1581 #else /* !G_HAVE_ISO_VARARGS */
1582 #ifdef G_HAVE_GNUC_VARARGS
1584 #define GST_CAT_LEVEL_LOG(cat,level,args...) G_STMT_START{ }G_STMT_END
1586 #define GST_CAT_ERROR_OBJECT(args...) G_STMT_START{ }G_STMT_END
1587 #define GST_CAT_WARNING_OBJECT(args...) G_STMT_START{ }G_STMT_END
1588 #define GST_CAT_INFO_OBJECT(args...) G_STMT_START{ }G_STMT_END
1589 #define GST_CAT_DEBUG_OBJECT(args...) G_STMT_START{ }G_STMT_END
1590 #define GST_CAT_LOG_OBJECT(args...) G_STMT_START{ }G_STMT_END
1591 #define GST_CAT_FIXME_OBJECT(args...) G_STMT_START{ }G_STMT_END
1592 #define GST_CAT_TRACE_OBJECT(args...) G_STMT_START{ }G_STMT_END
1594 #define GST_CAT_ERROR(args...) G_STMT_START{ }G_STMT_END
1595 #define GST_CAT_WARNING(args...) G_STMT_START{ }G_STMT_END
1596 #define GST_CAT_INFO(args...) G_STMT_START{ }G_STMT_END
1597 #define GST_CAT_DEBUG(args...) G_STMT_START{ }G_STMT_END
1598 #define GST_CAT_LOG(args...) G_STMT_START{ }G_STMT_END
1599 #define GST_CAT_FIXME(args...) G_STMT_START{ }G_STMT_END
1600 #define GST_CAT_TRACE(args...) G_STMT_START{ }G_STMT_END
1602 #define GST_ERROR_OBJECT(args...) G_STMT_START{ }G_STMT_END
1603 #define GST_WARNING_OBJECT(args...) G_STMT_START{ }G_STMT_END
1604 #define GST_INFO_OBJECT(args...) G_STMT_START{ }G_STMT_END
1605 #define GST_DEBUG_OBJECT(args...) G_STMT_START{ }G_STMT_END
1606 #define GST_LOG_OBJECT(args...) G_STMT_START{ }G_STMT_END
1607 #define GST_FIXME_OBJECT(args...) G_STMT_START{ }G_STMT_END
1608 #define GST_TRACE_OBJECT(args...) G_STMT_START{ }G_STMT_END
1610 #define GST_ERROR(args...) G_STMT_START{ }G_STMT_END
1611 #define GST_WARNING(args...) G_STMT_START{ }G_STMT_END
1612 #define GST_INFO(args...) G_STMT_START{ }G_STMT_END
1613 #define GST_DEBUG(args...) G_STMT_START{ }G_STMT_END
1614 #define GST_LOG(args...) G_STMT_START{ }G_STMT_END
1615 #define GST_FIXME(args...) G_STMT_START{ }G_STMT_END
1616 #define GST_TRACE(args...) G_STMT_START{ }G_STMT_END
1618 #else /* !G_HAVE_GNUC_VARARGS */
1620 GST_CAT_LEVEL_LOG_valist (GstDebugCategory * cat,
1621 GstDebugLevel level, gpointer object, const char *format, va_list varargs)
1626 GST_CAT_ERROR_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1632 GST_CAT_WARNING_OBJECT (GstDebugCategory * cat, gpointer obj,
1633 const char *format, ...)
1638 GST_CAT_INFO_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1644 GST_CAT_DEBUG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1650 GST_CAT_LOG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1656 GST_CAT_FIXME_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1662 GST_CAT_TRACE_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1668 GST_CAT_ERROR (GstDebugCategory * cat, const char *format, ...)
1673 GST_CAT_WARNING (GstDebugCategory * cat, const char *format, ...)
1678 GST_CAT_INFO (GstDebugCategory * cat, const char *format, ...)
1683 GST_CAT_DEBUG (GstDebugCategory * cat, const char *format, ...)
1688 GST_CAT_LOG (GstDebugCategory * cat, const char *format, ...)
1693 GST_CAT_FIXME (GstDebugCategory * cat, const char *format, ...)
1698 GST_CAT_TRACE (GstDebugCategory * cat, const char *format, ...)
1703 GST_ERROR_OBJECT (gpointer obj, const char *format, ...)
1708 GST_WARNING_OBJECT (gpointer obj, const char *format, ...)
1713 GST_INFO_OBJECT (gpointer obj, const char *format, ...)
1718 GST_DEBUG_OBJECT (gpointer obj, const char *format, ...)
1723 GST_LOG_OBJECT (gpointer obj, const char *format, ...)
1728 GST_FIXME_OBJECT (gpointer obj, const char *format, ...)
1733 GST_TRACE_OBJECT (gpointer obj, const char *format, ...)
1738 GST_ERROR (const char *format, ...)
1743 GST_WARNING (const char *format, ...)
1748 GST_INFO (const char *format, ...)
1753 GST_DEBUG (const char *format, ...)
1758 GST_LOG (const char *format, ...)
1763 GST_FIXME (const char *format, ...)
1768 GST_TRACE (const char *format, ...)
1772 #endif /* G_HAVE_GNUC_VARARGS */
1773 #endif /* G_HAVE_ISO_VARARGS */
1775 #define GST_DEBUG_REGISTER_FUNCPTR(ptr) G_STMT_START{ }G_STMT_END
1776 #define GST_DEBUG_FUNCPTR(ptr) (ptr)
1777 #define GST_DEBUG_FUNCPTR_NAME(ptr) (g_strdup_printf ("%p", ptr))
1779 #define GST_CAT_MEMDUMP_OBJECT(cat,obj,msg,data,length) G_STMT_START{ }G_STMT_END
1780 #define GST_CAT_MEMDUMP(cat,msg,data,length) G_STMT_START{ }G_STMT_END
1781 #define GST_MEMDUMP_OBJECT(obj,msg,data,length) G_STMT_START{ }G_STMT_END
1782 #define GST_MEMDUMP(msg,data,length) G_STMT_START{ }G_STMT_END
1784 #endif /* GST_DISABLE_GST_DEBUG */
1788 void gst_debug_print_stack_trace (void);
1791 gchar * gst_debug_get_stack_trace (GstStackTraceFlags flags);
1794 void gst_debug_add_ring_buffer_logger (guint max_size_per_thread, guint thread_timeout);
1796 void gst_debug_remove_ring_buffer_logger (void);
1798 gchar ** gst_debug_ring_buffer_logger_get_logs (void);
1802 #endif /* __GSTINFO_H__ */