1 /* GStreamer
2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3 * 2000 Wim Taymans <wtay@chello.be>
4 * 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
5 *
6 * gstinfo.h: debugging functions
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22 */
23
24 #ifndef __GSTINFO_H__
25 #define __GSTINFO_H__
26
27 #include <glib.h>
28 #include <glib-object.h>
29 #include <gst/gstconfig.h>
30
31 G_BEGIN_DECLS
32
33 /**
34 * GstDebugLevel:
35 * @GST_LEVEL_NONE: No debugging level specified or desired. Used to deactivate
36 * debugging output.
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
60 * of events.
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
70 * ASCII characters.
71 * @GST_LEVEL_COUNT: The number of defined debugging levels.
72 *
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.
75 */
76 typedef enum {
77 GST_LEVEL_NONE = 0,
78 GST_LEVEL_ERROR = 1,
79 GST_LEVEL_WARNING = 2,
80 GST_LEVEL_FIXME = 3,
81 GST_LEVEL_INFO = 4,
82 GST_LEVEL_DEBUG = 5,
83 GST_LEVEL_LOG = 6,
84 GST_LEVEL_TRACE = 7,
85 /* add more */
86 GST_LEVEL_MEMDUMP = 9,
87 /* add more */
88 GST_LEVEL_COUNT
89 } GstDebugLevel;
90
91 /**
92 * GST_LEVEL_DEFAULT:
93 *
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.
100 */
101 #ifndef GST_LEVEL_DEFAULT
102 #define GST_LEVEL_DEFAULT GST_LEVEL_NONE
103 #endif
104
105 /**
106 * GST_LEVEL_MAX:
107 *
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.
110 *
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.
114 *
115 * Since: 1.6
116 */
117 #ifndef GST_LEVEL_MAX
118 #define GST_LEVEL_MAX GST_LEVEL_COUNT
119 #endif
120
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
125 * Text color codes:
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
129 */
130 /**
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.
150 *
151 * These are some terminal style flags you can use when creating your
152 * debugging categories to make them stand out in debugging output.
153 */
154 typedef enum { /*< flags >*/
155 /* colors */
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,
173 /* other formats */
174 GST_DEBUG_BOLD = 0x0100,
175 GST_DEBUG_UNDERLINE = 0x0200
176 } GstDebugColorFlags;
177
178 /**
179 * GstStackTraceFlags:
180 * @GST_STACK_TRACE_SHOW_NONE: Try to retrieve the minimum information
181 * available, which may be none on some platforms
182 * (Since: 1.18)
183 * @GST_STACK_TRACE_SHOW_FULL: Try to retrieve as much information as possible,
184 * including source information when getting the
185 * stack trace
186 *
187 * Since: 1.12
188 */
189 typedef enum {
190 GST_STACK_TRACE_SHOW_NONE = 0,
191 GST_STACK_TRACE_SHOW_FULL = 1 << 0
192 } GstStackTraceFlags;
193
194 /**
195 * GstDebugColorMode:
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.
200 */
201 typedef enum {
202 GST_DEBUG_COLOR_MODE_OFF = 0,
203 GST_DEBUG_COLOR_MODE_ON = 1,
204 GST_DEBUG_COLOR_MODE_UNIX = 2
205 } GstDebugColorMode;
206
207
208 #define GST_DEBUG_FG_MASK (0x000F)
209 #define GST_DEBUG_BG_MASK (0x00F0)
210 #define GST_DEBUG_FORMAT_MASK (0xFF00)
211
212 typedef struct _GstDebugCategory GstDebugCategory;
213 /**
214 * GstDebugCategory:
215 *
216 * This is the struct that describes the categories. Once initialized with
217 * #GST_DEBUG_CATEGORY_INIT, its values can't be changed anymore.
218 */
219 struct _GstDebugCategory {
220 /*< private >*/
221 gint threshold;
222 guint color; /* see defines above */
223
224 const gchar * name;
225 const gchar * description;
226 };
227
228 /********** some convenience macros for debugging **********/
229
230 /**
231 * GST_STR_NULL:
232 * @str: (allow-none): The string to check.
233 *
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
238 * strings.
239 */
240 #define GST_STR_NULL(str) ((str) ? (str) : "(NULL)")
241
242 /* FIXME, not MT safe */
243 /**
244 * GST_DEBUG_PAD_NAME:
245 * @pad: The pad to debug.
246 *
247 * Evaluates to 2 strings, that describe the pad. Often used in debugging
248 * statements.
249 */
250 #define GST_DEBUG_PAD_NAME(pad) \
251 (pad != NULL) ? \
252 ((GST_OBJECT_PARENT(pad) != NULL) ? \
253 GST_STR_NULL (GST_OBJECT_NAME (GST_OBJECT_PARENT(pad))) : \
254 "''" ) : "''", \
255 (pad != NULL) ? GST_STR_NULL (GST_OBJECT_NAME (pad)) : "''"
256
257 /**
258 * GST_FUNCTION:
259 *
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.
264 *
265 * Note that this is different from G_STRFUNC as we do not want the full
266 * function signature in C++ code.
267 */
268 #ifndef GST_FUNCTION
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__))
273 #else
274 # define GST_FUNCTION ((const char*) ("???"))
275 #endif
276 #endif /* ifndef GST_FUNCTION */
277
278 /**
279 * GST_PTR_FORMAT: (skip):
280 *
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.
289 *
290 * This can only be used on types whose size is >= sizeof(gpointer).
291 */
292 #define GST_PTR_FORMAT "p\aA"
293
294 /**
295 * GST_SEGMENT_FORMAT: (skip):
296 *
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.
302 */
303 #define GST_SEGMENT_FORMAT "p\aB"
304
305 /**
306 * GST_TIMEP_FORMAT: (skip):
307 *
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.
313 *
314 * Since: 1.18
315 */
316 #define GST_TIMEP_FORMAT "p\aT"
317
318 /**
319 * GST_STIMEP_FORMAT: (skip):
320 *
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).
326 *
327 * Since: 1.18
328 */
329 #define GST_STIMEP_FORMAT "p\aS"
330
331 typedef struct _GstDebugMessage GstDebugMessage;
332
333 /**
334 * GstLogFunction:
335 * @category: a #GstDebugCategory
336 * @level: a #GstDebugLevel
337 * @file: file name
338 * @function: function name
339 * @line: line number
340 * @object: a #GObject
341 * @message: the message
342 * @user_data: user data for the log function
343 *
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.
347 */
348 typedef void (*GstLogFunction) (GstDebugCategory * category,
349 GstDebugLevel level,
350 const gchar * file,
351 const gchar * function,
352 gint line,
353 GObject * object,
354 GstDebugMessage * message,
355 gpointer user_data);
356
357 GST_API
358 void gst_debug_log (GstDebugCategory * category,
359 GstDebugLevel level,
360 const gchar * file,
361 const gchar * function,
362 gint line,
363 GObject * object,
364 const gchar * format,
365 ...) G_GNUC_PRINTF (7, 8) G_GNUC_NO_INSTRUMENT;
366 GST_API
367 void gst_debug_log_valist (GstDebugCategory * category,
368 GstDebugLevel level,
369 const gchar * file,
370 const gchar * function,
371 gint line,
372 GObject * object,
373 const gchar * format,
374 va_list args) G_GNUC_NO_INSTRUMENT;
375
376 GST_API
377 void gst_debug_log_literal (GstDebugCategory * category,
378 GstDebugLevel level,
379 const gchar * file,
380 const gchar * function,
381 gint line,
382 GObject * object,
383 const gchar * message_string) G_GNUC_NO_INSTRUMENT;
384
385 /* do not use this function, use the GST_DEBUG_CATEGORY_INIT macro */
386
387 GST_API
388 GstDebugCategory *_gst_debug_category_new (const gchar * name,
389 guint color,
390 const gchar * description);
391
392 /* do not use this function, use the GST_DEBUG_CATEGORY_GET macro */
393
394 GST_API
395 GstDebugCategory *_gst_debug_get_category (const gchar *name);
396
397
398 /* do not use this function, use the GST_CAT_MEMDUMP_* macros */
399
400 GST_API
401 void _gst_debug_dump_mem (GstDebugCategory * cat, const gchar * file,
402 const gchar * func, gint line, GObject * obj, const gchar * msg,
403 const guint8 * data, guint length);
404
405 /**
406 * GstDebugFuncPtr: (attributes doc.skip=true)
407 * we define this to avoid a compiler warning regarding a cast from a function
408 * pointer to a void pointer
409 * (see https://bugzilla.gnome.org/show_bug.cgi?id=309253)
410 */
411 typedef void (* GstDebugFuncPtr) (void);
412
413 /* do no use these functions, use the GST_DEBUG*_FUNCPTR macros */
414
415 GST_API
416 void _gst_debug_register_funcptr (GstDebugFuncPtr func,
417 const gchar * ptrname);
418 GST_API
419 const gchar *
420 _gst_debug_nameof_funcptr (GstDebugFuncPtr func) G_GNUC_NO_INSTRUMENT;
421
422
423 GST_API
424 const gchar * gst_debug_message_get (GstDebugMessage * message);
425
426 GST_API
427 gchar * gst_debug_log_get_line (GstDebugCategory * category,
428 GstDebugLevel level,
429 const gchar * file,
430 const gchar * function,
431 gint line,
432 GObject * object,
433 GstDebugMessage * message) G_GNUC_NO_INSTRUMENT;
434
435 GST_API
436 void gst_debug_log_default (GstDebugCategory * category,
437 GstDebugLevel level,
438 const gchar * file,
439 const gchar * function,
440 gint line,
441 GObject * object,
442 GstDebugMessage * message,
443 gpointer user_data) G_GNUC_NO_INSTRUMENT;
444
445 GST_API
446 const gchar * gst_debug_level_get_name (GstDebugLevel level);
447
448 GST_API
449 void gst_debug_add_log_function (GstLogFunction func,
450 gpointer user_data,
451 GDestroyNotify notify);
452 GST_API
453 guint gst_debug_remove_log_function (GstLogFunction func);
454
455 GST_API
456 guint gst_debug_remove_log_function_by_data (gpointer data);
457
458 GST_API
459 void gst_debug_set_active (gboolean active);
460
461 GST_API
462 gboolean gst_debug_is_active (void);
463
464 GST_API
465 void gst_debug_set_colored (gboolean colored);
466
467 GST_API
468 void gst_debug_set_color_mode (GstDebugColorMode mode);
469
470 GST_API
471 void gst_debug_set_color_mode_from_string (const gchar * mode);
472
473 GST_API
474 gboolean gst_debug_is_colored (void);
475
476 GST_API
477 GstDebugColorMode gst_debug_get_color_mode (void);
478
479 GST_API
480 void gst_debug_set_default_threshold (GstDebugLevel level);
481
482 GST_API
483 GstDebugLevel gst_debug_get_default_threshold (void);
484
485 GST_API
486 void gst_debug_set_threshold_for_name (const gchar * name,
487 GstDebugLevel level);
488 GST_API
489 void gst_debug_set_threshold_from_string (const gchar * list, gboolean reset);
490
491 GST_API
492 void gst_debug_unset_threshold_for_name (const gchar * name);
493
494 GST_DEPRECATED
495 void gst_debug_category_free (GstDebugCategory * category);
496
497 GST_API
498 void gst_debug_category_set_threshold (GstDebugCategory * category,
499 GstDebugLevel level);
500
501 GST_API
502 void gst_debug_category_reset_threshold (GstDebugCategory * category);
503
504 GST_API
505 GstDebugLevel gst_debug_category_get_threshold (GstDebugCategory * category);
506
507 GST_API
508 const gchar * gst_debug_category_get_name (GstDebugCategory * category);
509
510 GST_API
511 guint gst_debug_category_get_color (GstDebugCategory * category);
512
513 GST_API
514 const gchar * gst_debug_category_get_description (GstDebugCategory * category);
515
516 GST_API
517 GSList * gst_debug_get_all_categories (void);
518
519
520 GST_API
521 gchar * gst_debug_construct_term_color (guint colorinfo);
522
523 GST_API
524 gint gst_debug_construct_win_color (guint colorinfo);
525
526 GST_API
527 gint gst_info_vasprintf (gchar ** result,
528 const gchar * format,
529 va_list args) G_GNUC_PRINTF (2, 0);
530 GST_API
531 gchar * gst_info_strdup_vprintf (const gchar *format, va_list args) G_GNUC_PRINTF (1, 0);
532
533 GST_API
534 gchar * gst_info_strdup_printf (const gchar *format, ...) G_GNUC_PRINTF (1, 2);
535
536 GST_API
537 void gst_print (const gchar * format, ...) G_GNUC_PRINTF (1, 2);
538
539 GST_API
540 void gst_println (const gchar * format, ...) G_GNUC_PRINTF (1, 2);
541
542 GST_API
543 void gst_printerr (const gchar * format, ...) G_GNUC_PRINTF (1, 2);
544
545 GST_API
546 void gst_printerrln (const gchar * format, ...) G_GNUC_PRINTF (1, 2);
547
548 #ifndef GST_DISABLE_GST_DEBUG
549
550 /* cast to void * avoids a warning with gcc 6
551 * see https://bugzilla.gnome.org/show_bug.cgi?id=764526 */
552 #define gst_debug_add_log_function(func,data,notify) \
553 G_STMT_START{ \
554 if ((func) == (void *) gst_debug_log_default) { \
555 gst_debug_add_log_function(NULL,data,notify); \
556 } else { \
557 gst_debug_add_log_function(func,data,notify); \
558 } \
559 }G_STMT_END
560
561 #define gst_debug_remove_log_function(func) \
562 ((func) == (void *) gst_debug_log_default) ? \
563 gst_debug_remove_log_function(NULL) : \
564 gst_debug_remove_log_function(func)
565
566 /**
567 * GST_DEBUG_CATEGORY:
568 * @cat: the category
569 *
570 * Defines a GstDebugCategory variable.
571 * This macro expands to nothing if debugging is disabled.
572 */
573 #define GST_DEBUG_CATEGORY(cat) GstDebugCategory *cat = NULL
574 /**
575 * GST_DEBUG_CATEGORY_EXTERN:
576 * @cat: the category
577 *
578 * Declares a GstDebugCategory variable as extern. Use in header files.
579 * This macro expands to nothing if debugging is disabled.
580 */
581 #define GST_DEBUG_CATEGORY_EXTERN(cat) extern GstDebugCategory *cat
582
583 /**
584 * GST_DEBUG_CATEGORY_STATIC:
585 * @cat: the category
586 *
587 * Defines a static GstDebugCategory variable.
588 * This macro expands to nothing if debugging is disabled.
589 */
590 #define GST_DEBUG_CATEGORY_STATIC(cat) static GstDebugCategory *cat = NULL
591
592 /**
593 * GST_DEBUG_CATEGORY_INIT:
594 * @cat: the category to initialize.
595 * @name: the name of the category.
596 * @color: the colors to use for a color representation or 0 for no color.
597 * @description: optional description of the category.
598 *
599 * Initializes a new #GstDebugCategory with the given properties and set to
600 * the default threshold.
601 *
602 * > This macro expands to nothing if debugging is disabled.
603 * >
604 * > When naming your category, please follow the following conventions to ensure
605 * > that the pattern matching for categories works as expected. It is not
606 * > earth-shattering if you don't follow these conventions, but it would be nice
607 * > for everyone.
608 * >
609 * > If you define a category for a plugin or a feature of it, name the category
610 * > like the feature. So if you wanted to write a "filesrc" element, you would
611 * > name the category "filesrc". Use lowercase letters only.
612 * > If you define more than one category for the same element, append an
613 * > underscore and an identifier to your categories, like this: "filesrc_cache"
614 * >
615 * > If you create a library or an application using debugging categories, use a
616 * > common prefix followed by an underscore for all your categories. GStreamer
617 * > uses the GST prefix so GStreamer categories look like "GST_STATES". Be sure
618 * > to include uppercase letters.
619 *
620 */
621 #define GST_DEBUG_CATEGORY_INIT(cat,name,color,description) G_STMT_START{\
622 if (cat == NULL) \
623 cat = _gst_debug_category_new (name,color,description); \
624 }G_STMT_END
625
626 /**
627 * GST_DEBUG_CATEGORY_GET:
628 * @cat: the category to initialize.
629 * @name: log category name
630 *
631 * Looks up an existing #GstDebugCategory by its @name and sets @cat. If the
632 * category is not found, but GST_CAT_DEFAULT is defined, that is assigned to
633 * @cat. Otherwise @cat will be %NULL.
634 *
635 * |[<!-- language="C" -->
636 * GST_DEBUG_CATEGORY_STATIC (gst_myplugin_debug);
637 * #define GST_CAT_DEFAULT gst_myplugin_debug
638 * GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE);
639 * ...
640 * GST_DEBUG_CATEGORY_INIT (gst_myplugin_debug, "myplugin", 0, "nice element");
641 * GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "GST_PERFORMANCE");
642 * ]|
643 */
644 #ifdef GST_CAT_DEFAULT
645 #define GST_DEBUG_CATEGORY_GET(cat,name) G_STMT_START{\
646 cat = _gst_debug_get_category (name); \
647 if (!cat) { \
648 cat = GST_CAT_DEFAULT; \
649 } \
650 }G_STMT_END
651 #else
652 #define GST_DEBUG_CATEGORY_GET(cat,name) G_STMT_START{\
653 cat = _gst_debug_get_category (name); \
654 }G_STMT_END
655 #endif
656
657 /**
658 * GST_CAT_DEFAULT:
659 *
660 * Default gstreamer core debug log category. Please define your own.
661 */
662
663 GST_API GstDebugCategory * GST_CAT_DEFAULT;
664 /* this symbol may not be used */
665
666 GST_API gboolean _gst_debug_enabled;
667
668 /* the min debug level, used for quickly discarding debug
669 * messages that fall under the threshold. */
670
671 GST_API GstDebugLevel _gst_debug_min;
672
673 /**
674 * GST_CAT_LEVEL_LOG:
675 * @cat: category to use
676 * @level: the severity of the message
677 * @object: (allow-none): the #GObject the message belongs to or %NULL if none
678 * @...: A printf-style message to output
679 *
680 * Outputs a debugging message. This is the most general macro for outputting
681 * debugging messages. You will probably want to use one of the ones described
682 * below.
683 *
684 * There is no need to finish the end of the debug message with a newline
685 * character, a newline character will be added automatically.
686 */
687 #ifdef G_HAVE_ISO_VARARGS
688 #define GST_CAT_LEVEL_LOG(cat,level,object,...) G_STMT_START{ \
689 if (G_UNLIKELY ((level) <= GST_LEVEL_MAX && (level) <= _gst_debug_min)) { \
690 gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, \
691 (GObject *) (object), __VA_ARGS__); \
692 } \
693 }G_STMT_END
694 #else /* G_HAVE_GNUC_VARARGS */
695 #ifdef G_HAVE_GNUC_VARARGS
696 #define GST_CAT_LEVEL_LOG(cat,level,object,args...) G_STMT_START{ \
697 if (G_UNLIKELY ((level) <= GST_LEVEL_MAX && (level) <= _gst_debug_min)) { \
698 gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, \
699 (GObject *) (object), ##args ); \
700 } \
701 }G_STMT_END
702 #else /* no variadic macros, use inline */
703 static inline void
GST_CAT_LEVEL_LOG_valist(GstDebugCategory * cat,GstDebugLevel level,gpointer object,const char * format,va_list varargs)704 GST_CAT_LEVEL_LOG_valist (GstDebugCategory * cat,
705 GstDebugLevel level, gpointer object, const char *format, va_list varargs)
706 {
707 if (G_UNLIKELY ((level) <= GST_LEVEL_MAX && (level) <= _gst_debug_min)) {
708 gst_debug_log_valist (cat, level, "", "", 0, (GObject *) object, format,
709 varargs);
710 }
711 }
712
713 static inline void
GST_CAT_LEVEL_LOG(GstDebugCategory * cat,GstDebugLevel level,gpointer object,const char * format,...)714 GST_CAT_LEVEL_LOG (GstDebugCategory * cat, GstDebugLevel level,
715 gpointer object, const char *format, ...)
716 {
717 va_list varargs;
718
719 va_start (varargs, format);
720 GST_CAT_LEVEL_LOG_valist (cat, level, object, format, varargs);
721 va_end (varargs);
722 }
723 #endif
724 #endif /* G_HAVE_ISO_VARARGS */
725
726 /* This one doesn't have varargs in the macro, so it's different than all the
727 * other macros and hence in a separate block right here. Docs chunks are
728 * with the other doc chunks below though. */
729 #define __GST_CAT_MEMDUMP_LOG(cat,object,msg,data,length) G_STMT_START{ \
730 if (G_UNLIKELY (GST_LEVEL_MEMDUMP <= GST_LEVEL_MAX && \
731 GST_LEVEL_MEMDUMP <= _gst_debug_min)) { \
732 _gst_debug_dump_mem ((cat), __FILE__, GST_FUNCTION, __LINE__, \
733 (GObject *) (object), (msg), (data), (length)); \
734 } \
735 }G_STMT_END
736
737 #define GST_CAT_MEMDUMP_OBJECT(cat,obj,msg,data,length) \
738 __GST_CAT_MEMDUMP_LOG(cat,obj,msg,data,length)
739 #define GST_CAT_MEMDUMP(cat,msg,data,length) \
740 __GST_CAT_MEMDUMP_LOG(cat,NULL,msg,data,length)
741 #define GST_MEMDUMP_OBJECT(obj,msg,data,length) \
742 __GST_CAT_MEMDUMP_LOG(GST_CAT_DEFAULT,obj,msg,data,length)
743 #define GST_MEMDUMP(msg,data,length) \
744 __GST_CAT_MEMDUMP_LOG(GST_CAT_DEFAULT,NULL,msg,data,length)
745
746 /**
747 * GST_CAT_ERROR_OBJECT:
748 * @cat: category to use
749 * @obj: the #GObject the message belongs to
750 * @...: printf-style message to output
751 *
752 * Output an error message belonging to the given object in the given category.
753 *
754 * There is no need to finish the end of the message string with a newline
755 * character, a newline character will be added automatically.
756 */
757 /**
758 * GST_CAT_WARNING_OBJECT:
759 * @cat: category to use
760 * @obj: the #GObject the message belongs to
761 * @...: printf-style message to output
762 *
763 * Output a warning message belonging to the given object in the given category.
764 *
765 * There is no need to finish the end of the message string with a newline
766 * character, a newline character will be added automatically.
767 */
768 /**
769 * GST_CAT_INFO_OBJECT:
770 * @cat: category to use
771 * @obj: the #GObject the message belongs to
772 * @...: printf-style message to output
773 *
774 * Output an informational message belonging to the given object in the given
775 * category.
776 *
777 * There is no need to finish the end of the message string with a newline
778 * character, a newline character will be added automatically.
779 */
780 /**
781 * GST_CAT_DEBUG_OBJECT:
782 * @cat: category to use
783 * @obj: the #GObject the message belongs to
784 * @...: printf-style message to output
785 *
786 * Output an debugging message belonging to the given object in the given category.
787 *
788 * There is no need to finish the end of the message string with a newline
789 * character, a newline character will be added automatically.
790 */
791 /**
792 * GST_CAT_LOG_OBJECT:
793 * @cat: category to use
794 * @obj: the #GObject the message belongs to
795 * @...: printf-style message to output
796 *
797 * Output an logging message belonging to the given object in the given category.
798 *
799 * There is no need to finish the end of the message string with a newline
800 * character, a newline character will be added automatically.
801 */
802 /**
803 * GST_CAT_FIXME_OBJECT:
804 * @cat: category to use
805 * @obj: the #GObject the message belongs to
806 * @...: printf-style message to output
807 *
808 * Output a fixme message belonging to the given object in the given category.
809 *
810 * There is no need to finish the end of the message string with a newline
811 * character, a newline character will be added automatically.
812 */
813 /**
814 * GST_CAT_TRACE_OBJECT:
815 * @cat: category to use
816 * @obj: the #GObject the message belongs to
817 * @...: printf-style message to output
818 *
819 * Output a tracing message belonging to the given object in the given
820 * category.
821 *
822 * There is no need to finish the end of the message string with a newline
823 * character, a newline character will be added automatically.
824 */
825 /**
826 * GST_CAT_MEMDUMP_OBJECT:
827 * @cat: category to use
828 * @obj: the #GObject the message belongs to
829 * @msg: message string to log with the data
830 * @data: pointer to the data to output
831 * @length: length of the data to output
832 *
833 * Output a hexdump of @data relating to the given object in the given
834 * category.
835 *
836 * There is no need to finish the end of the message string with a newline
837 * character, a newline character will be added automatically.
838 */
839
840
841 /**
842 * GST_CAT_ERROR:
843 * @cat: category to use
844 * @...: printf-style message to output
845 *
846 * Output an error message in the given category.
847 *
848 * There is no need to finish the end of the message string with a newline
849 * character, a newline character will be added automatically.
850 */
851 /**
852 * GST_CAT_WARNING:
853 * @cat: category to use
854 * @...: printf-style message to output
855 *
856 * Output an warning message in the given category.
857 *
858 * There is no need to finish the end of the message string with a newline
859 * character, a newline character will be added automatically.
860 */
861 /**
862 * GST_CAT_INFO:
863 * @cat: category to use
864 * @...: printf-style message to output
865 *
866 * Output an informational message in the given category.
867 *
868 * There is no need to finish the end of the message string with a newline
869 * character, a newline character will be added automatically.
870 */
871 /**
872 * GST_CAT_DEBUG:
873 * @cat: category to use
874 * @...: printf-style message to output
875 *
876 * Output an debugging message in the given category.
877 *
878 * There is no need to finish the end of the message string with a newline
879 * character, a newline character will be added automatically.
880 */
881 /**
882 * GST_CAT_LOG:
883 * @cat: category to use
884 * @...: printf-style message to output
885 *
886 * Output an logging message in the given category.
887 *
888 * There is no need to finish the end of the message string with a newline
889 * character, a newline character will be added automatically.
890 */
891 /**
892 * GST_CAT_FIXME:
893 * @cat: category to use
894 * @...: printf-style message to output
895 *
896 * Output an fixme message in the given category.
897 *
898 * There is no need to finish the end of the message string with a newline
899 * character, a newline character will be added automatically.
900 */
901 /**
902 * GST_CAT_TRACE:
903 * @cat: category to use
904 * @...: printf-style message to output
905 *
906 * Output a tracing message in the given category.
907 *
908 * There is no need to finish the end of the message string with a newline
909 * character, a newline character will be added automatically.
910 */
911 /**
912 * GST_CAT_MEMDUMP:
913 * @cat: category to use
914 * @msg: message string to log with the data
915 * @data: pointer to the data to output
916 * @length: length of the data to output
917 *
918 * Output a hexdump of @data in the given category.
919 *
920 * There is no need to finish the end of the message string with a newline
921 * character, a newline character will be added automatically.
922 */
923
924
925 /**
926 * GST_ERROR_OBJECT:
927 * @obj: the #GObject the message belongs to
928 * @...: printf-style message to output
929 *
930 * Output an error message belonging to the given object in the default category.
931 *
932 * There is no need to finish the end of the message string with a newline
933 * character, a newline character will be added automatically.
934 */
935 /**
936 * GST_WARNING_OBJECT:
937 * @obj: the #GObject the message belongs to
938 * @...: printf-style message to output
939 *
940 * Output a warning message belonging to the given object in the default category.
941 *
942 * There is no need to finish the end of the message string with a newline
943 * character, a newline character will be added automatically.
944 */
945 /**
946 * GST_INFO_OBJECT:
947 * @obj: the #GObject the message belongs to
948 * @...: printf-style message to output
949 *
950 * Output an informational message belonging to the given object in the default
951 * category.
952 *
953 * There is no need to finish the end of the message string with a newline
954 * character, a newline character will be added automatically.
955 */
956 /**
957 * GST_DEBUG_OBJECT:
958 * @obj: the #GObject the message belongs to
959 * @...: printf-style message to output
960 *
961 * Output a debugging message belonging to the given object in the default
962 * category.
963 *
964 * There is no need to finish the end of the message string with a newline
965 * character, a newline character will be added automatically.
966 */
967 /**
968 * GST_LOG_OBJECT:
969 * @obj: the #GObject the message belongs to
970 * @...: printf-style message to output
971 *
972 * Output a logging message belonging to the given object in the default category.
973 *
974 * There is no need to finish the end of the message string with a newline
975 * character, a newline character will be added automatically.
976 */
977 /**
978 * GST_FIXME_OBJECT:
979 * @obj: the #GObject the message belongs to
980 * @...: printf-style message to output
981 *
982 * Output a fixme message belonging to the given object in the default category.
983 *
984 * There is no need to finish the end of the message string with a newline
985 * character, a newline character will be added automatically.
986 */
987 /**
988 * GST_TRACE_OBJECT:
989 * @obj: the #GObject the message belongs to
990 * @...: printf-style message to output
991 *
992 * Output a tracing message belonging to the given object in the default category.
993 *
994 * There is no need to finish the end of the message string with a newline
995 * character, a newline character will be added automatically.
996 */
997 /**
998 * GST_MEMDUMP_OBJECT:
999 * @obj: the #GObject the message belongs to
1000 * @msg: message string to log with the data
1001 * @data: pointer to the data to output
1002 * @length: length of the data to output
1003 *
1004 * Output a logging message belonging to the given object in the default category.
1005 *
1006 * There is no need to finish the end of the message string with a newline
1007 * character, a newline character will be added automatically.
1008 */
1009
1010
1011 /**
1012 * GST_ERROR:
1013 * @...: printf-style message to output
1014 *
1015 * Output an error message in the default category.
1016 *
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.
1019 */
1020 /**
1021 * GST_WARNING:
1022 * @...: printf-style message to output
1023 *
1024 * Output a warning message in the default category.
1025 *
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.
1028 */
1029 /**
1030 * GST_INFO:
1031 * @...: printf-style message to output
1032 *
1033 * Output an informational message in the default category.
1034 *
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.
1037 */
1038 /**
1039 * GST_DEBUG:
1040 * @...: printf-style message to output
1041 *
1042 * Output a debugging message in the default category.
1043 *
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.
1046 */
1047 /**
1048 * GST_LOG:
1049 * @...: printf-style message to output
1050 *
1051 * Output a logging message in the default category.
1052 *
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.
1055 */
1056 /**
1057 * GST_FIXME:
1058 * @...: printf-style message to output
1059 *
1060 * Output a fixme message in the default category.
1061 *
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.
1064 */
1065 /**
1066 * GST_TRACE:
1067 * @...: printf-style message to output
1068 *
1069 * Output a tracing message in the default category.
1070 *
1071 * There is no need to finish the end of the message string with a newline
1072 * character, a newline character will be added automatically.
1073 */
1074 /**
1075 * GST_MEMDUMP:
1076 * @msg: message string to log with the data
1077 * @data: pointer to the data to output
1078 * @length: length of the data to output
1079 *
1080 * Output a hexdump of @data.
1081 *
1082 * There is no need to finish the end of the message string with a newline
1083 * character, a newline character will be added automatically.
1084 */
1085
1086 #ifdef G_HAVE_ISO_VARARGS
1087
1088 #define GST_CAT_ERROR_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, obj, __VA_ARGS__)
1089 #define GST_CAT_WARNING_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, obj, __VA_ARGS__)
1090 #define GST_CAT_INFO_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, obj, __VA_ARGS__)
1091 #define GST_CAT_DEBUG_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, obj, __VA_ARGS__)
1092 #define GST_CAT_LOG_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, obj, __VA_ARGS__)
1093 #define GST_CAT_FIXME_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME, obj, __VA_ARGS__)
1094 #define GST_CAT_TRACE_OBJECT(cat,obj,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE, obj, __VA_ARGS__)
1095
1096 #define GST_CAT_ERROR(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, NULL, __VA_ARGS__)
1097 #define GST_CAT_WARNING(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
1098 #define GST_CAT_INFO(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, NULL, __VA_ARGS__)
1099 #define GST_CAT_DEBUG(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, NULL, __VA_ARGS__)
1100 #define GST_CAT_LOG(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, NULL, __VA_ARGS__)
1101 #define GST_CAT_FIXME(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME, NULL, __VA_ARGS__)
1102 #define GST_CAT_TRACE(cat,...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE, NULL, __VA_ARGS__)
1103
1104 #define GST_ERROR_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, obj, __VA_ARGS__)
1105 #define GST_WARNING_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj, __VA_ARGS__)
1106 #define GST_INFO_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, obj, __VA_ARGS__)
1107 #define GST_DEBUG_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, obj, __VA_ARGS__)
1108 #define GST_LOG_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, obj, __VA_ARGS__)
1109 #define GST_FIXME_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME, obj, __VA_ARGS__)
1110 #define GST_TRACE_OBJECT(obj,...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE, obj, __VA_ARGS__)
1111
1112 #define GST_ERROR(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, NULL, __VA_ARGS__)
1113 #define GST_WARNING(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
1114 #define GST_INFO(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, __VA_ARGS__)
1115 #define GST_DEBUG(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, __VA_ARGS__)
1116 #define GST_LOG(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, NULL, __VA_ARGS__)
1117 #define GST_FIXME(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME, NULL, __VA_ARGS__)
1118 #define GST_TRACE(...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE, NULL, __VA_ARGS__)
1119
1120 #else
1121 #ifdef G_HAVE_GNUC_VARARGS
1122
1123 #define GST_CAT_ERROR_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, obj, ##args )
1124 #define GST_CAT_WARNING_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, obj, ##args )
1125 #define GST_CAT_INFO_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, obj, ##args )
1126 #define GST_CAT_DEBUG_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, obj, ##args )
1127 #define GST_CAT_LOG_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, obj, ##args )
1128 #define GST_CAT_FIXME_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME, obj, ##args )
1129 #define GST_CAT_TRACE_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE, obj, ##args )
1130
1131 #define GST_CAT_ERROR(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR, NULL, ##args )
1132 #define GST_CAT_WARNING(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, NULL, ##args )
1133 #define GST_CAT_INFO(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO, NULL, ##args )
1134 #define GST_CAT_DEBUG(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG, NULL, ##args )
1135 #define GST_CAT_LOG(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG, NULL, ##args )
1136 #define GST_CAT_FIXME(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME, NULL, ##args )
1137 #define GST_CAT_TRACE(cat,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE, NULL, ##args )
1138
1139 #define GST_ERROR_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, obj, ##args )
1140 #define GST_WARNING_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj, ##args )
1141 #define GST_INFO_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, obj, ##args )
1142 #define GST_DEBUG_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, obj, ##args )
1143 #define GST_LOG_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, obj, ##args )
1144 #define GST_FIXME_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME, obj, ##args )
1145 #define GST_TRACE_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE, obj, ##args )
1146
1147 #define GST_ERROR(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, NULL, ##args )
1148 #define GST_WARNING(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, ##args )
1149 #define GST_INFO(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, ##args )
1150 #define GST_DEBUG(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, ##args )
1151 #define GST_LOG(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, NULL, ##args )
1152 #define GST_FIXME(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME, NULL, ##args )
1153 #define GST_TRACE(args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE, NULL, ##args )
1154
1155 #else
1156 /* no variadic macros, use inline */
1157 static inline void
GST_CAT_ERROR_OBJECT(GstDebugCategory * cat,gpointer obj,const char * format,...)1158 GST_CAT_ERROR_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1159 ...)
1160 {
1161 va_list varargs;
1162
1163 va_start (varargs, format);
1164 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_ERROR, obj, format, varargs);
1165 va_end (varargs);
1166 }
1167
1168 static inline void
GST_CAT_WARNING_OBJECT(GstDebugCategory * cat,gpointer obj,const char * format,...)1169 GST_CAT_WARNING_OBJECT (GstDebugCategory * cat, gpointer obj,
1170 const char *format, ...)
1171 {
1172 va_list varargs;
1173
1174 va_start (varargs, format);
1175 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_WARNING, obj, format, varargs);
1176 va_end (varargs);
1177 }
1178
1179 static inline void
GST_CAT_INFO_OBJECT(GstDebugCategory * cat,gpointer obj,const char * format,...)1180 GST_CAT_INFO_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1181 ...)
1182 {
1183 va_list varargs;
1184
1185 va_start (varargs, format);
1186 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_INFO, obj, format, varargs);
1187 va_end (varargs);
1188 }
1189
1190 static inline void
GST_CAT_DEBUG_OBJECT(GstDebugCategory * cat,gpointer obj,const char * format,...)1191 GST_CAT_DEBUG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1192 ...)
1193 {
1194 va_list varargs;
1195
1196 va_start (varargs, format);
1197 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_DEBUG, obj, format, varargs);
1198 va_end (varargs);
1199 }
1200
1201 static inline void
GST_CAT_LOG_OBJECT(GstDebugCategory * cat,gpointer obj,const char * format,...)1202 GST_CAT_LOG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1203 ...)
1204 {
1205 va_list varargs;
1206
1207 va_start (varargs, format);
1208 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_LOG, obj, format, varargs);
1209 va_end (varargs);
1210 }
1211
1212 static inline void
GST_CAT_FIXME_OBJECT(GstDebugCategory * cat,gpointer obj,const char * format,...)1213 GST_CAT_FIXME_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1214 ...)
1215 {
1216 va_list varargs;
1217
1218 va_start (varargs, format);
1219 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_FIXME, obj, format, varargs);
1220 va_end (varargs);
1221 }
1222
1223 static inline void
GST_CAT_TRACE_OBJECT(GstDebugCategory * cat,gpointer obj,const char * format,...)1224 GST_CAT_TRACE_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1225 ...)
1226 {
1227 va_list varargs;
1228
1229 va_start (varargs, format);
1230 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_TRACE, obj, format, varargs);
1231 va_end (varargs);
1232 }
1233
1234 static inline void
GST_CAT_ERROR(GstDebugCategory * cat,const char * format,...)1235 GST_CAT_ERROR (GstDebugCategory * cat, const char *format, ...)
1236 {
1237 va_list varargs;
1238
1239 va_start (varargs, format);
1240 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_ERROR, NULL, format, varargs);
1241 va_end (varargs);
1242 }
1243
1244 static inline void
GST_CAT_WARNING(GstDebugCategory * cat,const char * format,...)1245 GST_CAT_WARNING (GstDebugCategory * cat, const char *format, ...)
1246 {
1247 va_list varargs;
1248
1249 va_start (varargs, format);
1250 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_WARNING, NULL, format, varargs);
1251 va_end (varargs);
1252 }
1253
1254 static inline void
GST_CAT_INFO(GstDebugCategory * cat,const char * format,...)1255 GST_CAT_INFO (GstDebugCategory * cat, const char *format, ...)
1256 {
1257 va_list varargs;
1258
1259 va_start (varargs, format);
1260 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_INFO, NULL, format, varargs);
1261 va_end (varargs);
1262 }
1263
1264 static inline void
GST_CAT_DEBUG(GstDebugCategory * cat,const char * format,...)1265 GST_CAT_DEBUG (GstDebugCategory * cat, const char *format, ...)
1266 {
1267 va_list varargs;
1268
1269 va_start (varargs, format);
1270 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_DEBUG, NULL, format, varargs);
1271 va_end (varargs);
1272 }
1273
1274 static inline void
GST_CAT_LOG(GstDebugCategory * cat,const char * format,...)1275 GST_CAT_LOG (GstDebugCategory * cat, const char *format, ...)
1276 {
1277 va_list varargs;
1278
1279 va_start (varargs, format);
1280 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_LOG, NULL, format, varargs);
1281 va_end (varargs);
1282 }
1283
1284 static inline void
GST_CAT_FIXME(GstDebugCategory * cat,const char * format,...)1285 GST_CAT_FIXME (GstDebugCategory * cat, const char *format, ...)
1286 {
1287 va_list varargs;
1288
1289 va_start (varargs, format);
1290 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_FIXME, NULL, format, varargs);
1291 va_end (varargs);
1292 }
1293
1294 static inline void
GST_CAT_TRACE(GstDebugCategory * cat,const char * format,...)1295 GST_CAT_TRACE (GstDebugCategory * cat, const char *format, ...)
1296 {
1297 va_list varargs;
1298
1299 va_start (varargs, format);
1300 GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_TRACE, NULL, format, varargs);
1301 va_end (varargs);
1302 }
1303
1304 static inline void
GST_ERROR_OBJECT(gpointer obj,const char * format,...)1305 GST_ERROR_OBJECT (gpointer obj, const char *format, ...)
1306 {
1307 va_list varargs;
1308
1309 va_start (varargs, format);
1310 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_ERROR, obj, format,
1311 varargs);
1312 va_end (varargs);
1313 }
1314
1315 static inline void
GST_WARNING_OBJECT(gpointer obj,const char * format,...)1316 GST_WARNING_OBJECT (gpointer obj, const char *format, ...)
1317 {
1318 va_list varargs;
1319
1320 va_start (varargs, format);
1321 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj, format,
1322 varargs);
1323 va_end (varargs);
1324 }
1325
1326 static inline void
GST_INFO_OBJECT(gpointer obj,const char * format,...)1327 GST_INFO_OBJECT (gpointer obj, const char *format, ...)
1328 {
1329 va_list varargs;
1330
1331 va_start (varargs, format);
1332 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_INFO, obj, format,
1333 varargs);
1334 va_end (varargs);
1335 }
1336
1337 static inline void
GST_DEBUG_OBJECT(gpointer obj,const char * format,...)1338 GST_DEBUG_OBJECT (gpointer obj, const char *format, ...)
1339 {
1340 va_list varargs;
1341
1342 va_start (varargs, format);
1343 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, obj, format,
1344 varargs);
1345 va_end (varargs);
1346 }
1347
1348 static inline void
GST_LOG_OBJECT(gpointer obj,const char * format,...)1349 GST_LOG_OBJECT (gpointer obj, const char *format, ...)
1350 {
1351 va_list varargs;
1352
1353 va_start (varargs, format);
1354 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_LOG, obj, format,
1355 varargs);
1356 va_end (varargs);
1357 }
1358
1359 static inline void
GST_FIXME_OBJECT(gpointer obj,const char * format,...)1360 GST_FIXME_OBJECT (gpointer obj, const char *format, ...)
1361 {
1362 va_list varargs;
1363
1364 va_start (varargs, format);
1365 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_FIXME, obj, format,
1366 varargs);
1367 va_end (varargs);
1368 }
1369
1370 static inline void
GST_TRACE_OBJECT(gpointer obj,const char * format,...)1371 GST_TRACE_OBJECT (gpointer obj, const char *format, ...)
1372 {
1373 va_list varargs;
1374
1375 va_start (varargs, format);
1376 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_TRACE, obj, format,
1377 varargs);
1378 va_end (varargs);
1379 }
1380
1381 static inline void
GST_ERROR(const char * format,...)1382 GST_ERROR (const char *format, ...)
1383 {
1384 va_list varargs;
1385
1386 va_start (varargs, format);
1387 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_ERROR, NULL, format,
1388 varargs);
1389 va_end (varargs);
1390 }
1391
1392 static inline void
GST_WARNING(const char * format,...)1393 GST_WARNING (const char *format, ...)
1394 {
1395 va_list varargs;
1396
1397 va_start (varargs, format);
1398 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, format,
1399 varargs);
1400 va_end (varargs);
1401 }
1402
1403 static inline void
GST_INFO(const char * format,...)1404 GST_INFO (const char *format, ...)
1405 {
1406 va_list varargs;
1407
1408 va_start (varargs, format);
1409 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, format,
1410 varargs);
1411 va_end (varargs);
1412 }
1413
1414 static inline void
GST_DEBUG(const char * format,...)1415 GST_DEBUG (const char *format, ...)
1416 {
1417 va_list varargs;
1418
1419 va_start (varargs, format);
1420 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, format,
1421 varargs);
1422 va_end (varargs);
1423 }
1424
1425 static inline void
GST_LOG(const char * format,...)1426 GST_LOG (const char *format, ...)
1427 {
1428 va_list varargs;
1429
1430 va_start (varargs, format);
1431 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_LOG, NULL,
1432 format, varargs);
1433 va_end (varargs);
1434 }
1435
1436 static inline void
GST_FIXME(const char * format,...)1437 GST_FIXME (const char *format, ...)
1438 {
1439 va_list varargs;
1440
1441 va_start (varargs, format);
1442 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_FIXME, NULL, format,
1443 varargs);
1444 va_end (varargs);
1445 }
1446
1447 static inline void
GST_TRACE(const char * format,...)1448 GST_TRACE (const char *format, ...)
1449 {
1450 va_list varargs;
1451
1452 va_start (varargs, format);
1453 GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_TRACE, NULL, format,
1454 varargs);
1455 va_end (varargs);
1456 }
1457 #endif
1458 #endif
1459
1460
1461 /********** function pointer stuff **********/
1462
1463 /**
1464 * GST_DEBUG_REGISTER_FUNCPTR:
1465 * @ptr: pointer to the function to register
1466 *
1467 * Register a pointer to a function with its name, so it can later be used by
1468 * GST_DEBUG_FUNCPTR_NAME().
1469 *
1470 * Use this variant of #GST_DEBUG_FUNCPTR if you do not need to use @ptr.
1471 */
1472 #define GST_DEBUG_REGISTER_FUNCPTR(ptr) \
1473 _gst_debug_register_funcptr((GstDebugFuncPtr)(ptr), #ptr)
1474 /**
1475 * GST_DEBUG_FUNCPTR:
1476 * @ptr: pointer to the function to register
1477 *
1478 * Register a pointer to a function with its name, so it can later be used by
1479 * GST_DEBUG_FUNCPTR_NAME().
1480 *
1481 * Returns: the value passed to @ptr.
1482 */
1483 #define GST_DEBUG_FUNCPTR(ptr) \
1484 (_gst_debug_register_funcptr((GstDebugFuncPtr)(ptr), #ptr) , ptr)
1485
1486 /**
1487 * GST_DEBUG_FUNCPTR_NAME:
1488 * @ptr: address of the function of which to look up the name
1489 *
1490 * Retrieves the name of the function, if it was previously registered with
1491 * GST_DEBUG_FUNCPTR(). If not, it returns a description of the pointer.
1492 *
1493 * This macro returns a constant string which must not be modified or
1494 * freed by the caller.
1495 */
1496 #define GST_DEBUG_FUNCPTR_NAME(ptr) \
1497 _gst_debug_nameof_funcptr((GstDebugFuncPtr)ptr)
1498
1499
1500 #else /* GST_DISABLE_GST_DEBUG */
1501
1502
1503 #ifndef GST_INFO_C
1504
1505 #if defined(__GNUC__) && __GNUC__ >= 3
1506 # pragma GCC poison gst_debug_log
1507 # pragma GCC poison gst_debug_log_valist
1508 # pragma GCC poison gst_debug_log_literal
1509 # pragma GCC poison _gst_debug_category_new
1510 #endif
1511
1512 #define _gst_debug_min GST_LEVEL_NONE
1513
1514 #define gst_debug_set_default_threshold(level) G_STMT_START{ }G_STMT_END
1515 #define gst_debug_get_default_threshold() (GST_LEVEL_NONE)
1516
1517 #define gst_debug_level_get_name(level) ("NONE")
1518 #define gst_debug_message_get(message) ("")
1519 #define gst_debug_add_log_function(func,data,notify) G_STMT_START{ }G_STMT_END
1520 #define gst_debug_set_active(active) G_STMT_START{ }G_STMT_END
1521 #define gst_debug_is_active() (FALSE)
1522 #define gst_debug_set_colored(colored) G_STMT_START{ }G_STMT_END
1523 #define gst_debug_set_color_mode(mode) G_STMT_START{ }G_STMT_END
1524 #define gst_debug_set_color_mode_from_string(mode) G_STMT_START{ }G_STMT_END
1525 #define gst_debug_is_colored() (FALSE)
1526 #define gst_debug_get_color_mode() (GST_DEBUG_COLOR_MODE_OFF)
1527 #define gst_debug_set_default_threshold(level) G_STMT_START{ }G_STMT_END
1528 #define gst_debug_get_default_threshold() (GST_LEVEL_NONE)
1529 #define gst_debug_set_threshold_for_name(name,level) G_STMT_START{ }G_STMT_END
1530 #define gst_debug_unset_threshold_for_name(name) G_STMT_START{ }G_STMT_END
1531
1532 /* we are using dummy function prototypes here to eat ';' as these macros are
1533 * used outside of functions */
1534 #define GST_DEBUG_CATEGORY(var) void _gst_debug_dummy_##var (void)
1535 #define GST_DEBUG_CATEGORY_EXTERN(var) void _gst_debug_dummy_extern_##var (void)
1536 #define GST_DEBUG_CATEGORY_STATIC(var) void _gst_debug_dummy_static_##var (void)
1537
1538 #define GST_DEBUG_CATEGORY_INIT(var,name,color,desc) G_STMT_START{ }G_STMT_END
1539 #define GST_DEBUG_CATEGORY_GET(var,name) G_STMT_START{ }G_STMT_END
1540 #ifndef GST_DISABLE_DEPRECATED
1541 #define gst_debug_category_free(category) G_STMT_START{ }G_STMT_END
1542 #endif
1543 #define gst_debug_category_set_threshold(category,level) G_STMT_START{ }G_STMT_END
1544 #define gst_debug_category_reset_threshold(category) G_STMT_START{ }G_STMT_END
1545 #define gst_debug_category_get_threshold(category) (GST_LEVEL_NONE)
1546 #define gst_debug_category_get_name(cat) ("")
1547 #define gst_debug_category_get_color(cat) (0)
1548 #define gst_debug_category_get_description(cat) ("")
1549 #define gst_debug_get_all_categories() (NULL)
1550 #define gst_debug_construct_term_color(colorinfo) (g_strdup ("00"))
1551 #define gst_debug_construct_win_color(colorinfo) (0)
1552
1553 #endif /* !GST_INFO_C */
1554
1555 #ifdef G_HAVE_ISO_VARARGS
1556
1557 #define GST_CAT_LEVEL_LOG(cat,level,...) G_STMT_START{ }G_STMT_END
1558
1559 #define GST_CAT_ERROR_OBJECT(...) G_STMT_START{ }G_STMT_END
1560 #define GST_CAT_WARNING_OBJECT(...) G_STMT_START{ }G_STMT_END
1561 #define GST_CAT_INFO_OBJECT(...) G_STMT_START{ }G_STMT_END
1562 #define GST_CAT_DEBUG_OBJECT(...) G_STMT_START{ }G_STMT_END
1563 #define GST_CAT_LOG_OBJECT(...) G_STMT_START{ }G_STMT_END
1564 #define GST_CAT_FIXME_OBJECT(...) G_STMT_START{ }G_STMT_END
1565 #define GST_CAT_TRACE_OBJECT(...) G_STMT_START{ }G_STMT_END
1566
1567 #define GST_CAT_ERROR(...) G_STMT_START{ }G_STMT_END
1568 #define GST_CAT_WARNING(...) G_STMT_START{ }G_STMT_END
1569 #define GST_CAT_INFO(...) G_STMT_START{ }G_STMT_END
1570 #define GST_CAT_DEBUG(...) G_STMT_START{ }G_STMT_END
1571 #define GST_CAT_LOG(...) G_STMT_START{ }G_STMT_END
1572 #define GST_CAT_FIXME(...) G_STMT_START{ }G_STMT_END
1573 #define GST_CAT_TRACE(...) G_STMT_START{ }G_STMT_END
1574
1575 #define GST_ERROR_OBJECT(...) G_STMT_START{ }G_STMT_END
1576 #define GST_WARNING_OBJECT(...) G_STMT_START{ }G_STMT_END
1577 #define GST_INFO_OBJECT(...) G_STMT_START{ }G_STMT_END
1578 #define GST_DEBUG_OBJECT(...) G_STMT_START{ }G_STMT_END
1579 #define GST_LOG_OBJECT(...) G_STMT_START{ }G_STMT_END
1580 #define GST_FIXME_OBJECT(...) G_STMT_START{ }G_STMT_END
1581 #define GST_TRACE_OBJECT(...) G_STMT_START{ }G_STMT_END
1582
1583 #define GST_ERROR(...) G_STMT_START{ }G_STMT_END
1584 #define GST_WARNING(...) G_STMT_START{ }G_STMT_END
1585 #define GST_INFO(...) G_STMT_START{ }G_STMT_END
1586 #define GST_DEBUG(...) G_STMT_START{ }G_STMT_END
1587 #define GST_LOG(...) G_STMT_START{ }G_STMT_END
1588 #define GST_FIXME(...) G_STMT_START{ }G_STMT_END
1589 #define GST_TRACE(...) G_STMT_START{ }G_STMT_END
1590
1591 #else /* !G_HAVE_ISO_VARARGS */
1592 #ifdef G_HAVE_GNUC_VARARGS
1593
1594 #define GST_CAT_LEVEL_LOG(cat,level,args...) G_STMT_START{ }G_STMT_END
1595
1596 #define GST_CAT_ERROR_OBJECT(args...) G_STMT_START{ }G_STMT_END
1597 #define GST_CAT_WARNING_OBJECT(args...) G_STMT_START{ }G_STMT_END
1598 #define GST_CAT_INFO_OBJECT(args...) G_STMT_START{ }G_STMT_END
1599 #define GST_CAT_DEBUG_OBJECT(args...) G_STMT_START{ }G_STMT_END
1600 #define GST_CAT_LOG_OBJECT(args...) G_STMT_START{ }G_STMT_END
1601 #define GST_CAT_FIXME_OBJECT(args...) G_STMT_START{ }G_STMT_END
1602 #define GST_CAT_TRACE_OBJECT(args...) G_STMT_START{ }G_STMT_END
1603
1604 #define GST_CAT_ERROR(args...) G_STMT_START{ }G_STMT_END
1605 #define GST_CAT_WARNING(args...) G_STMT_START{ }G_STMT_END
1606 #define GST_CAT_INFO(args...) G_STMT_START{ }G_STMT_END
1607 #define GST_CAT_DEBUG(args...) G_STMT_START{ }G_STMT_END
1608 #define GST_CAT_LOG(args...) G_STMT_START{ }G_STMT_END
1609 #define GST_CAT_FIXME(args...) G_STMT_START{ }G_STMT_END
1610 #define GST_CAT_TRACE(args...) G_STMT_START{ }G_STMT_END
1611
1612 #define GST_ERROR_OBJECT(args...) G_STMT_START{ }G_STMT_END
1613 #define GST_WARNING_OBJECT(args...) G_STMT_START{ }G_STMT_END
1614 #define GST_INFO_OBJECT(args...) G_STMT_START{ }G_STMT_END
1615 #define GST_DEBUG_OBJECT(args...) G_STMT_START{ }G_STMT_END
1616 #define GST_LOG_OBJECT(args...) G_STMT_START{ }G_STMT_END
1617 #define GST_FIXME_OBJECT(args...) G_STMT_START{ }G_STMT_END
1618 #define GST_TRACE_OBJECT(args...) G_STMT_START{ }G_STMT_END
1619
1620 #define GST_ERROR(args...) G_STMT_START{ }G_STMT_END
1621 #define GST_WARNING(args...) G_STMT_START{ }G_STMT_END
1622 #define GST_INFO(args...) G_STMT_START{ }G_STMT_END
1623 #define GST_DEBUG(args...) G_STMT_START{ }G_STMT_END
1624 #define GST_LOG(args...) G_STMT_START{ }G_STMT_END
1625 #define GST_FIXME(args...) G_STMT_START{ }G_STMT_END
1626 #define GST_TRACE(args...) G_STMT_START{ }G_STMT_END
1627
1628 #else /* !G_HAVE_GNUC_VARARGS */
1629 static inline void
GST_CAT_LEVEL_LOG_valist(GstDebugCategory * cat,GstDebugLevel level,gpointer object,const char * format,va_list varargs)1630 GST_CAT_LEVEL_LOG_valist (GstDebugCategory * cat,
1631 GstDebugLevel level, gpointer object, const char *format, va_list varargs)
1632 {
1633 }
1634
1635 static inline void
GST_CAT_ERROR_OBJECT(GstDebugCategory * cat,gpointer obj,const char * format,...)1636 GST_CAT_ERROR_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1637 ...)
1638 {
1639 }
1640
1641 static inline void
GST_CAT_WARNING_OBJECT(GstDebugCategory * cat,gpointer obj,const char * format,...)1642 GST_CAT_WARNING_OBJECT (GstDebugCategory * cat, gpointer obj,
1643 const char *format, ...)
1644 {
1645 }
1646
1647 static inline void
GST_CAT_INFO_OBJECT(GstDebugCategory * cat,gpointer obj,const char * format,...)1648 GST_CAT_INFO_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1649 ...)
1650 {
1651 }
1652
1653 static inline void
GST_CAT_DEBUG_OBJECT(GstDebugCategory * cat,gpointer obj,const char * format,...)1654 GST_CAT_DEBUG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1655 ...)
1656 {
1657 }
1658
1659 static inline void
GST_CAT_LOG_OBJECT(GstDebugCategory * cat,gpointer obj,const char * format,...)1660 GST_CAT_LOG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1661 ...)
1662 {
1663 }
1664
1665 static inline void
GST_CAT_FIXME_OBJECT(GstDebugCategory * cat,gpointer obj,const char * format,...)1666 GST_CAT_FIXME_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1667 ...)
1668 {
1669 }
1670
1671 static inline void
GST_CAT_TRACE_OBJECT(GstDebugCategory * cat,gpointer obj,const char * format,...)1672 GST_CAT_TRACE_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1673 ...)
1674 {
1675 }
1676
1677 static inline void
GST_CAT_ERROR(GstDebugCategory * cat,const char * format,...)1678 GST_CAT_ERROR (GstDebugCategory * cat, const char *format, ...)
1679 {
1680 }
1681
1682 static inline void
GST_CAT_WARNING(GstDebugCategory * cat,const char * format,...)1683 GST_CAT_WARNING (GstDebugCategory * cat, const char *format, ...)
1684 {
1685 }
1686
1687 static inline void
GST_CAT_INFO(GstDebugCategory * cat,const char * format,...)1688 GST_CAT_INFO (GstDebugCategory * cat, const char *format, ...)
1689 {
1690 }
1691
1692 static inline void
GST_CAT_DEBUG(GstDebugCategory * cat,const char * format,...)1693 GST_CAT_DEBUG (GstDebugCategory * cat, const char *format, ...)
1694 {
1695 }
1696
1697 static inline void
GST_CAT_LOG(GstDebugCategory * cat,const char * format,...)1698 GST_CAT_LOG (GstDebugCategory * cat, const char *format, ...)
1699 {
1700 }
1701
1702 static inline void
GST_CAT_FIXME(GstDebugCategory * cat,const char * format,...)1703 GST_CAT_FIXME (GstDebugCategory * cat, const char *format, ...)
1704 {
1705 }
1706
1707 static inline void
GST_CAT_TRACE(GstDebugCategory * cat,const char * format,...)1708 GST_CAT_TRACE (GstDebugCategory * cat, const char *format, ...)
1709 {
1710 }
1711
1712 static inline void
GST_ERROR_OBJECT(gpointer obj,const char * format,...)1713 GST_ERROR_OBJECT (gpointer obj, const char *format, ...)
1714 {
1715 }
1716
1717 static inline void
GST_WARNING_OBJECT(gpointer obj,const char * format,...)1718 GST_WARNING_OBJECT (gpointer obj, const char *format, ...)
1719 {
1720 }
1721
1722 static inline void
GST_INFO_OBJECT(gpointer obj,const char * format,...)1723 GST_INFO_OBJECT (gpointer obj, const char *format, ...)
1724 {
1725 }
1726
1727 static inline void
GST_DEBUG_OBJECT(gpointer obj,const char * format,...)1728 GST_DEBUG_OBJECT (gpointer obj, const char *format, ...)
1729 {
1730 }
1731
1732 static inline void
GST_LOG_OBJECT(gpointer obj,const char * format,...)1733 GST_LOG_OBJECT (gpointer obj, const char *format, ...)
1734 {
1735 }
1736
1737 static inline void
GST_FIXME_OBJECT(gpointer obj,const char * format,...)1738 GST_FIXME_OBJECT (gpointer obj, const char *format, ...)
1739 {
1740 }
1741
1742 static inline void
GST_TRACE_OBJECT(gpointer obj,const char * format,...)1743 GST_TRACE_OBJECT (gpointer obj, const char *format, ...)
1744 {
1745 }
1746
1747 static inline void
GST_ERROR(const char * format,...)1748 GST_ERROR (const char *format, ...)
1749 {
1750 }
1751
1752 static inline void
GST_WARNING(const char * format,...)1753 GST_WARNING (const char *format, ...)
1754 {
1755 }
1756
1757 static inline void
GST_INFO(const char * format,...)1758 GST_INFO (const char *format, ...)
1759 {
1760 }
1761
1762 static inline void
GST_DEBUG(const char * format,...)1763 GST_DEBUG (const char *format, ...)
1764 {
1765 }
1766
1767 static inline void
GST_LOG(const char * format,...)1768 GST_LOG (const char *format, ...)
1769 {
1770 }
1771
1772 static inline void
GST_FIXME(const char * format,...)1773 GST_FIXME (const char *format, ...)
1774 {
1775 }
1776
1777 static inline void
GST_TRACE(const char * format,...)1778 GST_TRACE (const char *format, ...)
1779 {
1780 }
1781
1782 #endif /* G_HAVE_GNUC_VARARGS */
1783 #endif /* G_HAVE_ISO_VARARGS */
1784
1785 #define GST_DEBUG_REGISTER_FUNCPTR(ptr) G_STMT_START{ }G_STMT_END
1786 #define GST_DEBUG_FUNCPTR(ptr) (ptr)
1787 #define GST_DEBUG_FUNCPTR_NAME(ptr) (g_strdup_printf ("%p", ptr))
1788
1789 #define GST_CAT_MEMDUMP_OBJECT(cat,obj,msg,data,length) G_STMT_START{ }G_STMT_END
1790 #define GST_CAT_MEMDUMP(cat,msg,data,length) G_STMT_START{ }G_STMT_END
1791 #define GST_MEMDUMP_OBJECT(obj,msg,data,length) G_STMT_START{ }G_STMT_END
1792 #define GST_MEMDUMP(msg,data,length) G_STMT_START{ }G_STMT_END
1793
1794 #endif /* GST_DISABLE_GST_DEBUG */
1795
1796
1797 GST_API
1798 void gst_debug_print_stack_trace (void);
1799
1800 GST_API
1801 gchar * gst_debug_get_stack_trace (GstStackTraceFlags flags);
1802
1803 GST_API
1804 void gst_debug_add_ring_buffer_logger (guint max_size_per_thread, guint thread_timeout);
1805 GST_API
1806 void gst_debug_remove_ring_buffer_logger (void);
1807 GST_API
1808 gchar ** gst_debug_ring_buffer_logger_get_logs (void);
1809
1810 G_END_DECLS
1811
1812 #endif /* __GSTINFO_H__ */
1813