info: allow getting other log categories. Fixes #587417
[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., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, 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 #ifndef M_PI
32 #define M_PI  3.14159265358979323846
33 #endif
34
35 G_BEGIN_DECLS
36
37 /**
38  * GstDebugLevel:
39  * @GST_LEVEL_NONE: No debugging level specified or desired. Used to deactivate
40  *  debugging output.
41  * @GST_LEVEL_ERROR: Error messages are to be used only when an error occured
42  *  that stops the application from keeping working correctly.
43  *  An examples is gst_element_error, which outputs a message with this priority.
44  *  It does not mean that the application is terminating as with g_errror.
45  * @GST_LEVEL_WARNING: Warning messages are to inform about abnormal behaviour
46  *  that could lead to problems or weird behaviour later on. An example of this
47  *  would be clocking issues ("your computer is pretty slow") or broken input
48  *  data ("Can't synchronize to stream.")
49  * @GST_LEVEL_INFO: Informational messages should be used to keep the developer
50  *  updated about what is happening.
51  *  Examples where this should be used are when a typefind function has
52  *  successfully determined the type of the stream or when an mp3 plugin detects
53  *  the format to be used. ("This file has mono sound.")
54  * @GST_LEVEL_DEBUG: Debugging messages should be used when something common
55  *  happens that is not the expected default behavior.
56  *  An example would be notifications about state changes or receiving/sending of
57  *  events.
58  * @GST_LEVEL_LOG: Log messages are messages that are very common but might be
59  *  useful to know. As a rule of thumb a pipeline that is iterating as expected
60  *  should never output anzthing else but LOG messages.
61  *  Examples for this are referencing/dereferencing of objects or cothread switches.
62  * @GST_LEVEL_FIXME: Fixme messages are messages that indicate that something
63  *  in the executed code path is not fully implemented or handled yet. Note
64  *  that this does not replace proper error handling in any way, the purpose
65  *  of this message is to make it easier to spot incomplete/unfinished pieces
66  *  of code when reading the debug log. (Since: 0.10.23)
67  * @GST_LEVEL_MEMDUMP: memory dump messages are used to log (small) chunks of
68  *  data as memory dumps in the log. They will be displayed as hexdump with
69  *  ASCII characters. (Since: 0.10.23)
70  * @GST_LEVEL_COUNT: The number of defined debugging levels.
71  *
72  * The level defines the importance of a debugging message. The more important a
73  * message is, the greater the probability that the debugging system outputs it.
74  */
75 typedef enum {
76   GST_LEVEL_NONE = 0,
77   GST_LEVEL_ERROR,
78   GST_LEVEL_WARNING,
79   GST_LEVEL_INFO,
80   GST_LEVEL_DEBUG,
81   GST_LEVEL_LOG,
82   GST_LEVEL_FIXME = 6,
83   /* add more */
84   GST_LEVEL_MEMDUMP = 9,
85   /* add more */
86   GST_LEVEL_COUNT
87 } GstDebugLevel;
88
89 /**
90  * GST_LEVEL_DEFAULT:
91  *
92  * Defines the default debugging level to be used with GStreamer. It is normally
93  * set to #GST_LEVEL_NONE so nothing get printed.
94  * As it can be configured at compile time, developer builds may chose to
95  * override that though.
96  * You can use this as an argument to gst_debug_set_default_threshold() to
97  * reset the debugging output to default behaviour.
98  */
99 #ifndef GST_LEVEL_DEFAULT
100 #define GST_LEVEL_DEFAULT GST_LEVEL_NONE
101 #endif
102
103 /* defines for format (colors etc)
104  * don't change them around, it uses terminal layout
105  * Terminal color strings:
106  * 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
107  * Text color codes:
108  * 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
109  * Background color codes:
110  * 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
111  */
112 /**
113  * GstDebugColorFlags:
114  * @GST_DEBUG_FG_BLACK: Use black as foreground color.
115  * @GST_DEBUG_FG_RED: Use red as foreground color.
116  * @GST_DEBUG_FG_GREEN: Use green as foreground color.
117  * @GST_DEBUG_FG_YELLOW: Use yellow as foreground color.
118  * @GST_DEBUG_FG_BLUE: Use blue as foreground color.
119  * @GST_DEBUG_FG_MAGENTA: Use magenta as foreground color.
120  * @GST_DEBUG_FG_CYAN: Use cyan as foreground color.
121  * @GST_DEBUG_FG_WHITE: Use white as foreground color.
122  * @GST_DEBUG_BG_BLACK: Use black as background color.
123  * @GST_DEBUG_BG_RED: Use red as background color.
124  * @GST_DEBUG_BG_GREEN: Use green as background color.
125  * @GST_DEBUG_BG_YELLOW: Use yellow as background color.
126  * @GST_DEBUG_BG_BLUE: Use blue as background color.
127  * @GST_DEBUG_BG_MAGENTA: Use magenta as background color.
128  * @GST_DEBUG_BG_CYAN: Use cyan as background color.
129  * @GST_DEBUG_BG_WHITE: Use white as background color.
130  * @GST_DEBUG_BOLD: Make the output bold.
131  * @GST_DEBUG_UNDERLINE: Underline the output.
132  *
133  * These are some terminal style flags you can use when creating your
134  * debugging categories to make them stand out in debugging output.
135  */
136 typedef enum {
137   /* colors */
138   GST_DEBUG_FG_BLACK            = 0x0000,
139   GST_DEBUG_FG_RED              = 0x0001,
140   GST_DEBUG_FG_GREEN            = 0x0002,
141   GST_DEBUG_FG_YELLOW           = 0x0003,
142   GST_DEBUG_FG_BLUE             = 0x0004,
143   GST_DEBUG_FG_MAGENTA          = 0x0005,
144   GST_DEBUG_FG_CYAN             = 0x0006,
145   GST_DEBUG_FG_WHITE            = 0x0007,
146   /* background colors */
147   GST_DEBUG_BG_BLACK            = 0x0000,
148   GST_DEBUG_BG_RED              = 0x0010,
149   GST_DEBUG_BG_GREEN            = 0x0020,
150   GST_DEBUG_BG_YELLOW           = 0x0030,
151   GST_DEBUG_BG_BLUE             = 0x0040,
152   GST_DEBUG_BG_MAGENTA          = 0x0050,
153   GST_DEBUG_BG_CYAN             = 0x0060,
154   GST_DEBUG_BG_WHITE            = 0x0070,
155   /* other formats */
156   GST_DEBUG_BOLD                = 0x0100,
157   GST_DEBUG_UNDERLINE           = 0x0200
158 } GstDebugColorFlags;
159
160 #define GST_DEBUG_FG_MASK       (0x000F)
161 #define GST_DEBUG_BG_MASK       (0x00F0)
162 #define GST_DEBUG_FORMAT_MASK   (0xFF00)
163
164 typedef struct _GstDebugCategory GstDebugCategory;
165 /**
166  * GstDebugCategory:
167  *
168  * This is the struct that describes the categories. Once initialized with
169  * #GST_DEBUG_CATEGORY_INIT, its values can't be changed anymore.
170  */
171 struct _GstDebugCategory {
172   /*< private >*/
173   gint                  threshold;
174   guint                 color;          /* see defines above */
175
176   const gchar *         name;
177   const gchar *         description;
178 };
179
180 /********** some convenience macros for debugging **********/
181
182 /**
183  * GST_STR_NULL:
184  * @str: The string to check.
185  *
186  * Macro to use when a string must not be NULL, but may be NULL. If the string
187  * is NULL, "(NULL)" is printed instead.
188  * In GStreamer printf string arguments may not be NULL, because on some
189  * platforms (ie Solaris) the libc crashes in that case. This includes debugging
190  * strings.
191  */
192 #define GST_STR_NULL(str) ((str) ? (str) : "(NULL)")
193
194 /* FIXME, not MT safe */
195 /**
196  * GST_DEBUG_PAD_NAME:
197  * @pad: The pad to debug.
198  *
199  * Evaluates to 2 strings, that describe the pad. Often used in debugging
200  * statements.
201  */
202 #define GST_DEBUG_PAD_NAME(pad) \
203   (pad != NULL) ?  \
204   ((GST_OBJECT_PARENT(pad) != NULL) ? \
205   GST_STR_NULL (GST_OBJECT_NAME (GST_OBJECT_PARENT(pad))) : \
206   "''" ) : "''", \
207   (pad != NULL) ? GST_STR_NULL (GST_OBJECT_NAME (pad)) : "''"
208
209 /**
210  * GST_FUNCTION:
211  *
212  * This macro should evaluate to the name of the current function and be should
213  * be defined when configuring your project, as it is compiler dependant. If it
214  * is not defined, some default value is used. It is used to provide debugging
215  * output with the function name of the message.
216  *
217  * Note that this is different from G_STRFUNC as we do not want the full
218  * function signature in C++ code.
219  */
220 #ifndef GST_FUNCTION
221 #if defined (__GNUC__) || (defined (_MSC_VER) && _MSC_VER >= 1300)
222 #  define GST_FUNCTION     ((const char*) (__FUNCTION__))
223 #elif defined (__STDC__) && defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
224 #  define GST_FUNCTION     ((const char*) (__func__))
225 #else
226 #  define GST_FUNCTION     ((const char*) ("???"))
227 #endif
228 #endif /* ifndef GST_FUNCTION */
229
230
231 typedef struct _GstDebugMessage GstDebugMessage;
232
233 /**
234  * GstLogFunction:
235  * @category: a #GstDebugCategory
236  * @level: a #GstDebugLevel
237  * @file: file name
238  * @function: function name
239  * @line: line number
240  * @object: a #GObject
241  * @message: the message
242  * @data: user data for the log function
243  *
244  * Function prototype for a logging function that can be registered with
245  * gst_debug_add_log_function().
246  * Use G_GNUC_NO_INSTRUMENT on that function.
247  */
248 typedef void (*GstLogFunction)  (GstDebugCategory * category,
249                                  GstDebugLevel      level,
250                                  const gchar      * file,
251                                  const gchar      * function,
252                                  gint               line,
253                                  GObject          * object,
254                                  GstDebugMessage  * message,
255                                  gpointer           data);
256
257 #ifndef GST_DISABLE_GST_DEBUG
258
259 /* FIXME 0.11: move this into private headers */
260 void            _gst_debug_init (void);
261
262
263 #ifdef GST_USING_PRINTF_EXTENSION
264
265 /* not using G_GNUC_PRINTF, since gcc will choke on GST_PTR_FORMAT being %P */
266 void                gst_debug_log            (GstDebugCategory * category,
267                                           GstDebugLevel      level,
268                                           const gchar      * file,
269                                           const gchar      * function,
270                                           gint               line,
271                                           GObject          * object,
272                                           const gchar      * format,
273                                           ...) G_GNUC_NO_INSTRUMENT;
274
275 #else /* GST_USING_PRINTF_EXTENSION */
276
277 void                gst_debug_log            (GstDebugCategory * category,
278                                           GstDebugLevel      level,
279                                           const gchar      * file,
280                                           const gchar      * function,
281                                           gint               line,
282                                           GObject          * object,
283                                           const gchar      * format,
284                                           ...) G_GNUC_PRINTF (7, 8) G_GNUC_NO_INSTRUMENT;
285
286 #endif /* GST_USING_PRINTF_EXTENSION */
287
288 void            gst_debug_log_valist     (GstDebugCategory * category,
289                                           GstDebugLevel      level,
290                                           const gchar      * file,
291                                           const gchar      * function,
292                                           gint                line,
293                                           GObject          * object,
294                                           const gchar      * format,
295                                           va_list            args) G_GNUC_NO_INSTRUMENT;
296
297 const gchar   * gst_debug_message_get    (GstDebugMessage  * message);
298
299 void            gst_debug_log_default    (GstDebugCategory * category,
300                                           GstDebugLevel      level,
301                                           const gchar      * file,
302                                           const gchar      * function,
303                                           gint               line,
304                                           GObject          * object,
305                                           GstDebugMessage  * message,
306                                           gpointer           unused) G_GNUC_NO_INSTRUMENT;
307
308 G_CONST_RETURN gchar *
309                 gst_debug_level_get_name (GstDebugLevel level);
310
311 void            gst_debug_add_log_function            (GstLogFunction func,
312                                                        gpointer       data);
313 guint           gst_debug_remove_log_function         (GstLogFunction func);
314 guint           gst_debug_remove_log_function_by_data (gpointer       data);
315
316 void            gst_debug_set_active  (gboolean active);
317 gboolean        gst_debug_is_active   (void);
318
319 void            gst_debug_set_colored (gboolean colored);
320 gboolean        gst_debug_is_colored  (void);
321
322 void            gst_debug_set_default_threshold     (GstDebugLevel level);
323 GstDebugLevel   gst_debug_get_default_threshold     (void);
324 void            gst_debug_set_threshold_for_name    (const gchar * name,
325                                                      GstDebugLevel level);
326 void            gst_debug_unset_threshold_for_name  (const gchar * name);
327
328 /**
329  * GST_DEBUG_CATEGORY:
330  * @cat: the category
331  *
332  * Defines a GstDebugCategory variable.
333  * This macro expands to nothing if debugging is disabled.
334  */
335 #define GST_DEBUG_CATEGORY(cat) GstDebugCategory *cat = NULL
336 /**
337  * GST_DEBUG_CATEGORY_EXTERN:
338  * @cat: the category
339  *
340  * Declares a GstDebugCategory variable as extern. Use in header files.
341  * This macro expands to nothing if debugging is disabled.
342  */
343 #define GST_DEBUG_CATEGORY_EXTERN(cat) extern GstDebugCategory *cat
344
345 /**
346  * GST_DEBUG_CATEGORY_STATIC:
347  * @cat: the category
348  *
349  * Defines a static GstDebugCategory variable.
350  * This macro expands to nothing if debugging is disabled.
351  */
352 #define GST_DEBUG_CATEGORY_STATIC(cat) static GstDebugCategory *cat = NULL
353
354 /* do not use this function, use the GST_DEBUG_CATEGORY_INIT macro below */
355 GstDebugCategory *_gst_debug_category_new (const gchar * name,
356                                            guint         color,
357                                            const gchar * description);
358 /**
359  * GST_DEBUG_CATEGORY_INIT:
360  * @cat: the category to initialize.
361  * @name: the name of the category.
362  * @color: the colors to use for a color representation or 0 for no color.
363  * @description: optional description of the category.
364  *
365  * Initializes a new #GstDebugCategory with the given properties and set to
366  * the default threshold.
367  *
368  * <note>
369  * <para>
370  * This macro expands to nothing if debugging is disabled.
371  * </para>
372  * <para>
373  * When naming your category, please follow the following conventions to ensure
374  * that the pattern matching for categories works as expected. It is not
375  * earth-shattering if you don't follow these conventions, but it would be nice
376  * for everyone.
377  * </para>
378  * <para>
379  * If you define a category for a plugin or a feature of it, name the category
380  * like the feature. So if you wanted to write a "filesrc" element, you would
381  * name the category "filesrc". Use lowercase letters only.
382  * If you define more than one category for the same element, append an
383  * underscore and an identifier to your categories, like this: "filesrc_cache"
384  * </para>
385  * <para>
386  * If you create a library or an application using debugging categories, use a
387  * common prefix followed by an underscore for all your categories. GStreamer
388  * uses the GST prefix so GStreamer categories look like "GST_STATES". Be sure
389  * to include uppercase letters.
390  * </para>
391  * </note>
392  */
393 #define GST_DEBUG_CATEGORY_INIT(cat,name,color,description) G_STMT_START{\
394   if (cat == NULL)                                                      \
395     cat = _gst_debug_category_new (name,color,description);             \
396 }G_STMT_END
397
398 void    gst_debug_category_free         (GstDebugCategory *     category);
399 void    gst_debug_category_set_threshold (GstDebugCategory *    category,
400                                          GstDebugLevel          level);
401 void    gst_debug_category_reset_threshold(GstDebugCategory *   category);
402 GstDebugLevel
403         gst_debug_category_get_threshold (GstDebugCategory *    category);
404 G_CONST_RETURN gchar *
405         gst_debug_category_get_name     (GstDebugCategory *     category);
406 guint   gst_debug_category_get_color    (GstDebugCategory *     category);
407 G_CONST_RETURN gchar *
408         gst_debug_category_get_description (GstDebugCategory *  category);
409 GSList *
410         gst_debug_get_all_categories    (void);
411
412 /* do not use this function, use the GST_DEBUG_CATEGORY_GET macro below */
413 GstDebugCategory *_gst_debug_get_category (const gchar *name);
414
415 /**
416  * GST_DEBUG_CATEGORY_GET:
417  * @cat: the category to initialize.
418  * @name: log category name
419  *
420  * Lookup an exiting #GstDebugCategory by its @name and sets @cat. If category
421  * is not found, but %GST_CAT_DEFAULT is defined, that is assigned to @cat.
422  * Otherwise cat will be NULL.
423  *
424  * |[
425  * GST_DEBUG_CATEGORY_STATIC (gst_myplugin_debug);
426  * #define GST_CAT_DEFAULT gst_myplugin_debug
427  * GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE);
428  * ...
429  * GST_DEBUG_CATEGORY_INIT (gst_myplugin_debug, "myplugin", 0, "nice element");
430  * GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "performance);
431  * ]|
432  */
433 #ifdef GST_CAT_DEFAULT
434 #define GST_DEBUG_CATEGORY_GET(cat,name)  G_STMT_START{\
435   cat = _gst_debug_get_category (name);                 \
436   if (!cat) {                                           \
437     cat = GST_CAT_DEFAULT;                              \
438   }                                                     \
439 }G_STMT_END
440 #else
441 #define GST_DEBUG_CATEGORY_GET(cat,name)  G_STMT_START{\
442   cat = _gst_debug_get_category (name);                 \
443 }G_STMT_END
444 #endif
445
446
447 gchar * gst_debug_construct_term_color  (guint colorinfo);
448 gint    gst_debug_construct_win_color (guint colorinfo);
449
450
451 /**
452  * GST_CAT_DEFAULT:
453  *
454  * Default gstreamer core debug log category. Please define your own.
455  */
456 GST_EXPORT GstDebugCategory *   GST_CAT_DEFAULT;
457 /* this symbol may not be used */
458 extern gboolean                 __gst_debug_enabled;
459
460 /* since 0.10.7, the min debug level, used for quickly discarding debug
461  * messages that fall under the threshold. */
462 GST_EXPORT GstDebugLevel            __gst_debug_min; 
463
464 /**
465  * GST_CAT_LEVEL_LOG:
466  * @cat: category to use
467  * @level: the severity of the message
468  * @object: the #GObject the message belongs to or NULL if none
469  * @...: A printf-style message to output
470  *
471  * Outputs a debugging message. This is the most general macro for outputting
472  * debugging messages. You will probably want to use one of the ones described
473  * below.
474  */
475 #ifdef G_HAVE_ISO_VARARGS
476 #define GST_CAT_LEVEL_LOG(cat,level,object,...) G_STMT_START{           \
477   if (G_UNLIKELY (level <= __gst_debug_min)) {                                          \
478     gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__,    \
479         (GObject *) (object), __VA_ARGS__);                             \
480   }                                                                     \
481 }G_STMT_END
482 #else /* G_HAVE_GNUC_VARARGS */
483 #ifdef G_HAVE_GNUC_VARARGS
484 #define GST_CAT_LEVEL_LOG(cat,level,object,args...) G_STMT_START{       \
485   if (G_UNLIKELY (level <= __gst_debug_min)) {                                          \
486     gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__,    \
487         (GObject *) (object), ##args );                                 \
488   }                                                                     \
489 }G_STMT_END
490 #else /* no variadic macros, use inline */
491 static inline void
492 GST_CAT_LEVEL_LOG_valist (GstDebugCategory * cat,
493     GstDebugLevel level, gpointer object, const char *format, va_list varargs)
494 {
495   if (G_UNLIKELY (level <= __gst_debug_min)) {
496     gst_debug_log_valist (cat, level, "", "", 0, (GObject *) object, format,
497         varargs);
498   }
499 }
500
501 static inline void
502 GST_CAT_LEVEL_LOG (GstDebugCategory * cat, GstDebugLevel level,
503     gpointer object, const char *format, ...)
504 {
505   va_list varargs;
506
507   va_start (varargs, format);
508   GST_CAT_LEVEL_LOG_valist (cat, level, object, format, varargs);
509   va_end (varargs);
510 }
511 #endif
512 #endif /* G_HAVE_ISO_VARARGS */
513
514 /* private helper function */
515 void _gst_debug_dump_mem (GstDebugCategory * cat, const gchar * file,
516     const gchar * func, gint line, GObject * obj, const gchar * msg,
517     const guint8 * data, guint length);
518
519 /* This one doesn't have varargs in the macro, so it's different than all the
520  * other macros and hence in a separate block right here. Docs chunks are
521  * with the other doc chunks below though. */
522 #define __GST_CAT_MEMDUMP_LOG(cat,object,msg,data,length) G_STMT_START{       \
523   if (G_UNLIKELY (GST_LEVEL_MEMDUMP <= __gst_debug_min)) {                    \
524     _gst_debug_dump_mem ((cat), __FILE__, GST_FUNCTION, __LINE__,             \
525         (GObject *) (object), (msg), (data), (length));                       \
526   }                                                                           \
527 }G_STMT_END
528
529 #define GST_CAT_MEMDUMP_OBJECT(cat,obj,msg,data,length)  \
530     __GST_CAT_MEMDUMP_LOG(cat,obj,msg,data,length)
531 #define GST_CAT_MEMDUMP(cat,msg,data,length)             \
532     __GST_CAT_MEMDUMP_LOG(cat,NULL,msg,data,length)
533 #define GST_MEMDUMP_OBJECT(obj,msg,data,length)          \
534     __GST_CAT_MEMDUMP_LOG(GST_CAT_DEFAULT,obj,msg,data,length)
535 #define GST_MEMDUMP(msg,data,length)                     \
536     __GST_CAT_MEMDUMP_LOG(GST_CAT_DEFAULT,NULL,msg,data,length)
537
538 /**
539  * GST_CAT_ERROR_OBJECT:
540  * @cat: category to use
541  * @obj: the #GObject the message belongs to
542  * @...: printf-style message to output
543  *
544  * Output an error message belonging to the given object in the given category.
545  */
546 /**
547  * GST_CAT_WARNING_OBJECT:
548  * @cat: category to use
549  * @obj: the #GObject the message belongs to
550  * @...: printf-style message to output
551  *
552  * Output a warning message belonging to the given object in the given category.
553  */
554 /**
555  * GST_CAT_INFO_OBJECT:
556  * @cat: category to use
557  * @obj: the #GObject the message belongs to
558  * @...: printf-style message to output
559  *
560  * Output an informational message belonging to the given object in the given
561  * category.
562  */
563 /**
564  * GST_CAT_DEBUG_OBJECT:
565  * @cat: category to use
566  * @obj: the #GObject the message belongs to
567  * @...: printf-style message to output
568  *
569  * Output an debugging message belonging to the given object in the given category.
570  */
571 /**
572  * GST_CAT_LOG_OBJECT:
573  * @cat: category to use
574  * @obj: the #GObject the message belongs to
575  * @...: printf-style message to output
576  *
577  * Output an logging message belonging to the given object in the given category.
578  */
579 /**
580  * GST_CAT_FIXME_OBJECT:
581  * @cat: category to use
582  * @obj: the #GObject the message belongs to
583  * @...: printf-style message to output
584  *
585  * Output a fixme message belonging to the given object in the given category.
586  *
587  * Since: 0.10.23
588  */
589 /**
590  * GST_CAT_MEMDUMP_OBJECT:
591  * @cat: category to use
592  * @obj: the #GObject the message belongs to
593  * @msg: message string to log with the data
594  * @data: pointer to the data to output
595  * @length: length of the data to output
596  *
597  * Output a hexdump of @data relating to the given object in the given
598  * category.
599  *
600  * Since: 0.10.23
601  */
602
603
604 /**
605  * GST_CAT_ERROR:
606  * @cat: category to use
607  * @...: printf-style message to output
608  *
609  * Output an error message in the given category.
610  */
611 /**
612  * GST_CAT_WARNING:
613  * @cat: category to use
614  * @...: printf-style message to output
615  *
616  * Output an warning message in the given category.
617  */
618 /**
619  * GST_CAT_INFO:
620  * @cat: category to use
621  * @...: printf-style message to output
622  *
623  * Output an informational message in the given category.
624  */
625 /**
626  * GST_CAT_DEBUG:
627  * @cat: category to use
628  * @...: printf-style message to output
629  *
630  * Output an debugging message in the given category.
631  */
632 /**
633  * GST_CAT_LOG:
634  * @cat: category to use
635  * @...: printf-style message to output
636  *
637  * Output an logging message in the given category.
638  */
639 /**
640  * GST_CAT_FIXME:
641  * @cat: category to use
642  * @...: printf-style message to output
643  *
644  * Output an fixme message in the given category.
645  *
646  * Since: 0.10.23
647  */
648 /**
649  * GST_CAT_MEMDUMP:
650  * @cat: category to use
651  * @msg: message string to log with the data
652  * @data: pointer to the data to output
653  * @length: length of the data to output
654  *
655  * Output a hexdump of @data in the given category.
656  *
657  * Since: 0.10.23
658  */
659
660
661 /**
662  * GST_ERROR_OBJECT:
663  * @obj: the #GObject the message belongs to
664  * @...: printf-style message to output
665  *
666  * Output an error message belonging to the given object in the default category.
667  */
668 /**
669  * GST_WARNING_OBJECT:
670  * @obj: the #GObject the message belongs to
671  * @...: printf-style message to output
672  *
673  * Output a warning message belonging to the given object in the default category.
674  */
675 /**
676  * GST_INFO_OBJECT:
677  * @obj: the #GObject the message belongs to
678  * @...: printf-style message to output
679  *
680  * Output an informational message belonging to the given object in the default
681  * category.
682  */
683 /**
684  * GST_DEBUG_OBJECT:
685  * @obj: the #GObject the message belongs to
686  * @...: printf-style message to output
687  *
688  * Output a debugging message belonging to the given object in the default
689  * category.
690  */
691 /**
692  * GST_LOG_OBJECT:
693  * @obj: the #GObject the message belongs to
694  * @...: printf-style message to output
695  *
696  * Output a logging message belonging to the given object in the default category.
697  */
698 /**
699  * GST_FIXME_OBJECT:
700  * @obj: the #GObject the message belongs to
701  * @...: printf-style message to output
702  *
703  * Output a logging message belonging to the given object in the default category.
704  *
705  * Since: 0.10.23
706  */
707 /**
708  * GST_MEMDUMP_OBJECT:
709  * @obj: the #GObject the message belongs to
710  * @msg: message string to log with the data
711  * @data: pointer to the data to output
712  * @length: length of the data to output
713  *
714  * Output a logging message belonging to the given object in the default category.
715  *
716  * Since: 0.10.23
717  */
718
719
720 /**
721  * GST_ERROR:
722  * @...: printf-style message to output
723  *
724  * Output an error message in the default category.
725  */
726 /**
727  * GST_WARNING:
728  * @...: printf-style message to output
729  *
730  * Output a warning message in the default category.
731  */
732 /**
733  * GST_INFO:
734  * @...: printf-style message to output
735  *
736  * Output an informational message in the default category.
737  */
738 /**
739  * GST_DEBUG:
740  * @...: printf-style message to output
741  *
742  * Output a debugging message in the default category.
743  */
744 /**
745  * GST_LOG:
746  * @...: printf-style message to output
747  *
748  * Output a logging message in the default category.
749  */
750 /**
751  * GST_FIXME:
752  * @...: printf-style message to output
753  *
754  * Output a fixme message in the default category.
755  *
756  * Since: 0.10.23
757  */
758 /**
759  * GST_MEMDUMP:
760  * @msg: message string to log with the data
761  * @data: pointer to the data to output
762  * @length: length of the data to output
763  *
764  * Output a hexdump of @data.
765  *
766  * Since: 0.10.23
767  */
768
769 #ifdef G_HAVE_ISO_VARARGS
770
771 #define GST_CAT_ERROR_OBJECT(cat,obj,...)       GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR,   obj,  __VA_ARGS__)
772 #define GST_CAT_WARNING_OBJECT(cat,obj,...)     GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, obj,  __VA_ARGS__)
773 #define GST_CAT_INFO_OBJECT(cat,obj,...)        GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO,    obj,  __VA_ARGS__)
774 #define GST_CAT_DEBUG_OBJECT(cat,obj,...)       GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG,   obj,  __VA_ARGS__)
775 #define GST_CAT_LOG_OBJECT(cat,obj,...)         GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG,     obj,  __VA_ARGS__)
776 #define GST_CAT_FIXME_OBJECT(cat,obj,...)       GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME,   obj,  __VA_ARGS__)
777
778 #define GST_CAT_ERROR(cat,...)                  GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR,   NULL, __VA_ARGS__)
779 #define GST_CAT_WARNING(cat,...)                GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
780 #define GST_CAT_INFO(cat,...)                   GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO,    NULL, __VA_ARGS__)
781 #define GST_CAT_DEBUG(cat,...)                  GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG,   NULL, __VA_ARGS__)
782 #define GST_CAT_LOG(cat,...)                    GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG,     NULL, __VA_ARGS__)
783 #define GST_CAT_FIXME(cat,...)                  GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME,   NULL, __VA_ARGS__)
784
785 #define GST_ERROR_OBJECT(obj,...)       GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR,   obj,  __VA_ARGS__)
786 #define GST_WARNING_OBJECT(obj,...)     GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj,  __VA_ARGS__)
787 #define GST_INFO_OBJECT(obj,...)        GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO,    obj,  __VA_ARGS__)
788 #define GST_DEBUG_OBJECT(obj,...)       GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   obj,  __VA_ARGS__)
789 #define GST_LOG_OBJECT(obj,...)         GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG,     obj,  __VA_ARGS__)
790 #define GST_FIXME_OBJECT(obj,...)       GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME,   obj,  __VA_ARGS__)
791
792 #define GST_ERROR(...)                  GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR,   NULL, __VA_ARGS__)
793 #define GST_WARNING(...)                GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
794 #define GST_INFO(...)                   GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO,    NULL, __VA_ARGS__)
795 #define GST_DEBUG(...)                  GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   NULL, __VA_ARGS__)
796 #define GST_LOG(...)                    GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG,     NULL, __VA_ARGS__)
797 #define GST_FIXME(...)                  GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME,   NULL, __VA_ARGS__)
798
799 #else
800 #ifdef G_HAVE_GNUC_VARARGS
801
802 #define GST_CAT_ERROR_OBJECT(cat,obj,args...)   GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR,   obj,  ##args )
803 #define GST_CAT_WARNING_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, obj,  ##args )
804 #define GST_CAT_INFO_OBJECT(cat,obj,args...)    GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO,    obj,  ##args )
805 #define GST_CAT_DEBUG_OBJECT(cat,obj,args...)   GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG,   obj,  ##args )
806 #define GST_CAT_LOG_OBJECT(cat,obj,args...)     GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG,     obj,  ##args )
807 #define GST_CAT_FIXME_OBJECT(cat,obj,args...)   GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME,   obj,  ##args )
808
809 #define GST_CAT_ERROR(cat,args...)              GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR,   NULL, ##args )
810 #define GST_CAT_WARNING(cat,args...)            GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, NULL, ##args )
811 #define GST_CAT_INFO(cat,args...)               GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO,    NULL, ##args )
812 #define GST_CAT_DEBUG(cat,args...)              GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG,   NULL, ##args )
813 #define GST_CAT_LOG(cat,args...)                GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG,     NULL, ##args )
814 #define GST_CAT_FIXME(cat,args...)              GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME,   NULL, ##args )
815
816 #define GST_ERROR_OBJECT(obj,args...)   GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR,   obj,  ##args )
817 #define GST_WARNING_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj,  ##args )
818 #define GST_INFO_OBJECT(obj,args...)    GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO,    obj,  ##args )
819 #define GST_DEBUG_OBJECT(obj,args...)   GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   obj,  ##args )
820 #define GST_LOG_OBJECT(obj,args...)     GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG,     obj,  ##args )
821 #define GST_FIXME_OBJECT(obj,args...)   GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME,   obj,  ##args )
822
823 #define GST_ERROR(args...)              GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR,   NULL, ##args )
824 #define GST_WARNING(args...)            GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, ##args )
825 #define GST_INFO(args...)               GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO,    NULL, ##args )
826 #define GST_DEBUG(args...)              GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   NULL, ##args )
827 #define GST_LOG(args...)                GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG,     NULL, ##args )
828 #define GST_FIXME(args...)              GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME,   NULL, ##args )
829
830 #else
831 /* no variadic macros, use inline */
832 static inline void
833 GST_CAT_ERROR_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
834     ...)
835 {
836   va_list varargs;
837
838   va_start (varargs, format);
839   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_ERROR, obj, format, varargs);
840   va_end (varargs);
841 }
842
843 static inline void
844 GST_CAT_WARNING_OBJECT (GstDebugCategory * cat, gpointer obj,
845     const char *format, ...)
846 {
847   va_list varargs;
848
849   va_start (varargs, format);
850   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_WARNING, obj, format, varargs);
851   va_end (varargs);
852 }
853
854 static inline void
855 GST_CAT_INFO_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
856     ...)
857 {
858   va_list varargs;
859
860   va_start (varargs, format);
861   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_INFO, obj, format, varargs);
862   va_end (varargs);
863 }
864
865 static inline void
866 GST_CAT_DEBUG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
867     ...)
868 {
869   va_list varargs;
870
871   va_start (varargs, format);
872   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_DEBUG, obj, format, varargs);
873   va_end (varargs);
874 }
875
876 static inline void
877 GST_CAT_LOG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
878     ...)
879 {
880   va_list varargs;
881
882   va_start (varargs, format);
883   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_LOG, obj, format, varargs);
884   va_end (varargs);
885 }
886
887 static inline void
888 GST_CAT_FIXME_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
889     ...)
890 {
891   va_list varargs;
892
893   va_start (varargs, format);
894   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_FIXME, obj, format, varargs);
895   va_end (varargs);
896 }
897
898 static inline void
899 GST_CAT_ERROR (GstDebugCategory * cat, const char *format, ...)
900 {
901   va_list varargs;
902
903   va_start (varargs, format);
904   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_ERROR, NULL, format, varargs);
905   va_end (varargs);
906 }
907
908 static inline void
909 GST_CAT_WARNING (GstDebugCategory * cat, const char *format, ...)
910 {
911   va_list varargs;
912
913   va_start (varargs, format);
914   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_WARNING, NULL, format, varargs);
915   va_end (varargs);
916 }
917
918 static inline void
919 GST_CAT_INFO (GstDebugCategory * cat, const char *format, ...)
920 {
921   va_list varargs;
922
923   va_start (varargs, format);
924   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_INFO, NULL, format, varargs);
925   va_end (varargs);
926 }
927
928 static inline void
929 GST_CAT_DEBUG (GstDebugCategory * cat, const char *format, ...)
930 {
931   va_list varargs;
932
933   va_start (varargs, format);
934   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_DEBUG, NULL, format, varargs);
935   va_end (varargs);
936 }
937
938 static inline void
939 GST_CAT_LOG (GstDebugCategory * cat, const char *format, ...)
940 {
941   va_list varargs;
942
943   va_start (varargs, format);
944   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_LOG, NULL, format, varargs);
945   va_end (varargs);
946 }
947
948 static inline void
949 GST_CAT_FIXME (GstDebugCategory * cat, const char *format, ...)
950 {
951   va_list varargs;
952
953   va_start (varargs, format);
954   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_FIXME, NULL, format, varargs);
955   va_end (varargs);
956 }
957
958 static inline void
959 GST_ERROR_OBJECT (gpointer obj, const char *format, ...)
960 {
961   va_list varargs;
962
963   va_start (varargs, format);
964   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_ERROR, obj, format,
965       varargs);
966   va_end (varargs);
967 }
968
969 static inline void
970 GST_WARNING_OBJECT (gpointer obj, const char *format, ...)
971 {
972   va_list varargs;
973
974   va_start (varargs, format);
975   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj, format,
976       varargs);
977   va_end (varargs);
978 }
979
980 static inline void
981 GST_INFO_OBJECT (gpointer obj, const char *format, ...)
982 {
983   va_list varargs;
984
985   va_start (varargs, format);
986   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_INFO, obj, format,
987       varargs);
988   va_end (varargs);
989 }
990
991 static inline void
992 GST_DEBUG_OBJECT (gpointer obj, const char *format, ...)
993 {
994   va_list varargs;
995
996   va_start (varargs, format);
997   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, obj, format,
998       varargs);
999   va_end (varargs);
1000 }
1001
1002 static inline void
1003 GST_LOG_OBJECT (gpointer obj, const char *format, ...)
1004 {
1005   va_list varargs;
1006
1007   va_start (varargs, format);
1008   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_LOG, obj, format,
1009       varargs);
1010   va_end (varargs);
1011 }
1012
1013 static inline void
1014 GST_FIXME_OBJECT (gpointer obj, const char *format, ...)
1015 {
1016   va_list varargs;
1017
1018   va_start (varargs, format);
1019   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_FIXME, obj, format,
1020       varargs);
1021   va_end (varargs);
1022 }
1023
1024 static inline void
1025 GST_ERROR (const char *format, ...)
1026 {
1027   va_list varargs;
1028
1029   va_start (varargs, format);
1030   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_ERROR, NULL, format,
1031       varargs);
1032   va_end (varargs);
1033 }
1034
1035 static inline void
1036 GST_WARNING (const char *format, ...)
1037 {
1038   va_list varargs;
1039
1040   va_start (varargs, format);
1041   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, format,
1042       varargs);
1043   va_end (varargs);
1044 }
1045
1046 static inline void
1047 GST_INFO (const char *format, ...)
1048 {
1049   va_list varargs;
1050
1051   va_start (varargs, format);
1052   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, format,
1053       varargs);
1054   va_end (varargs);
1055 }
1056
1057 static inline void
1058 GST_DEBUG (const char *format, ...)
1059 {
1060   va_list varargs;
1061
1062   va_start (varargs, format);
1063   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, format,
1064       varargs);
1065   va_end (varargs);
1066 }
1067
1068 static inline void
1069 GST_LOG (const char *format, ...)
1070 {
1071   va_list varargs;
1072
1073   va_start (varargs, format);
1074   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_LOG, NULL,
1075       format, varargs);
1076   va_end (varargs);
1077 }
1078
1079 static inline void
1080 GST_FIXME (const char *format, ...)
1081 {
1082   va_list varargs;
1083
1084   va_start (varargs, format);
1085   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_FIXME, NULL, format,
1086       varargs);
1087   va_end (varargs);
1088 }
1089 #endif
1090 #endif
1091
1092
1093 /********** function pointer stuff **********/
1094
1095 typedef void (* GstDebugFuncPtr)        (void);
1096 void    _gst_debug_register_funcptr     (GstDebugFuncPtr        func,
1097                                          const gchar *          ptrname);
1098 G_CONST_RETURN gchar *
1099         _gst_debug_nameof_funcptr       (GstDebugFuncPtr        func);
1100
1101 /**
1102  * GST_DEBUG_FUNCPTR:
1103  * @ptr: pointer to the function to register
1104  *
1105  * Register a pointer to a function with its name, so it can later be used by
1106  * GST_DEBUG_FUNCPTR_NAME().
1107  */
1108 #define GST_DEBUG_FUNCPTR(ptr) \
1109   (_gst_debug_register_funcptr((GstDebugFuncPtr)(ptr), #ptr) , ptr)
1110
1111 /**
1112  * GST_DEBUG_FUNCPTR_NAME:
1113  * @ptr: address of the function of which to look up the name
1114  *
1115  * Retrieves the name of the function, if it was previously registered with
1116  * GST_DEBUG_FUNCPTR(). If not, it returns a description of the pointer.
1117  *
1118  * This macro returns a constant string which must not be modified or
1119  * freed by the caller.
1120  */
1121 #define GST_DEBUG_FUNCPTR_NAME(ptr) \
1122   _gst_debug_nameof_funcptr((GstDebugFuncPtr)ptr)
1123
1124
1125 #else /* GST_DISABLE_GST_DEBUG */
1126
1127
1128 #ifndef GST_INFO_C
1129
1130 #if defined(__GNUC__) && __GNUC__ >= 3
1131 #  pragma GCC poison gst_debug_log
1132 #  pragma GCC poison gst_debug_log_valist
1133 #  pragma GCC poison _gst_debug_category_new
1134 #endif
1135
1136 #define __gst_debug_min GST_LEVEL_NONE
1137
1138 #define _gst_debug_init()                               /* NOP */
1139
1140 #define gst_debug_set_default_threshold(level)          /* NOP */
1141 #define gst_debug_get_default_threshold()               (GST_LEVEL_NONE)
1142
1143 #define gst_debug_level_get_name(level)                         ("NONE")
1144 #define gst_debug_message_get(message)                          ("")
1145 #define gst_debug_add_log_function(func,data)           /* NOP */
1146 guint gst_debug_remove_log_function (GstLogFunction func);
1147 guint gst_debug_remove_log_function_by_data (gpointer data);
1148 #define gst_debug_set_active(active)                    /* NOP */
1149 #define gst_debug_is_active()                           (FALSE)
1150 #define gst_debug_set_colored(colored)                  /* NOP */
1151 #define gst_debug_is_colored()                          (FALSE)
1152 #define gst_debug_set_default_threshold(level)          /* NOP */
1153 #define gst_debug_get_default_threshold()               (GST_LEVEL_NONE)
1154 #define gst_debug_set_threshold_for_name(name,level)    /* NOP */
1155 #define gst_debug_unset_threshold_for_name(name)        /* NOP */
1156
1157 #define GST_DEBUG_CATEGORY(var)                         /* NOP */
1158 #define GST_DEBUG_CATEGORY_EXTERN(var)                  /* NOP */
1159 #if !defined(G_HAVE_GNUC_VARARGS) && !defined(G_HAVE_ISO_VARARGS)
1160 #define GST_DEBUG_CATEGORY_STATIC(var)                  static GstDebugCategory *var = NULL
1161 #else
1162 #define GST_DEBUG_CATEGORY_STATIC(var)                  /* NOP */
1163 #endif
1164 #define GST_DEBUG_CATEGORY_INIT(var,name,color,desc)    /* NOP */
1165 #define GST_DEBUG_CATEGORY_GET(var,name)                /* NOP */
1166 #define gst_debug_category_free(category)               /* NOP */
1167 #define gst_debug_category_set_threshold(category,level) /* NOP */
1168 #define gst_debug_category_reset_threshold(category)    /* NOP */
1169 #define gst_debug_category_get_threshold(category)      (GST_LEVEL_NONE)
1170 #define gst_debug_category_get_name(cat)                ("")
1171 #define gst_debug_category_get_color(cat)               (0)
1172 #define gst_debug_category_get_description(cat)         ("")
1173 #define gst_debug_get_all_categories()                  (NULL)
1174 #define gst_debug_construct_term_color(colorinfo)       (g_strdup ("00"))
1175 #define gst_debug_construct_win_color(colorinfo)        (0)
1176
1177 #endif /* !GST_INFO_C */
1178
1179 #ifdef G_HAVE_ISO_VARARGS
1180
1181 #define GST_CAT_LEVEL_LOG(cat,level,...)                /* NOP */
1182
1183 #define GST_CAT_ERROR_OBJECT(...)                       /* NOP */
1184 #define GST_CAT_WARNING_OBJECT(...)                     /* NOP */
1185 #define GST_CAT_INFO_OBJECT(...)                        /* NOP */
1186 #define GST_CAT_DEBUG_OBJECT(...)                       /* NOP */
1187 #define GST_CAT_LOG_OBJECT(...)                         /* NOP */
1188 #define GST_CAT_FIXME_OBJECT(...)                       /* NOP */
1189
1190 #define GST_CAT_ERROR(...)                              /* NOP */
1191 #define GST_CAT_WARNING(...)                            /* NOP */
1192 #define GST_CAT_INFO(...)                               /* NOP */
1193 #define GST_CAT_DEBUG(...)                              /* NOP */
1194 #define GST_CAT_LOG(...)                                /* NOP */
1195 #define GST_CAT_FIXME(...)                              /* NOP */
1196
1197 #define GST_ERROR_OBJECT(...)                           /* NOP */
1198 #define GST_WARNING_OBJECT(...)                         /* NOP */
1199 #define GST_INFO_OBJECT(...)                            /* NOP */
1200 #define GST_DEBUG_OBJECT(...)                           /* NOP */
1201 #define GST_LOG_OBJECT(...)                             /* NOP */
1202 #define GST_FIXME_OBJECT(...)                           /* NOP */
1203
1204 #define GST_ERROR(...)                                  /* NOP */
1205 #define GST_WARNING(...)                                /* NOP */
1206 #define GST_INFO(...)                                   /* NOP */
1207 #define GST_DEBUG(...)                                  /* NOP */
1208 #define GST_LOG(...)                                    /* NOP */
1209 #define GST_FIXME(...)                                  /* NOP */
1210
1211 #else /* !G_HAVE_ISO_VARARGS */
1212 #ifdef G_HAVE_GNUC_VARARGS
1213
1214 #define GST_CAT_LEVEL_LOG(cat,level,args...)            /* NOP */
1215
1216 #define GST_CAT_ERROR_OBJECT(args...)                   /* NOP */
1217 #define GST_CAT_WARNING_OBJECT(args...)                 /* NOP */
1218 #define GST_CAT_INFO_OBJECT(args...)                    /* NOP */
1219 #define GST_CAT_DEBUG_OBJECT(args...)                   /* NOP */
1220 #define GST_CAT_LOG_OBJECT(args...)                     /* NOP */
1221 #define GST_CAT_FIXME_OBJECT(args...)                   /* NOP */
1222
1223 #define GST_CAT_ERROR(args...)                          /* NOP */
1224 #define GST_CAT_WARNING(args...)                        /* NOP */
1225 #define GST_CAT_INFO(args...)                           /* NOP */
1226 #define GST_CAT_DEBUG(args...)                          /* NOP */
1227 #define GST_CAT_LOG(args...)                            /* NOP */
1228 #define GST_CAT_FIXME(args...)                          /* NOP */
1229
1230 #define GST_ERROR_OBJECT(args...)                       /* NOP */
1231 #define GST_WARNING_OBJECT(args...)                     /* NOP */
1232 #define GST_INFO_OBJECT(args...)                        /* NOP */
1233 #define GST_DEBUG_OBJECT(args...)                       /* NOP */
1234 #define GST_LOG_OBJECT(args...)                         /* NOP */
1235 #define GST_FIXME_OBJECT(args...)                       /* NOP */
1236
1237 #define GST_ERROR(args...)                              /* NOP */
1238 #define GST_WARNING(args...)                            /* NOP */
1239 #define GST_INFO(args...)                               /* NOP */
1240 #define GST_DEBUG(args...)                              /* NOP */
1241 #define GST_LOG(args...)                                /* NOP */
1242 #define GST_FIXME(args...)                              /* NOP */
1243
1244 #else /* !G_HAVE_GNUC_VARARGS */
1245 static inline void
1246 GST_CAT_LEVEL_LOG_valist (GstDebugCategory * cat,
1247     GstDebugLevel level, gpointer object, const char *format, va_list varargs)
1248 {
1249 }
1250
1251 static inline void
1252 GST_CAT_ERROR_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1253     ...)
1254 {
1255 }
1256
1257 static inline void
1258 GST_CAT_WARNING_OBJECT (GstDebugCategory * cat, gpointer obj,
1259     const char *format, ...)
1260 {
1261 }
1262
1263 static inline void
1264 GST_CAT_INFO_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1265     ...)
1266 {
1267 }
1268
1269 static inline void
1270 GST_CAT_DEBUG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1271     ...)
1272 {
1273 }
1274
1275 static inline void
1276 GST_CAT_LOG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1277     ...)
1278 {
1279 }
1280
1281 static inline void
1282 GST_CAT_FIXME_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1283     ...)
1284 {
1285 }
1286
1287 static inline void
1288 GST_CAT_ERROR (GstDebugCategory * cat, const char *format, ...)
1289 {
1290 }
1291
1292 static inline void
1293 GST_CAT_WARNING (GstDebugCategory * cat, const char *format, ...)
1294 {
1295 }
1296
1297 static inline void
1298 GST_CAT_INFO (GstDebugCategory * cat, const char *format, ...)
1299 {
1300 }
1301
1302 static inline void
1303 GST_CAT_DEBUG (GstDebugCategory * cat, const char *format, ...)
1304 {
1305 }
1306
1307 static inline void
1308 GST_CAT_LOG (GstDebugCategory * cat, const char *format, ...)
1309 {
1310 }
1311
1312 static inline void
1313 GST_CAT_FIXME (GstDebugCategory * cat, const char *format, ...)
1314 {
1315 }
1316
1317 static inline void
1318 GST_ERROR_OBJECT (gpointer obj, const char *format, ...)
1319 {
1320 }
1321
1322 static inline void
1323 GST_WARNING_OBJECT (gpointer obj, const char *format, ...)
1324 {
1325 }
1326
1327 static inline void
1328 GST_INFO_OBJECT (gpointer obj, const char *format, ...)
1329 {
1330 }
1331
1332 static inline void
1333 GST_DEBUG_OBJECT (gpointer obj, const char *format, ...)
1334 {
1335 }
1336
1337 static inline void
1338 GST_LOG_OBJECT (gpointer obj, const char *format, ...)
1339 {
1340 }
1341
1342 static inline void
1343 GST_FIXME_OBJECT (gpointer obj, const char *format, ...)
1344 {
1345 }
1346
1347 static inline void
1348 GST_ERROR (const char *format, ...)
1349 {
1350 }
1351
1352 static inline void
1353 GST_WARNING (const char *format, ...)
1354 {
1355 }
1356
1357 static inline void
1358 GST_INFO (const char *format, ...)
1359 {
1360 }
1361
1362 static inline void
1363 GST_DEBUG (const char *format, ...)
1364 {
1365 }
1366
1367 static inline void
1368 GST_LOG (const char *format, ...)
1369 {
1370 }
1371
1372 static inline void
1373 GST_FIXME (const char *format, ...)
1374 {
1375 }
1376
1377 #endif /* G_HAVE_GNUC_VARARGS */
1378 #endif /* G_HAVE_ISO_VARARGS */
1379
1380 #define GST_DEBUG_FUNCPTR(ptr) (ptr)
1381 #define GST_DEBUG_FUNCPTR_NAME(ptr) (g_strdup_printf ("%p", ptr))
1382
1383 #define GST_CAT_MEMDUMP_OBJECT(cat,obj,msg,data,length) /* NOP */
1384 #define GST_CAT_MEMDUMP(cat,msg,data,length)            /* NOP */
1385 #define GST_MEMDUMP_OBJECT(obj,msg,data,length)         /* NOP */
1386 #define GST_MEMDUMP(msg,data,length)                    /* NOP */
1387
1388 #endif /* GST_DISABLE_GST_DEBUG */
1389
1390
1391 void gst_debug_print_stack_trace (void);
1392
1393 G_END_DECLS
1394
1395 #endif /* __GSTINFO_H__ */