gst: mark symbols explicitly for export with GST_EXPORT
[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 GST_EXPORT
325 void                gst_debug_log            (GstDebugCategory * category,
326                                           GstDebugLevel      level,
327                                           const gchar      * file,
328                                           const gchar      * function,
329                                           gint               line,
330                                           GObject          * object,
331                                           const gchar      * format,
332                                           ...) G_GNUC_PRINTF (7, 8) G_GNUC_NO_INSTRUMENT;
333 GST_EXPORT
334 void            gst_debug_log_valist     (GstDebugCategory * category,
335                                           GstDebugLevel      level,
336                                           const gchar      * file,
337                                           const gchar      * function,
338                                           gint                line,
339                                           GObject          * object,
340                                           const gchar      * format,
341                                           va_list            args) G_GNUC_NO_INSTRUMENT;
342
343 /* do not use this function, use the GST_DEBUG_CATEGORY_INIT macro */
344
345 GST_EXPORT
346 GstDebugCategory *_gst_debug_category_new (const gchar * name,
347                                            guint         color,
348                                            const gchar * description);
349
350 /* do not use this function, use the GST_DEBUG_CATEGORY_GET macro */
351
352 GST_EXPORT
353 GstDebugCategory *_gst_debug_get_category (const gchar *name);
354
355
356 /* do not use this function, use the GST_CAT_MEMDUMP_* macros */
357
358 GST_EXPORT
359 void _gst_debug_dump_mem (GstDebugCategory * cat, const gchar * file,
360     const gchar * func, gint line, GObject * obj, const gchar * msg,
361     const guint8 * data, guint length);
362
363 /* we define this to avoid a compiler warning regarding a cast from a function
364  * pointer to a void pointer
365  * (see https://bugzilla.gnome.org/show_bug.cgi?id=309253)
366  */
367 typedef void (* GstDebugFuncPtr)        (void);
368
369 /* do no use these functions, use the GST_DEBUG*_FUNCPTR macros */
370
371 GST_EXPORT
372 void    _gst_debug_register_funcptr     (GstDebugFuncPtr        func,
373                                          const gchar *          ptrname);
374 GST_EXPORT
375 const gchar *
376         _gst_debug_nameof_funcptr       (GstDebugFuncPtr        func) G_GNUC_NO_INSTRUMENT;
377
378
379 GST_EXPORT
380 const gchar   * gst_debug_message_get    (GstDebugMessage  * message);
381
382 GST_EXPORT
383 void            gst_debug_log_default    (GstDebugCategory * category,
384                                           GstDebugLevel      level,
385                                           const gchar      * file,
386                                           const gchar      * function,
387                                           gint               line,
388                                           GObject          * object,
389                                           GstDebugMessage  * message,
390                                           gpointer           user_data) G_GNUC_NO_INSTRUMENT;
391 GST_EXPORT
392 const gchar *   gst_debug_level_get_name (GstDebugLevel level);
393
394 GST_EXPORT
395 void            gst_debug_add_log_function            (GstLogFunction func,
396                                                        gpointer       user_data,
397                                                        GDestroyNotify notify);
398 GST_EXPORT
399 guint           gst_debug_remove_log_function         (GstLogFunction func);
400
401 GST_EXPORT
402 guint           gst_debug_remove_log_function_by_data (gpointer       data);
403
404 GST_EXPORT
405 void            gst_debug_set_active  (gboolean active);
406
407 GST_EXPORT
408 gboolean        gst_debug_is_active   (void);
409
410 GST_EXPORT
411 void            gst_debug_set_colored (gboolean colored);
412
413 GST_EXPORT
414 void            gst_debug_set_color_mode   (GstDebugColorMode mode);
415
416 GST_EXPORT
417 void            gst_debug_set_color_mode_from_string (const gchar * mode);
418
419 GST_EXPORT
420 gboolean        gst_debug_is_colored  (void);
421
422 GST_EXPORT
423 GstDebugColorMode gst_debug_get_color_mode (void);
424
425 GST_EXPORT
426 void            gst_debug_set_default_threshold      (GstDebugLevel level);
427
428 GST_EXPORT
429 GstDebugLevel   gst_debug_get_default_threshold      (void);
430
431 GST_EXPORT
432 void            gst_debug_set_threshold_for_name     (const gchar * name,
433                                                       GstDebugLevel level);
434 GST_EXPORT
435 void            gst_debug_set_threshold_from_string  (const gchar * list, gboolean reset);
436
437 GST_EXPORT
438 void            gst_debug_unset_threshold_for_name   (const gchar * name);
439
440
441 GST_EXPORT
442 void            gst_debug_category_free              (GstDebugCategory *        category);
443
444 GST_EXPORT
445 void            gst_debug_category_set_threshold     (GstDebugCategory *        category,
446                                                       GstDebugLevel             level);
447
448 GST_EXPORT
449 void            gst_debug_category_reset_threshold   (GstDebugCategory *        category);
450
451 GST_EXPORT
452 GstDebugLevel   gst_debug_category_get_threshold     (GstDebugCategory *        category);
453
454 GST_EXPORT
455 const gchar *   gst_debug_category_get_name          (GstDebugCategory *        category);
456
457 GST_EXPORT
458 guint           gst_debug_category_get_color         (GstDebugCategory *        category);
459
460 GST_EXPORT
461 const gchar *   gst_debug_category_get_description   (GstDebugCategory *        category);
462
463 GST_EXPORT
464 GSList *        gst_debug_get_all_categories    (void);
465
466
467 GST_EXPORT
468 gchar * gst_debug_construct_term_color (guint colorinfo);
469
470 GST_EXPORT
471 gint    gst_debug_construct_win_color  (guint colorinfo);
472
473 GST_EXPORT
474 gint    gst_info_vasprintf              (gchar ** result,
475                                          const gchar * format,
476                                          va_list args) G_GNUC_PRINTF (2, 0);
477 GST_EXPORT
478 gchar * gst_info_strdup_vprintf         (const gchar *format, va_list args) G_GNUC_PRINTF (1, 0);
479
480 GST_EXPORT
481 gchar * gst_info_strdup_printf          (const gchar *format, ...) G_GNUC_PRINTF (1, 2);
482
483 GST_EXPORT
484 void    gst_print                       (const gchar * format, ...) G_GNUC_PRINTF (1, 2);
485
486 GST_EXPORT
487 void    gst_println                     (const gchar * format, ...) G_GNUC_PRINTF (1, 2);
488
489 GST_EXPORT
490 void    gst_printerr                    (const gchar * format, ...) G_GNUC_PRINTF (1, 2);
491
492 GST_EXPORT
493 void    gst_printerrln                  (const gchar * format, ...) G_GNUC_PRINTF (1, 2);
494
495 #ifndef GST_DISABLE_GST_DEBUG
496
497 /* cast to void * avoids a warning with gcc 6
498  * see https://bugzilla.gnome.org/show_bug.cgi?id=764526 */
499 #define gst_debug_add_log_function(func,data,notify) \
500 G_STMT_START{                                        \
501   if ((func) == (void *) gst_debug_log_default) {    \
502     gst_debug_add_log_function(NULL,data,notify);    \
503   } else {                                           \
504     gst_debug_add_log_function(func,data,notify);    \
505   }                                                  \
506 }G_STMT_END
507
508 #define gst_debug_remove_log_function(func)          \
509     ((func) == (void *) gst_debug_log_default) ?     \
510         gst_debug_remove_log_function(NULL) :        \
511         gst_debug_remove_log_function(func)
512
513 /**
514  * GST_DEBUG_CATEGORY:
515  * @cat: the category
516  *
517  * Defines a GstDebugCategory variable.
518  * This macro expands to nothing if debugging is disabled.
519  */
520 #define GST_DEBUG_CATEGORY(cat) GstDebugCategory *cat = NULL
521 /**
522  * GST_DEBUG_CATEGORY_EXTERN:
523  * @cat: the category
524  *
525  * Declares a GstDebugCategory variable as extern. Use in header files.
526  * This macro expands to nothing if debugging is disabled.
527  */
528 #define GST_DEBUG_CATEGORY_EXTERN(cat) extern GstDebugCategory *cat
529
530 /**
531  * GST_DEBUG_CATEGORY_STATIC:
532  * @cat: the category
533  *
534  * Defines a static GstDebugCategory variable.
535  * This macro expands to nothing if debugging is disabled.
536  */
537 #define GST_DEBUG_CATEGORY_STATIC(cat) static GstDebugCategory *cat = NULL
538
539 /**
540  * GST_DEBUG_CATEGORY_INIT:
541  * @cat: the category to initialize.
542  * @name: the name of the category.
543  * @color: the colors to use for a color representation or 0 for no color.
544  * @description: optional description of the category.
545  *
546  * Initializes a new #GstDebugCategory with the given properties and set to
547  * the default threshold.
548  *
549  * > This macro expands to nothing if debugging is disabled.
550  * >
551  * > When naming your category, please follow the following conventions to ensure
552  * > that the pattern matching for categories works as expected. It is not
553  * > earth-shattering if you don't follow these conventions, but it would be nice
554  * > for everyone.
555  * >
556  * > If you define a category for a plugin or a feature of it, name the category
557  * > like the feature. So if you wanted to write a "filesrc" element, you would
558  * > name the category "filesrc". Use lowercase letters only.
559  * > If you define more than one category for the same element, append an
560  * > underscore and an identifier to your categories, like this: "filesrc_cache"
561  * >
562  * > If you create a library or an application using debugging categories, use a
563  * > common prefix followed by an underscore for all your categories. GStreamer
564  * > uses the GST prefix so GStreamer categories look like "GST_STATES". Be sure
565  * > to include uppercase letters.
566  *
567  */
568 #define GST_DEBUG_CATEGORY_INIT(cat,name,color,description) G_STMT_START{\
569   if (cat == NULL)                                                      \
570     cat = _gst_debug_category_new (name,color,description);             \
571 }G_STMT_END
572
573 /**
574  * GST_DEBUG_CATEGORY_GET:
575  * @cat: the category to initialize.
576  * @name: log category name
577  *
578  * Looks up an existing #GstDebugCategory by its @name and sets @cat. If the
579  * category is not found, but GST_CAT_DEFAULT is defined, that is assigned to
580  * @cat. Otherwise @cat will be %NULL.
581  *
582  * |[<!-- language="C" -->
583  * GST_DEBUG_CATEGORY_STATIC (gst_myplugin_debug);
584  * #define GST_CAT_DEFAULT gst_myplugin_debug
585  * GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE);
586  * ...
587  * GST_DEBUG_CATEGORY_INIT (gst_myplugin_debug, "myplugin", 0, "nice element");
588  * GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "GST_PERFORMANCE");
589  * ]|
590  */
591 #ifdef GST_CAT_DEFAULT
592 #define GST_DEBUG_CATEGORY_GET(cat,name)  G_STMT_START{\
593   cat = _gst_debug_get_category (name);                 \
594   if (!cat) {                                           \
595     cat = GST_CAT_DEFAULT;                              \
596   }                                                     \
597 }G_STMT_END
598 #else
599 #define GST_DEBUG_CATEGORY_GET(cat,name)  G_STMT_START{\
600   cat = _gst_debug_get_category (name);                 \
601 }G_STMT_END
602 #endif
603
604 /**
605  * GST_CAT_DEFAULT:
606  *
607  * Default gstreamer core debug log category. Please define your own.
608  */
609
610 GST_EXPORT GstDebugCategory *   GST_CAT_DEFAULT;
611 /* this symbol may not be used */
612
613 GST_EXPORT gboolean                 _gst_debug_enabled;
614
615 /* the min debug level, used for quickly discarding debug
616  * messages that fall under the threshold. */
617
618 GST_EXPORT GstDebugLevel            _gst_debug_min;
619
620 /**
621  * GST_CAT_LEVEL_LOG:
622  * @cat: category to use
623  * @level: the severity of the message
624  * @object: (allow-none): the #GObject the message belongs to or %NULL if none
625  * @...: A printf-style message to output
626  *
627  * Outputs a debugging message. This is the most general macro for outputting
628  * debugging messages. You will probably want to use one of the ones described
629  * below.
630  *
631  * There is no need to finish the end of the debug message with a newline
632  * character, a newline character will be added automatically.
633  */
634 #ifdef G_HAVE_ISO_VARARGS
635 #define GST_CAT_LEVEL_LOG(cat,level,object,...) G_STMT_START{           \
636   if (G_UNLIKELY ((level) <= GST_LEVEL_MAX && (level) <= _gst_debug_min)) {                                             \
637     gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__,    \
638         (GObject *) (object), __VA_ARGS__);                             \
639   }                                                                     \
640 }G_STMT_END
641 #else /* G_HAVE_GNUC_VARARGS */
642 #ifdef G_HAVE_GNUC_VARARGS
643 #define GST_CAT_LEVEL_LOG(cat,level,object,args...) G_STMT_START{       \
644   if (G_UNLIKELY ((level) <= GST_LEVEL_MAX && (level) <= _gst_debug_min)) {                                             \
645     gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__,    \
646         (GObject *) (object), ##args );                                 \
647   }                                                                     \
648 }G_STMT_END
649 #else /* no variadic macros, use inline */
650 static inline void
651 GST_CAT_LEVEL_LOG_valist (GstDebugCategory * cat,
652     GstDebugLevel level, gpointer object, const char *format, va_list varargs)
653 {
654   if (G_UNLIKELY ((level) <= GST_LEVEL_MAX && (level) <= _gst_debug_min)) {
655     gst_debug_log_valist (cat, level, "", "", 0, (GObject *) object, format,
656         varargs);
657   }
658 }
659
660 static inline void
661 GST_CAT_LEVEL_LOG (GstDebugCategory * cat, GstDebugLevel level,
662     gpointer object, const char *format, ...)
663 {
664   va_list varargs;
665
666   va_start (varargs, format);
667   GST_CAT_LEVEL_LOG_valist (cat, level, object, format, varargs);
668   va_end (varargs);
669 }
670 #endif
671 #endif /* G_HAVE_ISO_VARARGS */
672
673 /* This one doesn't have varargs in the macro, so it's different than all the
674  * other macros and hence in a separate block right here. Docs chunks are
675  * with the other doc chunks below though. */
676 #define __GST_CAT_MEMDUMP_LOG(cat,object,msg,data,length) G_STMT_START{       \
677     if (G_UNLIKELY (GST_LEVEL_MEMDUMP <= GST_LEVEL_MAX &&                     \
678                     GST_LEVEL_MEMDUMP <= _gst_debug_min)) {                   \
679     _gst_debug_dump_mem ((cat), __FILE__, GST_FUNCTION, __LINE__,             \
680         (GObject *) (object), (msg), (data), (length));                       \
681   }                                                                           \
682 }G_STMT_END
683
684 #define GST_CAT_MEMDUMP_OBJECT(cat,obj,msg,data,length)  \
685     __GST_CAT_MEMDUMP_LOG(cat,obj,msg,data,length)
686 #define GST_CAT_MEMDUMP(cat,msg,data,length)             \
687     __GST_CAT_MEMDUMP_LOG(cat,NULL,msg,data,length)
688 #define GST_MEMDUMP_OBJECT(obj,msg,data,length)          \
689     __GST_CAT_MEMDUMP_LOG(GST_CAT_DEFAULT,obj,msg,data,length)
690 #define GST_MEMDUMP(msg,data,length)                     \
691     __GST_CAT_MEMDUMP_LOG(GST_CAT_DEFAULT,NULL,msg,data,length)
692
693 /**
694  * GST_CAT_ERROR_OBJECT:
695  * @cat: category to use
696  * @obj: the #GObject the message belongs to
697  * @...: printf-style message to output
698  *
699  * Output an error message belonging to the given object in the given category.
700  *
701  * There is no need to finish the end of the message string with a newline
702  * character, a newline character will be added automatically.
703  */
704 /**
705  * GST_CAT_WARNING_OBJECT:
706  * @cat: category to use
707  * @obj: the #GObject the message belongs to
708  * @...: printf-style message to output
709  *
710  * Output a warning message belonging to the given object in the given category.
711  *
712  * There is no need to finish the end of the message string with a newline
713  * character, a newline character will be added automatically.
714  */
715 /**
716  * GST_CAT_INFO_OBJECT:
717  * @cat: category to use
718  * @obj: the #GObject the message belongs to
719  * @...: printf-style message to output
720  *
721  * Output an informational message belonging to the given object in the given
722  * category.
723  *
724  * There is no need to finish the end of the message string with a newline
725  * character, a newline character will be added automatically.
726  */
727 /**
728  * GST_CAT_DEBUG_OBJECT:
729  * @cat: category to use
730  * @obj: the #GObject the message belongs to
731  * @...: printf-style message to output
732  *
733  * Output an debugging message belonging to the given object in the given category.
734  *
735  * There is no need to finish the end of the message string with a newline
736  * character, a newline character will be added automatically.
737  */
738 /**
739  * GST_CAT_LOG_OBJECT:
740  * @cat: category to use
741  * @obj: the #GObject the message belongs to
742  * @...: printf-style message to output
743  *
744  * Output an logging message belonging to the given object in the given category.
745  *
746  * There is no need to finish the end of the message string with a newline
747  * character, a newline character will be added automatically.
748  */
749 /**
750  * GST_CAT_FIXME_OBJECT:
751  * @cat: category to use
752  * @obj: the #GObject the message belongs to
753  * @...: printf-style message to output
754  *
755  * Output a fixme message belonging to the given object in the given category.
756  *
757  * There is no need to finish the end of the message string with a newline
758  * character, a newline character will be added automatically.
759  */
760 /**
761  * GST_CAT_TRACE_OBJECT:
762  * @cat: category to use
763  * @obj: the #GObject the message belongs to
764  * @...: printf-style message to output
765  *
766  * Output a tracing message belonging to the given object in the given
767  * category.
768  *
769  * There is no need to finish the end of the message string with a newline
770  * character, a newline character will be added automatically.
771  */
772 /**
773  * GST_CAT_MEMDUMP_OBJECT:
774  * @cat: category to use
775  * @obj: the #GObject the message belongs to
776  * @msg: message string to log with the data
777  * @data: pointer to the data to output
778  * @length: length of the data to output
779  *
780  * Output a hexdump of @data relating to the given object in the given
781  * category.
782  *
783  * There is no need to finish the end of the message string with a newline
784  * character, a newline character will be added automatically.
785  */
786
787
788 /**
789  * GST_CAT_ERROR:
790  * @cat: category to use
791  * @...: printf-style message to output
792  *
793  * Output an error message in the given category.
794  *
795  * There is no need to finish the end of the message string with a newline
796  * character, a newline character will be added automatically.
797  */
798 /**
799  * GST_CAT_WARNING:
800  * @cat: category to use
801  * @...: printf-style message to output
802  *
803  * Output an warning message in the given category.
804  *
805  * There is no need to finish the end of the message string with a newline
806  * character, a newline character will be added automatically.
807  */
808 /**
809  * GST_CAT_INFO:
810  * @cat: category to use
811  * @...: printf-style message to output
812  *
813  * Output an informational message in the given category.
814  *
815  * There is no need to finish the end of the message string with a newline
816  * character, a newline character will be added automatically.
817  */
818 /**
819  * GST_CAT_DEBUG:
820  * @cat: category to use
821  * @...: printf-style message to output
822  *
823  * Output an debugging message in the given category.
824  *
825  * There is no need to finish the end of the message string with a newline
826  * character, a newline character will be added automatically.
827  */
828 /**
829  * GST_CAT_LOG:
830  * @cat: category to use
831  * @...: printf-style message to output
832  *
833  * Output an logging message in the given category.
834  *
835  * There is no need to finish the end of the message string with a newline
836  * character, a newline character will be added automatically.
837  */
838 /**
839  * GST_CAT_FIXME:
840  * @cat: category to use
841  * @...: printf-style message to output
842  *
843  * Output an fixme message in the given category.
844  *
845  * There is no need to finish the end of the message string with a newline
846  * character, a newline character will be added automatically.
847  */
848 /**
849  * GST_CAT_TRACE:
850  * @cat: category to use
851  * @...: printf-style message to output
852  *
853  * Output a tracing message in the given category.
854  *
855  * There is no need to finish the end of the message string with a newline
856  * character, a newline character will be added automatically.
857  */
858 /**
859  * GST_CAT_MEMDUMP:
860  * @cat: category to use
861  * @msg: message string to log with the data
862  * @data: pointer to the data to output
863  * @length: length of the data to output
864  *
865  * Output a hexdump of @data in the given category.
866  *
867  * There is no need to finish the end of the message string with a newline
868  * character, a newline character will be added automatically.
869  */
870
871
872 /**
873  * GST_ERROR_OBJECT:
874  * @obj: the #GObject the message belongs to
875  * @...: printf-style message to output
876  *
877  * Output an error message belonging to the given object in the default category.
878  *
879  * There is no need to finish the end of the message string with a newline
880  * character, a newline character will be added automatically.
881  */
882 /**
883  * GST_WARNING_OBJECT:
884  * @obj: the #GObject the message belongs to
885  * @...: printf-style message to output
886  *
887  * Output a warning message belonging to the given object in the default category.
888  *
889  * There is no need to finish the end of the message string with a newline
890  * character, a newline character will be added automatically.
891  */
892 /**
893  * GST_INFO_OBJECT:
894  * @obj: the #GObject the message belongs to
895  * @...: printf-style message to output
896  *
897  * Output an informational message belonging to the given object in the default
898  * category.
899  *
900  * There is no need to finish the end of the message string with a newline
901  * character, a newline character will be added automatically.
902  */
903 /**
904  * GST_DEBUG_OBJECT:
905  * @obj: the #GObject the message belongs to
906  * @...: printf-style message to output
907  *
908  * Output a debugging message belonging to the given object in the default
909  * category.
910  *
911  * There is no need to finish the end of the message string with a newline
912  * character, a newline character will be added automatically.
913  */
914 /**
915  * GST_LOG_OBJECT:
916  * @obj: the #GObject the message belongs to
917  * @...: printf-style message to output
918  *
919  * Output a logging message belonging to the given object in the default category.
920  *
921  * There is no need to finish the end of the message string with a newline
922  * character, a newline character will be added automatically.
923  */
924 /**
925  * GST_FIXME_OBJECT:
926  * @obj: the #GObject the message belongs to
927  * @...: printf-style message to output
928  *
929  * Output a fixme message belonging to the given object in the default category.
930  *
931  * There is no need to finish the end of the message string with a newline
932  * character, a newline character will be added automatically.
933  */
934 /**
935  * GST_TRACE_OBJECT:
936  * @obj: the #GObject the message belongs to
937  * @...: printf-style message to output
938  *
939  * Output a tracing message belonging to the given object in the default category.
940  *
941  * There is no need to finish the end of the message string with a newline
942  * character, a newline character will be added automatically.
943  */
944 /**
945  * GST_MEMDUMP_OBJECT:
946  * @obj: the #GObject the message belongs to
947  * @msg: message string to log with the data
948  * @data: pointer to the data to output
949  * @length: length of the data to output
950  *
951  * Output a logging message belonging to the given object in the default 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
958 /**
959  * GST_ERROR:
960  * @...: printf-style message to output
961  *
962  * Output an error message in the default 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_WARNING:
969  * @...: printf-style message to output
970  *
971  * Output a warning message in the default category.
972  *
973  * There is no need to finish the end of the message string with a newline
974  * character, a newline character will be added automatically.
975  */
976 /**
977  * GST_INFO:
978  * @...: printf-style message to output
979  *
980  * Output an informational message in the default category.
981  *
982  * There is no need to finish the end of the message string with a newline
983  * character, a newline character will be added automatically.
984  */
985 /**
986  * GST_DEBUG:
987  * @...: printf-style message to output
988  *
989  * Output a debugging message in the default category.
990  *
991  * There is no need to finish the end of the message string with a newline
992  * character, a newline character will be added automatically.
993  */
994 /**
995  * GST_LOG:
996  * @...: printf-style message to output
997  *
998  * Output a logging message in the default category.
999  *
1000  * There is no need to finish the end of the message string with a newline
1001  * character, a newline character will be added automatically.
1002  */
1003 /**
1004  * GST_FIXME:
1005  * @...: printf-style message to output
1006  *
1007  * Output a fixme message in the default category.
1008  *
1009  * There is no need to finish the end of the message string with a newline
1010  * character, a newline character will be added automatically.
1011  */
1012 /**
1013  * GST_TRACE:
1014  * @...: printf-style message to output
1015  *
1016  * Output a tracing message in the default category.
1017  *
1018  * There is no need to finish the end of the message string with a newline
1019  * character, a newline character will be added automatically.
1020  */
1021 /**
1022  * GST_MEMDUMP:
1023  * @msg: message string to log with the data
1024  * @data: pointer to the data to output
1025  * @length: length of the data to output
1026  *
1027  * Output a hexdump of @data.
1028  *
1029  * There is no need to finish the end of the message string with a newline
1030  * character, a newline character will be added automatically.
1031  */
1032
1033 #ifdef G_HAVE_ISO_VARARGS
1034
1035 #define GST_CAT_ERROR_OBJECT(cat,obj,...)       GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR,   obj,  __VA_ARGS__)
1036 #define GST_CAT_WARNING_OBJECT(cat,obj,...)     GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, obj,  __VA_ARGS__)
1037 #define GST_CAT_INFO_OBJECT(cat,obj,...)        GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO,    obj,  __VA_ARGS__)
1038 #define GST_CAT_DEBUG_OBJECT(cat,obj,...)       GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG,   obj,  __VA_ARGS__)
1039 #define GST_CAT_LOG_OBJECT(cat,obj,...)         GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG,     obj,  __VA_ARGS__)
1040 #define GST_CAT_FIXME_OBJECT(cat,obj,...)       GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME,   obj,  __VA_ARGS__)
1041 #define GST_CAT_TRACE_OBJECT(cat,obj,...)       GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE,   obj,  __VA_ARGS__)
1042
1043 #define GST_CAT_ERROR(cat,...)                  GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR,   NULL, __VA_ARGS__)
1044 #define GST_CAT_WARNING(cat,...)                GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
1045 #define GST_CAT_INFO(cat,...)                   GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO,    NULL, __VA_ARGS__)
1046 #define GST_CAT_DEBUG(cat,...)                  GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG,   NULL, __VA_ARGS__)
1047 #define GST_CAT_LOG(cat,...)                    GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG,     NULL, __VA_ARGS__)
1048 #define GST_CAT_FIXME(cat,...)                  GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME,   NULL, __VA_ARGS__)
1049 #define GST_CAT_TRACE(cat,...)          GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE,   NULL, __VA_ARGS__)
1050
1051 #define GST_ERROR_OBJECT(obj,...)       GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR,   obj,  __VA_ARGS__)
1052 #define GST_WARNING_OBJECT(obj,...)     GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj,  __VA_ARGS__)
1053 #define GST_INFO_OBJECT(obj,...)        GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO,    obj,  __VA_ARGS__)
1054 #define GST_DEBUG_OBJECT(obj,...)       GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   obj,  __VA_ARGS__)
1055 #define GST_LOG_OBJECT(obj,...)         GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG,     obj,  __VA_ARGS__)
1056 #define GST_FIXME_OBJECT(obj,...)       GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME,   obj,  __VA_ARGS__)
1057 #define GST_TRACE_OBJECT(obj,...)       GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE,   obj,  __VA_ARGS__)
1058
1059 #define GST_ERROR(...)                  GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR,   NULL, __VA_ARGS__)
1060 #define GST_WARNING(...)                GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
1061 #define GST_INFO(...)                   GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO,    NULL, __VA_ARGS__)
1062 #define GST_DEBUG(...)                  GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   NULL, __VA_ARGS__)
1063 #define GST_LOG(...)                    GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG,     NULL, __VA_ARGS__)
1064 #define GST_FIXME(...)                  GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME,   NULL, __VA_ARGS__)
1065 #define GST_TRACE(...)          GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE,   NULL, __VA_ARGS__)
1066
1067 #else
1068 #ifdef G_HAVE_GNUC_VARARGS
1069
1070 #define GST_CAT_ERROR_OBJECT(cat,obj,args...)   GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR,   obj,  ##args )
1071 #define GST_CAT_WARNING_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, obj,  ##args )
1072 #define GST_CAT_INFO_OBJECT(cat,obj,args...)    GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO,    obj,  ##args )
1073 #define GST_CAT_DEBUG_OBJECT(cat,obj,args...)   GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG,   obj,  ##args )
1074 #define GST_CAT_LOG_OBJECT(cat,obj,args...)     GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG,     obj,  ##args )
1075 #define GST_CAT_FIXME_OBJECT(cat,obj,args...)   GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME,   obj,  ##args )
1076 #define GST_CAT_TRACE_OBJECT(cat,obj,args...)   GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE,   obj,  ##args )
1077
1078 #define GST_CAT_ERROR(cat,args...)              GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR,   NULL, ##args )
1079 #define GST_CAT_WARNING(cat,args...)            GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, NULL, ##args )
1080 #define GST_CAT_INFO(cat,args...)               GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO,    NULL, ##args )
1081 #define GST_CAT_DEBUG(cat,args...)              GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG,   NULL, ##args )
1082 #define GST_CAT_LOG(cat,args...)                GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG,     NULL, ##args )
1083 #define GST_CAT_FIXME(cat,args...)              GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME,   NULL, ##args )
1084 #define GST_CAT_TRACE(cat,args...)              GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE,   NULL, ##args )
1085
1086 #define GST_ERROR_OBJECT(obj,args...)   GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR,   obj,  ##args )
1087 #define GST_WARNING_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj,  ##args )
1088 #define GST_INFO_OBJECT(obj,args...)    GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO,    obj,  ##args )
1089 #define GST_DEBUG_OBJECT(obj,args...)   GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   obj,  ##args )
1090 #define GST_LOG_OBJECT(obj,args...)     GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG,     obj,  ##args )
1091 #define GST_FIXME_OBJECT(obj,args...)   GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME,   obj,  ##args )
1092 #define GST_TRACE_OBJECT(obj,args...)   GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE,   obj,  ##args )
1093
1094 #define GST_ERROR(args...)              GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR,   NULL, ##args )
1095 #define GST_WARNING(args...)            GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, ##args )
1096 #define GST_INFO(args...)               GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO,    NULL, ##args )
1097 #define GST_DEBUG(args...)              GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   NULL, ##args )
1098 #define GST_LOG(args...)                GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG,     NULL, ##args )
1099 #define GST_FIXME(args...)              GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME,   NULL, ##args )
1100 #define GST_TRACE(args...)              GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE,   NULL, ##args )
1101
1102 #else
1103 /* no variadic macros, use inline */
1104 static inline void
1105 GST_CAT_ERROR_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1106     ...)
1107 {
1108   va_list varargs;
1109
1110   va_start (varargs, format);
1111   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_ERROR, obj, format, varargs);
1112   va_end (varargs);
1113 }
1114
1115 static inline void
1116 GST_CAT_WARNING_OBJECT (GstDebugCategory * cat, gpointer obj,
1117     const char *format, ...)
1118 {
1119   va_list varargs;
1120
1121   va_start (varargs, format);
1122   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_WARNING, obj, format, varargs);
1123   va_end (varargs);
1124 }
1125
1126 static inline void
1127 GST_CAT_INFO_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1128     ...)
1129 {
1130   va_list varargs;
1131
1132   va_start (varargs, format);
1133   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_INFO, obj, format, varargs);
1134   va_end (varargs);
1135 }
1136
1137 static inline void
1138 GST_CAT_DEBUG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1139     ...)
1140 {
1141   va_list varargs;
1142
1143   va_start (varargs, format);
1144   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_DEBUG, obj, format, varargs);
1145   va_end (varargs);
1146 }
1147
1148 static inline void
1149 GST_CAT_LOG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1150     ...)
1151 {
1152   va_list varargs;
1153
1154   va_start (varargs, format);
1155   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_LOG, obj, format, varargs);
1156   va_end (varargs);
1157 }
1158
1159 static inline void
1160 GST_CAT_FIXME_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1161     ...)
1162 {
1163   va_list varargs;
1164
1165   va_start (varargs, format);
1166   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_FIXME, obj, format, varargs);
1167   va_end (varargs);
1168 }
1169
1170 static inline void
1171 GST_CAT_TRACE_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1172     ...)
1173 {
1174   va_list varargs;
1175
1176   va_start (varargs, format);
1177   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_TRACE, obj, format, varargs);
1178   va_end (varargs);
1179 }
1180
1181 static inline void
1182 GST_CAT_ERROR (GstDebugCategory * cat, const char *format, ...)
1183 {
1184   va_list varargs;
1185
1186   va_start (varargs, format);
1187   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_ERROR, NULL, format, varargs);
1188   va_end (varargs);
1189 }
1190
1191 static inline void
1192 GST_CAT_WARNING (GstDebugCategory * cat, const char *format, ...)
1193 {
1194   va_list varargs;
1195
1196   va_start (varargs, format);
1197   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_WARNING, NULL, format, varargs);
1198   va_end (varargs);
1199 }
1200
1201 static inline void
1202 GST_CAT_INFO (GstDebugCategory * cat, const char *format, ...)
1203 {
1204   va_list varargs;
1205
1206   va_start (varargs, format);
1207   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_INFO, NULL, format, varargs);
1208   va_end (varargs);
1209 }
1210
1211 static inline void
1212 GST_CAT_DEBUG (GstDebugCategory * cat, const char *format, ...)
1213 {
1214   va_list varargs;
1215
1216   va_start (varargs, format);
1217   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_DEBUG, NULL, format, varargs);
1218   va_end (varargs);
1219 }
1220
1221 static inline void
1222 GST_CAT_LOG (GstDebugCategory * cat, const char *format, ...)
1223 {
1224   va_list varargs;
1225
1226   va_start (varargs, format);
1227   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_LOG, NULL, format, varargs);
1228   va_end (varargs);
1229 }
1230
1231 static inline void
1232 GST_CAT_FIXME (GstDebugCategory * cat, const char *format, ...)
1233 {
1234   va_list varargs;
1235
1236   va_start (varargs, format);
1237   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_FIXME, NULL, format, varargs);
1238   va_end (varargs);
1239 }
1240
1241 static inline void
1242 GST_CAT_TRACE (GstDebugCategory * cat, const char *format, ...)
1243 {
1244   va_list varargs;
1245
1246   va_start (varargs, format);
1247   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_TRACE, NULL, format, varargs);
1248   va_end (varargs);
1249 }
1250
1251 static inline void
1252 GST_ERROR_OBJECT (gpointer obj, const char *format, ...)
1253 {
1254   va_list varargs;
1255
1256   va_start (varargs, format);
1257   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_ERROR, obj, format,
1258       varargs);
1259   va_end (varargs);
1260 }
1261
1262 static inline void
1263 GST_WARNING_OBJECT (gpointer obj, const char *format, ...)
1264 {
1265   va_list varargs;
1266
1267   va_start (varargs, format);
1268   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj, format,
1269       varargs);
1270   va_end (varargs);
1271 }
1272
1273 static inline void
1274 GST_INFO_OBJECT (gpointer obj, const char *format, ...)
1275 {
1276   va_list varargs;
1277
1278   va_start (varargs, format);
1279   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_INFO, obj, format,
1280       varargs);
1281   va_end (varargs);
1282 }
1283
1284 static inline void
1285 GST_DEBUG_OBJECT (gpointer obj, const char *format, ...)
1286 {
1287   va_list varargs;
1288
1289   va_start (varargs, format);
1290   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, obj, format,
1291       varargs);
1292   va_end (varargs);
1293 }
1294
1295 static inline void
1296 GST_LOG_OBJECT (gpointer obj, const char *format, ...)
1297 {
1298   va_list varargs;
1299
1300   va_start (varargs, format);
1301   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_LOG, obj, format,
1302       varargs);
1303   va_end (varargs);
1304 }
1305
1306 static inline void
1307 GST_FIXME_OBJECT (gpointer obj, const char *format, ...)
1308 {
1309   va_list varargs;
1310
1311   va_start (varargs, format);
1312   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_FIXME, obj, format,
1313       varargs);
1314   va_end (varargs);
1315 }
1316
1317 static inline void
1318 GST_TRACE_OBJECT (gpointer obj, const char *format, ...)
1319 {
1320   va_list varargs;
1321
1322   va_start (varargs, format);
1323   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_TRACE, obj, format,
1324       varargs);
1325   va_end (varargs);
1326 }
1327
1328 static inline void
1329 GST_ERROR (const char *format, ...)
1330 {
1331   va_list varargs;
1332
1333   va_start (varargs, format);
1334   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_ERROR, NULL, format,
1335       varargs);
1336   va_end (varargs);
1337 }
1338
1339 static inline void
1340 GST_WARNING (const char *format, ...)
1341 {
1342   va_list varargs;
1343
1344   va_start (varargs, format);
1345   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, format,
1346       varargs);
1347   va_end (varargs);
1348 }
1349
1350 static inline void
1351 GST_INFO (const char *format, ...)
1352 {
1353   va_list varargs;
1354
1355   va_start (varargs, format);
1356   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, format,
1357       varargs);
1358   va_end (varargs);
1359 }
1360
1361 static inline void
1362 GST_DEBUG (const char *format, ...)
1363 {
1364   va_list varargs;
1365
1366   va_start (varargs, format);
1367   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, format,
1368       varargs);
1369   va_end (varargs);
1370 }
1371
1372 static inline void
1373 GST_LOG (const char *format, ...)
1374 {
1375   va_list varargs;
1376
1377   va_start (varargs, format);
1378   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_LOG, NULL,
1379       format, varargs);
1380   va_end (varargs);
1381 }
1382
1383 static inline void
1384 GST_FIXME (const char *format, ...)
1385 {
1386   va_list varargs;
1387
1388   va_start (varargs, format);
1389   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_FIXME, NULL, format,
1390       varargs);
1391   va_end (varargs);
1392 }
1393
1394 static inline void
1395 GST_TRACE (const char *format, ...)
1396 {
1397   va_list varargs;
1398
1399   va_start (varargs, format);
1400   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_TRACE, NULL, format,
1401       varargs);
1402   va_end (varargs);
1403 }
1404 #endif
1405 #endif
1406
1407
1408 /********** function pointer stuff **********/
1409
1410 /**
1411  * GST_DEBUG_REGISTER_FUNCPTR:
1412  * @ptr: pointer to the function to register
1413  *
1414  * Register a pointer to a function with its name, so it can later be used by
1415  * GST_DEBUG_FUNCPTR_NAME().
1416  *
1417  * Use this variant of #GST_DEBUG_FUNCPTR if you do not need to use @ptr.
1418  */
1419 #define GST_DEBUG_REGISTER_FUNCPTR(ptr) \
1420   _gst_debug_register_funcptr((GstDebugFuncPtr)(ptr), #ptr)
1421 /**
1422  * GST_DEBUG_FUNCPTR:
1423  * @ptr: pointer to the function to register
1424  *
1425  * Register a pointer to a function with its name, so it can later be used by
1426  * GST_DEBUG_FUNCPTR_NAME().
1427  *
1428  * Returns: the value passed to @ptr.
1429  */
1430 #define GST_DEBUG_FUNCPTR(ptr) \
1431   (_gst_debug_register_funcptr((GstDebugFuncPtr)(ptr), #ptr) , ptr)
1432
1433 /**
1434  * GST_DEBUG_FUNCPTR_NAME:
1435  * @ptr: address of the function of which to look up the name
1436  *
1437  * Retrieves the name of the function, if it was previously registered with
1438  * GST_DEBUG_FUNCPTR(). If not, it returns a description of the pointer.
1439  *
1440  * This macro returns a constant string which must not be modified or
1441  * freed by the caller.
1442  */
1443 #define GST_DEBUG_FUNCPTR_NAME(ptr) \
1444   _gst_debug_nameof_funcptr((GstDebugFuncPtr)ptr)
1445
1446
1447 #else /* GST_DISABLE_GST_DEBUG */
1448
1449
1450 #ifndef GST_INFO_C
1451
1452 #if defined(__GNUC__) && __GNUC__ >= 3
1453 #  pragma GCC poison gst_debug_log
1454 #  pragma GCC poison gst_debug_log_valist
1455 #  pragma GCC poison _gst_debug_category_new
1456 #endif
1457
1458 #define _gst_debug_min GST_LEVEL_NONE
1459
1460 #define gst_debug_set_default_threshold(level)          G_STMT_START{ }G_STMT_END
1461 #define gst_debug_get_default_threshold()               (GST_LEVEL_NONE)
1462
1463 #define gst_debug_level_get_name(level)                         ("NONE")
1464 #define gst_debug_message_get(message)                          ("")
1465 #define gst_debug_add_log_function(func,data,notify)    G_STMT_START{ }G_STMT_END
1466 #define gst_debug_set_active(active)                    G_STMT_START{ }G_STMT_END
1467 #define gst_debug_is_active()                           (FALSE)
1468 #define gst_debug_set_colored(colored)                  G_STMT_START{ }G_STMT_END
1469 #define gst_debug_set_color_mode(mode)                  G_STMT_START{ }G_STMT_END
1470 #define gst_debug_set_color_mode_from_string(mode)      G_STMT_START{ }G_STMT_END
1471 #define gst_debug_is_colored()                          (FALSE)
1472 #define gst_debug_get_color_mode()                      (GST_DEBUG_COLOR_MODE_OFF)
1473 #define gst_debug_set_default_threshold(level)          G_STMT_START{ }G_STMT_END
1474 #define gst_debug_get_default_threshold()               (GST_LEVEL_NONE)
1475 #define gst_debug_set_threshold_for_name(name,level)    G_STMT_START{ }G_STMT_END
1476 #define gst_debug_unset_threshold_for_name(name)        G_STMT_START{ }G_STMT_END
1477
1478 /* we are using dummy function prototypes here to eat ';' as these macros are
1479  * used outside of functions */
1480 #define GST_DEBUG_CATEGORY(var)                         void _gst_debug_dummy_##var (void)
1481 #define GST_DEBUG_CATEGORY_EXTERN(var)                  void _gst_debug_dummy_extern_##var (void)
1482 #define GST_DEBUG_CATEGORY_STATIC(var)                  void _gst_debug_dummy_static_##var (void)
1483
1484 #define GST_DEBUG_CATEGORY_INIT(var,name,color,desc)    G_STMT_START{ }G_STMT_END
1485 #define GST_DEBUG_CATEGORY_GET(var,name)                G_STMT_START{ }G_STMT_END
1486 #define gst_debug_category_free(category)               G_STMT_START{ }G_STMT_END
1487 #define gst_debug_category_set_threshold(category,level) G_STMT_START{ }G_STMT_END
1488 #define gst_debug_category_reset_threshold(category)    G_STMT_START{ }G_STMT_END
1489 #define gst_debug_category_get_threshold(category)      (GST_LEVEL_NONE)
1490 #define gst_debug_category_get_name(cat)                ("")
1491 #define gst_debug_category_get_color(cat)               (0)
1492 #define gst_debug_category_get_description(cat)         ("")
1493 #define gst_debug_get_all_categories()                  (NULL)
1494 #define gst_debug_construct_term_color(colorinfo)       (g_strdup ("00"))
1495 #define gst_debug_construct_win_color(colorinfo)        (0)
1496
1497 #endif /* !GST_INFO_C */
1498
1499 #ifdef G_HAVE_ISO_VARARGS
1500
1501 #define GST_CAT_LEVEL_LOG(cat,level,...)                G_STMT_START{ }G_STMT_END
1502
1503 #define GST_CAT_ERROR_OBJECT(...)                       G_STMT_START{ }G_STMT_END
1504 #define GST_CAT_WARNING_OBJECT(...)                     G_STMT_START{ }G_STMT_END
1505 #define GST_CAT_INFO_OBJECT(...)                        G_STMT_START{ }G_STMT_END
1506 #define GST_CAT_DEBUG_OBJECT(...)                       G_STMT_START{ }G_STMT_END
1507 #define GST_CAT_LOG_OBJECT(...)                         G_STMT_START{ }G_STMT_END
1508 #define GST_CAT_FIXME_OBJECT(...)                       G_STMT_START{ }G_STMT_END
1509 #define GST_CAT_TRACE_OBJECT(...)                       G_STMT_START{ }G_STMT_END
1510
1511 #define GST_CAT_ERROR(...)                              G_STMT_START{ }G_STMT_END
1512 #define GST_CAT_WARNING(...)                            G_STMT_START{ }G_STMT_END
1513 #define GST_CAT_INFO(...)                               G_STMT_START{ }G_STMT_END
1514 #define GST_CAT_DEBUG(...)                              G_STMT_START{ }G_STMT_END
1515 #define GST_CAT_LOG(...)                                G_STMT_START{ }G_STMT_END
1516 #define GST_CAT_FIXME(...)                              G_STMT_START{ }G_STMT_END
1517 #define GST_CAT_TRACE(...)                              G_STMT_START{ }G_STMT_END
1518
1519 #define GST_ERROR_OBJECT(...)                           G_STMT_START{ }G_STMT_END
1520 #define GST_WARNING_OBJECT(...)                         G_STMT_START{ }G_STMT_END
1521 #define GST_INFO_OBJECT(...)                            G_STMT_START{ }G_STMT_END
1522 #define GST_DEBUG_OBJECT(...)                           G_STMT_START{ }G_STMT_END
1523 #define GST_LOG_OBJECT(...)                             G_STMT_START{ }G_STMT_END
1524 #define GST_FIXME_OBJECT(...)                           G_STMT_START{ }G_STMT_END
1525 #define GST_TRACE_OBJECT(...)                           G_STMT_START{ }G_STMT_END
1526
1527 #define GST_ERROR(...)                                  G_STMT_START{ }G_STMT_END
1528 #define GST_WARNING(...)                                G_STMT_START{ }G_STMT_END
1529 #define GST_INFO(...)                                   G_STMT_START{ }G_STMT_END
1530 #define GST_DEBUG(...)                                  G_STMT_START{ }G_STMT_END
1531 #define GST_LOG(...)                                    G_STMT_START{ }G_STMT_END
1532 #define GST_FIXME(...)                                  G_STMT_START{ }G_STMT_END
1533 #define GST_TRACE(...)                                  G_STMT_START{ }G_STMT_END
1534
1535 #else /* !G_HAVE_ISO_VARARGS */
1536 #ifdef G_HAVE_GNUC_VARARGS
1537
1538 #define GST_CAT_LEVEL_LOG(cat,level,args...)            G_STMT_START{ }G_STMT_END
1539
1540 #define GST_CAT_ERROR_OBJECT(args...)                   G_STMT_START{ }G_STMT_END
1541 #define GST_CAT_WARNING_OBJECT(args...)                 G_STMT_START{ }G_STMT_END
1542 #define GST_CAT_INFO_OBJECT(args...)                    G_STMT_START{ }G_STMT_END
1543 #define GST_CAT_DEBUG_OBJECT(args...)                   G_STMT_START{ }G_STMT_END
1544 #define GST_CAT_LOG_OBJECT(args...)                     G_STMT_START{ }G_STMT_END
1545 #define GST_CAT_FIXME_OBJECT(args...)                   G_STMT_START{ }G_STMT_END
1546 #define GST_CAT_TRACE_OBJECT(args...)                   G_STMT_START{ }G_STMT_END
1547
1548 #define GST_CAT_ERROR(args...)                          G_STMT_START{ }G_STMT_END
1549 #define GST_CAT_WARNING(args...)                        G_STMT_START{ }G_STMT_END
1550 #define GST_CAT_INFO(args...)                           G_STMT_START{ }G_STMT_END
1551 #define GST_CAT_DEBUG(args...)                          G_STMT_START{ }G_STMT_END
1552 #define GST_CAT_LOG(args...)                            G_STMT_START{ }G_STMT_END
1553 #define GST_CAT_FIXME(args...)                          G_STMT_START{ }G_STMT_END
1554 #define GST_CAT_TRACE(args...)                          G_STMT_START{ }G_STMT_END
1555
1556 #define GST_ERROR_OBJECT(args...)                       G_STMT_START{ }G_STMT_END
1557 #define GST_WARNING_OBJECT(args...)                     G_STMT_START{ }G_STMT_END
1558 #define GST_INFO_OBJECT(args...)                        G_STMT_START{ }G_STMT_END
1559 #define GST_DEBUG_OBJECT(args...)                       G_STMT_START{ }G_STMT_END
1560 #define GST_LOG_OBJECT(args...)                         G_STMT_START{ }G_STMT_END
1561 #define GST_FIXME_OBJECT(args...)                       G_STMT_START{ }G_STMT_END
1562 #define GST_TRACE_OBJECT(args...)                       G_STMT_START{ }G_STMT_END
1563
1564 #define GST_ERROR(args...)                              G_STMT_START{ }G_STMT_END
1565 #define GST_WARNING(args...)                            G_STMT_START{ }G_STMT_END
1566 #define GST_INFO(args...)                               G_STMT_START{ }G_STMT_END
1567 #define GST_DEBUG(args...)                              G_STMT_START{ }G_STMT_END
1568 #define GST_LOG(args...)                                G_STMT_START{ }G_STMT_END
1569 #define GST_FIXME(args...)                              G_STMT_START{ }G_STMT_END
1570 #define GST_TRACE(args...)                              G_STMT_START{ }G_STMT_END
1571
1572 #else /* !G_HAVE_GNUC_VARARGS */
1573 static inline void
1574 GST_CAT_LEVEL_LOG_valist (GstDebugCategory * cat,
1575     GstDebugLevel level, gpointer object, const char *format, va_list varargs)
1576 {
1577 }
1578
1579 static inline void
1580 GST_CAT_ERROR_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1581     ...)
1582 {
1583 }
1584
1585 static inline void
1586 GST_CAT_WARNING_OBJECT (GstDebugCategory * cat, gpointer obj,
1587     const char *format, ...)
1588 {
1589 }
1590
1591 static inline void
1592 GST_CAT_INFO_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1593     ...)
1594 {
1595 }
1596
1597 static inline void
1598 GST_CAT_DEBUG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1599     ...)
1600 {
1601 }
1602
1603 static inline void
1604 GST_CAT_LOG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1605     ...)
1606 {
1607 }
1608
1609 static inline void
1610 GST_CAT_FIXME_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1611     ...)
1612 {
1613 }
1614
1615 static inline void
1616 GST_CAT_TRACE_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1617     ...)
1618 {
1619 }
1620
1621 static inline void
1622 GST_CAT_ERROR (GstDebugCategory * cat, const char *format, ...)
1623 {
1624 }
1625
1626 static inline void
1627 GST_CAT_WARNING (GstDebugCategory * cat, const char *format, ...)
1628 {
1629 }
1630
1631 static inline void
1632 GST_CAT_INFO (GstDebugCategory * cat, const char *format, ...)
1633 {
1634 }
1635
1636 static inline void
1637 GST_CAT_DEBUG (GstDebugCategory * cat, const char *format, ...)
1638 {
1639 }
1640
1641 static inline void
1642 GST_CAT_LOG (GstDebugCategory * cat, const char *format, ...)
1643 {
1644 }
1645
1646 static inline void
1647 GST_CAT_FIXME (GstDebugCategory * cat, const char *format, ...)
1648 {
1649 }
1650
1651 static inline void
1652 GST_CAT_TRACE (GstDebugCategory * cat, const char *format, ...)
1653 {
1654 }
1655
1656 static inline void
1657 GST_ERROR_OBJECT (gpointer obj, const char *format, ...)
1658 {
1659 }
1660
1661 static inline void
1662 GST_WARNING_OBJECT (gpointer obj, const char *format, ...)
1663 {
1664 }
1665
1666 static inline void
1667 GST_INFO_OBJECT (gpointer obj, const char *format, ...)
1668 {
1669 }
1670
1671 static inline void
1672 GST_DEBUG_OBJECT (gpointer obj, const char *format, ...)
1673 {
1674 }
1675
1676 static inline void
1677 GST_LOG_OBJECT (gpointer obj, const char *format, ...)
1678 {
1679 }
1680
1681 static inline void
1682 GST_FIXME_OBJECT (gpointer obj, const char *format, ...)
1683 {
1684 }
1685
1686 static inline void
1687 GST_TRACE_OBJECT (gpointer obj, const char *format, ...)
1688 {
1689 }
1690
1691 static inline void
1692 GST_ERROR (const char *format, ...)
1693 {
1694 }
1695
1696 static inline void
1697 GST_WARNING (const char *format, ...)
1698 {
1699 }
1700
1701 static inline void
1702 GST_INFO (const char *format, ...)
1703 {
1704 }
1705
1706 static inline void
1707 GST_DEBUG (const char *format, ...)
1708 {
1709 }
1710
1711 static inline void
1712 GST_LOG (const char *format, ...)
1713 {
1714 }
1715
1716 static inline void
1717 GST_FIXME (const char *format, ...)
1718 {
1719 }
1720
1721 static inline void
1722 GST_TRACE (const char *format, ...)
1723 {
1724 }
1725
1726 #endif /* G_HAVE_GNUC_VARARGS */
1727 #endif /* G_HAVE_ISO_VARARGS */
1728
1729 #define GST_DEBUG_REGISTER_FUNCPTR(ptr) G_STMT_START{ }G_STMT_END
1730 #define GST_DEBUG_FUNCPTR(ptr) (ptr)
1731 #define GST_DEBUG_FUNCPTR_NAME(ptr) (g_strdup_printf ("%p", ptr))
1732
1733 #define GST_CAT_MEMDUMP_OBJECT(cat,obj,msg,data,length) G_STMT_START{ }G_STMT_END
1734 #define GST_CAT_MEMDUMP(cat,msg,data,length)            G_STMT_START{ }G_STMT_END
1735 #define GST_MEMDUMP_OBJECT(obj,msg,data,length)         G_STMT_START{ }G_STMT_END
1736 #define GST_MEMDUMP(msg,data,length)                    G_STMT_START{ }G_STMT_END
1737
1738 #endif /* GST_DISABLE_GST_DEBUG */
1739
1740
1741 GST_EXPORT
1742 void gst_debug_print_stack_trace (void);
1743
1744 GST_EXPORT
1745 gchar * gst_debug_get_stack_trace (GstStackTraceFlags flags);
1746
1747 G_END_DECLS
1748
1749 #endif /* __GSTINFO_H__ */