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