build: more some prototypes out if #ifndef GST_DISABLE_GST_DEBUG
[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
258 /* FIXME 0.11: move this into private headers */
259 void            _gst_debug_init (void);
260
261
262 #ifdef GST_USING_PRINTF_EXTENSION
263
264 /* not using G_GNUC_PRINTF, since gcc will choke on GST_PTR_FORMAT being %P */
265 void                gst_debug_log            (GstDebugCategory * category,
266                                           GstDebugLevel      level,
267                                           const gchar      * file,
268                                           const gchar      * function,
269                                           gint               line,
270                                           GObject          * object,
271                                           const gchar      * format,
272                                           ...) G_GNUC_NO_INSTRUMENT;
273
274 #else /* GST_USING_PRINTF_EXTENSION */
275
276 void                gst_debug_log            (GstDebugCategory * category,
277                                           GstDebugLevel      level,
278                                           const gchar      * file,
279                                           const gchar      * function,
280                                           gint               line,
281                                           GObject          * object,
282                                           const gchar      * format,
283                                           ...) G_GNUC_PRINTF (7, 8) G_GNUC_NO_INSTRUMENT;
284
285 #endif /* GST_USING_PRINTF_EXTENSION */
286
287 void            gst_debug_log_valist     (GstDebugCategory * category,
288                                           GstDebugLevel      level,
289                                           const gchar      * file,
290                                           const gchar      * function,
291                                           gint                line,
292                                           GObject          * object,
293                                           const gchar      * format,
294                                           va_list            args) G_GNUC_NO_INSTRUMENT;
295
296 /* do not use this function, use the GST_DEBUG_CATEGORY_INIT macro */
297 GstDebugCategory *_gst_debug_category_new (const gchar * name,
298                                            guint         color,
299                                            const gchar * description);
300 /* do not use this function, use the GST_DEBUG_CATEGORY_GET macro */
301 GstDebugCategory *_gst_debug_get_category (const gchar *name);
302
303
304 /* do not use this function, use the GST_CAT_MEMDUMP_* macros */
305 void _gst_debug_dump_mem (GstDebugCategory * cat, const gchar * file,
306     const gchar * func, gint line, GObject * obj, const gchar * msg,
307     const guint8 * data, guint length);
308
309 /* FIXME:0.11 remove, we don't use it */
310 typedef void (* GstDebugFuncPtr)        (void);
311
312 /* do no use these functions, use the GST_DEBUG*_FUNCPTR macros */
313 void    _gst_debug_register_funcptr     (gpointer       func,
314                                          const gchar *          ptrname);
315 G_CONST_RETURN gchar *
316         _gst_debug_nameof_funcptr       (gpointer       func) G_GNUC_NO_INSTRUMENT;
317
318
319 #ifndef GST_DISABLE_GST_DEBUG
320
321 const gchar   * gst_debug_message_get    (GstDebugMessage  * message);
322
323 void            gst_debug_log_default    (GstDebugCategory * category,
324                                           GstDebugLevel      level,
325                                           const gchar      * file,
326                                           const gchar      * function,
327                                           gint               line,
328                                           GObject          * object,
329                                           GstDebugMessage  * message,
330                                           gpointer           unused) G_GNUC_NO_INSTRUMENT;
331
332 G_CONST_RETURN gchar *
333                 gst_debug_level_get_name (GstDebugLevel level);
334
335 void            gst_debug_add_log_function            (GstLogFunction func,
336                                                        gpointer       data);
337 guint           gst_debug_remove_log_function         (GstLogFunction func);
338 guint           gst_debug_remove_log_function_by_data (gpointer       data);
339
340 void            gst_debug_set_active  (gboolean active);
341 gboolean        gst_debug_is_active   (void);
342
343 void            gst_debug_set_colored (gboolean colored);
344 gboolean        gst_debug_is_colored  (void);
345
346 void            gst_debug_set_default_threshold     (GstDebugLevel level);
347 GstDebugLevel   gst_debug_get_default_threshold     (void);
348 void            gst_debug_set_threshold_for_name    (const gchar * name,
349                                                      GstDebugLevel level);
350 void            gst_debug_unset_threshold_for_name  (const gchar * name);
351
352 /**
353  * GST_DEBUG_CATEGORY:
354  * @cat: the category
355  *
356  * Defines a GstDebugCategory variable.
357  * This macro expands to nothing if debugging is disabled.
358  */
359 #define GST_DEBUG_CATEGORY(cat) GstDebugCategory *cat = NULL
360 /**
361  * GST_DEBUG_CATEGORY_EXTERN:
362  * @cat: the category
363  *
364  * Declares a GstDebugCategory variable as extern. Use in header files.
365  * This macro expands to nothing if debugging is disabled.
366  */
367 #define GST_DEBUG_CATEGORY_EXTERN(cat) extern GstDebugCategory *cat
368
369 /**
370  * GST_DEBUG_CATEGORY_STATIC:
371  * @cat: the category
372  *
373  * Defines a static GstDebugCategory variable.
374  * This macro expands to nothing if debugging is disabled.
375  */
376 #define GST_DEBUG_CATEGORY_STATIC(cat) static GstDebugCategory *cat = NULL
377
378 /**
379  * GST_DEBUG_CATEGORY_INIT:
380  * @cat: the category to initialize.
381  * @name: the name of the category.
382  * @color: the colors to use for a color representation or 0 for no color.
383  * @description: optional description of the category.
384  *
385  * Initializes a new #GstDebugCategory with the given properties and set to
386  * the default threshold.
387  *
388  * <note>
389  * <para>
390  * This macro expands to nothing if debugging is disabled.
391  * </para>
392  * <para>
393  * When naming your category, please follow the following conventions to ensure
394  * that the pattern matching for categories works as expected. It is not
395  * earth-shattering if you don't follow these conventions, but it would be nice
396  * for everyone.
397  * </para>
398  * <para>
399  * If you define a category for a plugin or a feature of it, name the category
400  * like the feature. So if you wanted to write a "filesrc" element, you would
401  * name the category "filesrc". Use lowercase letters only.
402  * If you define more than one category for the same element, append an
403  * underscore and an identifier to your categories, like this: "filesrc_cache"
404  * </para>
405  * <para>
406  * If you create a library or an application using debugging categories, use a
407  * common prefix followed by an underscore for all your categories. GStreamer
408  * uses the GST prefix so GStreamer categories look like "GST_STATES". Be sure
409  * to include uppercase letters.
410  * </para>
411  * </note>
412  */
413 #define GST_DEBUG_CATEGORY_INIT(cat,name,color,description) G_STMT_START{\
414   if (cat == NULL)                                                      \
415     cat = _gst_debug_category_new (name,color,description);             \
416 }G_STMT_END
417
418 void    gst_debug_category_free         (GstDebugCategory *     category);
419 void    gst_debug_category_set_threshold (GstDebugCategory *    category,
420                                          GstDebugLevel          level);
421 void    gst_debug_category_reset_threshold(GstDebugCategory *   category);
422 GstDebugLevel
423         gst_debug_category_get_threshold (GstDebugCategory *    category);
424 G_CONST_RETURN gchar *
425         gst_debug_category_get_name     (GstDebugCategory *     category);
426 guint   gst_debug_category_get_color    (GstDebugCategory *     category);
427 G_CONST_RETURN gchar *
428         gst_debug_category_get_description (GstDebugCategory *  category);
429 GSList *
430         gst_debug_get_all_categories    (void);
431
432 /**
433  * GST_DEBUG_CATEGORY_GET:
434  * @cat: the category to initialize.
435  * @name: log category name
436  *
437  * Lookup an exiting #GstDebugCategory by its @name and sets @cat. If category
438  * is not found, but GST_CAT_DEFAULT is defined, that is assigned to @cat.
439  * Otherwise cat will be NULL.
440  *
441  * |[
442  * GST_DEBUG_CATEGORY_STATIC (gst_myplugin_debug);
443  * #define GST_CAT_DEFAULT gst_myplugin_debug
444  * GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE);
445  * ...
446  * GST_DEBUG_CATEGORY_INIT (gst_myplugin_debug, "myplugin", 0, "nice element");
447  * GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "performance");
448  * ]|
449  *
450  * Since: 0.10.24
451  */
452 #ifdef GST_CAT_DEFAULT
453 #define GST_DEBUG_CATEGORY_GET(cat,name)  G_STMT_START{\
454   cat = _gst_debug_get_category (name);                 \
455   if (!cat) {                                           \
456     cat = GST_CAT_DEFAULT;                              \
457   }                                                     \
458 }G_STMT_END
459 #else
460 #define GST_DEBUG_CATEGORY_GET(cat,name)  G_STMT_START{\
461   cat = _gst_debug_get_category (name);                 \
462 }G_STMT_END
463 #endif
464
465
466 gchar * gst_debug_construct_term_color  (guint colorinfo);
467 gint    gst_debug_construct_win_color (guint colorinfo);
468
469
470 /**
471  * GST_CAT_DEFAULT:
472  *
473  * Default gstreamer core debug log category. Please define your own.
474  */
475 GST_EXPORT GstDebugCategory *   GST_CAT_DEFAULT;
476 /* this symbol may not be used */
477 extern gboolean                 __gst_debug_enabled;
478
479 /* since 0.10.7, the min debug level, used for quickly discarding debug
480  * messages that fall under the threshold. */
481 GST_EXPORT GstDebugLevel            __gst_debug_min; 
482
483 /**
484  * GST_CAT_LEVEL_LOG:
485  * @cat: category to use
486  * @level: the severity of the message
487  * @object: the #GObject the message belongs to or NULL if none
488  * @...: A printf-style message to output
489  *
490  * Outputs a debugging message. This is the most general macro for outputting
491  * debugging messages. You will probably want to use one of the ones described
492  * below.
493  */
494 #ifdef G_HAVE_ISO_VARARGS
495 #define GST_CAT_LEVEL_LOG(cat,level,object,...) G_STMT_START{           \
496   if (G_UNLIKELY (level <= __gst_debug_min)) {                                          \
497     gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__,    \
498         (GObject *) (object), __VA_ARGS__);                             \
499   }                                                                     \
500 }G_STMT_END
501 #else /* G_HAVE_GNUC_VARARGS */
502 #ifdef G_HAVE_GNUC_VARARGS
503 #define GST_CAT_LEVEL_LOG(cat,level,object,args...) G_STMT_START{       \
504   if (G_UNLIKELY (level <= __gst_debug_min)) {                                          \
505     gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__,    \
506         (GObject *) (object), ##args );                                 \
507   }                                                                     \
508 }G_STMT_END
509 #else /* no variadic macros, use inline */
510 static inline void
511 GST_CAT_LEVEL_LOG_valist (GstDebugCategory * cat,
512     GstDebugLevel level, gpointer object, const char *format, va_list varargs)
513 {
514   if (G_UNLIKELY (level <= __gst_debug_min)) {
515     gst_debug_log_valist (cat, level, "", "", 0, (GObject *) object, format,
516         varargs);
517   }
518 }
519
520 static inline void
521 GST_CAT_LEVEL_LOG (GstDebugCategory * cat, GstDebugLevel level,
522     gpointer object, const char *format, ...)
523 {
524   va_list varargs;
525
526   va_start (varargs, format);
527   GST_CAT_LEVEL_LOG_valist (cat, level, object, format, varargs);
528   va_end (varargs);
529 }
530 #endif
531 #endif /* G_HAVE_ISO_VARARGS */
532
533 /* This one doesn't have varargs in the macro, so it's different than all the
534  * other macros and hence in a separate block right here. Docs chunks are
535  * with the other doc chunks below though. */
536 #define __GST_CAT_MEMDUMP_LOG(cat,object,msg,data,length) G_STMT_START{       \
537   if (G_UNLIKELY (GST_LEVEL_MEMDUMP <= __gst_debug_min)) {                    \
538     _gst_debug_dump_mem ((cat), __FILE__, GST_FUNCTION, __LINE__,             \
539         (GObject *) (object), (msg), (data), (length));                       \
540   }                                                                           \
541 }G_STMT_END
542
543 #define GST_CAT_MEMDUMP_OBJECT(cat,obj,msg,data,length)  \
544     __GST_CAT_MEMDUMP_LOG(cat,obj,msg,data,length)
545 #define GST_CAT_MEMDUMP(cat,msg,data,length)             \
546     __GST_CAT_MEMDUMP_LOG(cat,NULL,msg,data,length)
547 #define GST_MEMDUMP_OBJECT(obj,msg,data,length)          \
548     __GST_CAT_MEMDUMP_LOG(GST_CAT_DEFAULT,obj,msg,data,length)
549 #define GST_MEMDUMP(msg,data,length)                     \
550     __GST_CAT_MEMDUMP_LOG(GST_CAT_DEFAULT,NULL,msg,data,length)
551
552 /**
553  * GST_CAT_ERROR_OBJECT:
554  * @cat: category to use
555  * @obj: the #GObject the message belongs to
556  * @...: printf-style message to output
557  *
558  * Output an error message belonging to the given object in the given category.
559  */
560 /**
561  * GST_CAT_WARNING_OBJECT:
562  * @cat: category to use
563  * @obj: the #GObject the message belongs to
564  * @...: printf-style message to output
565  *
566  * Output a warning message belonging to the given object in the given category.
567  */
568 /**
569  * GST_CAT_INFO_OBJECT:
570  * @cat: category to use
571  * @obj: the #GObject the message belongs to
572  * @...: printf-style message to output
573  *
574  * Output an informational message belonging to the given object in the given
575  * category.
576  */
577 /**
578  * GST_CAT_DEBUG_OBJECT:
579  * @cat: category to use
580  * @obj: the #GObject the message belongs to
581  * @...: printf-style message to output
582  *
583  * Output an debugging message belonging to the given object in the given category.
584  */
585 /**
586  * GST_CAT_LOG_OBJECT:
587  * @cat: category to use
588  * @obj: the #GObject the message belongs to
589  * @...: printf-style message to output
590  *
591  * Output an logging message belonging to the given object in the given category.
592  */
593 /**
594  * GST_CAT_FIXME_OBJECT:
595  * @cat: category to use
596  * @obj: the #GObject the message belongs to
597  * @...: printf-style message to output
598  *
599  * Output a fixme message belonging to the given object in the given category.
600  *
601  * Since: 0.10.23
602  */
603 /**
604  * GST_CAT_MEMDUMP_OBJECT:
605  * @cat: category to use
606  * @obj: the #GObject the message belongs to
607  * @msg: message string to log with the data
608  * @data: pointer to the data to output
609  * @length: length of the data to output
610  *
611  * Output a hexdump of @data relating to the given object in the given
612  * category.
613  *
614  * Since: 0.10.23
615  */
616
617
618 /**
619  * GST_CAT_ERROR:
620  * @cat: category to use
621  * @...: printf-style message to output
622  *
623  * Output an error message in the given category.
624  */
625 /**
626  * GST_CAT_WARNING:
627  * @cat: category to use
628  * @...: printf-style message to output
629  *
630  * Output an warning message in the given category.
631  */
632 /**
633  * GST_CAT_INFO:
634  * @cat: category to use
635  * @...: printf-style message to output
636  *
637  * Output an informational message in the given category.
638  */
639 /**
640  * GST_CAT_DEBUG:
641  * @cat: category to use
642  * @...: printf-style message to output
643  *
644  * Output an debugging message in the given category.
645  */
646 /**
647  * GST_CAT_LOG:
648  * @cat: category to use
649  * @...: printf-style message to output
650  *
651  * Output an logging message in the given category.
652  */
653 /**
654  * GST_CAT_FIXME:
655  * @cat: category to use
656  * @...: printf-style message to output
657  *
658  * Output an fixme message in the given category.
659  *
660  * Since: 0.10.23
661  */
662 /**
663  * GST_CAT_MEMDUMP:
664  * @cat: category to use
665  * @msg: message string to log with the data
666  * @data: pointer to the data to output
667  * @length: length of the data to output
668  *
669  * Output a hexdump of @data in the given category.
670  *
671  * Since: 0.10.23
672  */
673
674
675 /**
676  * GST_ERROR_OBJECT:
677  * @obj: the #GObject the message belongs to
678  * @...: printf-style message to output
679  *
680  * Output an error message belonging to the given object in the default category.
681  */
682 /**
683  * GST_WARNING_OBJECT:
684  * @obj: the #GObject the message belongs to
685  * @...: printf-style message to output
686  *
687  * Output a warning message belonging to the given object in the default category.
688  */
689 /**
690  * GST_INFO_OBJECT:
691  * @obj: the #GObject the message belongs to
692  * @...: printf-style message to output
693  *
694  * Output an informational message belonging to the given object in the default
695  * category.
696  */
697 /**
698  * GST_DEBUG_OBJECT:
699  * @obj: the #GObject the message belongs to
700  * @...: printf-style message to output
701  *
702  * Output a debugging message belonging to the given object in the default
703  * category.
704  */
705 /**
706  * GST_LOG_OBJECT:
707  * @obj: the #GObject the message belongs to
708  * @...: printf-style message to output
709  *
710  * Output a logging message belonging to the given object in the default category.
711  */
712 /**
713  * GST_FIXME_OBJECT:
714  * @obj: the #GObject the message belongs to
715  * @...: printf-style message to output
716  *
717  * Output a logging message belonging to the given object in the default category.
718  *
719  * Since: 0.10.23
720  */
721 /**
722  * GST_MEMDUMP_OBJECT:
723  * @obj: the #GObject the message belongs to
724  * @msg: message string to log with the data
725  * @data: pointer to the data to output
726  * @length: length of the data to output
727  *
728  * Output a logging message belonging to the given object in the default category.
729  *
730  * Since: 0.10.23
731  */
732
733
734 /**
735  * GST_ERROR:
736  * @...: printf-style message to output
737  *
738  * Output an error message in the default category.
739  */
740 /**
741  * GST_WARNING:
742  * @...: printf-style message to output
743  *
744  * Output a warning message in the default category.
745  */
746 /**
747  * GST_INFO:
748  * @...: printf-style message to output
749  *
750  * Output an informational message in the default category.
751  */
752 /**
753  * GST_DEBUG:
754  * @...: printf-style message to output
755  *
756  * Output a debugging message in the default category.
757  */
758 /**
759  * GST_LOG:
760  * @...: printf-style message to output
761  *
762  * Output a logging message in the default category.
763  */
764 /**
765  * GST_FIXME:
766  * @...: printf-style message to output
767  *
768  * Output a fixme message in the default category.
769  *
770  * Since: 0.10.23
771  */
772 /**
773  * GST_MEMDUMP:
774  * @msg: message string to log with the data
775  * @data: pointer to the data to output
776  * @length: length of the data to output
777  *
778  * Output a hexdump of @data.
779  *
780  * Since: 0.10.23
781  */
782
783 #ifdef G_HAVE_ISO_VARARGS
784
785 #define GST_CAT_ERROR_OBJECT(cat,obj,...)       GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR,   obj,  __VA_ARGS__)
786 #define GST_CAT_WARNING_OBJECT(cat,obj,...)     GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, obj,  __VA_ARGS__)
787 #define GST_CAT_INFO_OBJECT(cat,obj,...)        GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO,    obj,  __VA_ARGS__)
788 #define GST_CAT_DEBUG_OBJECT(cat,obj,...)       GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG,   obj,  __VA_ARGS__)
789 #define GST_CAT_LOG_OBJECT(cat,obj,...)         GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG,     obj,  __VA_ARGS__)
790 #define GST_CAT_FIXME_OBJECT(cat,obj,...)       GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME,   obj,  __VA_ARGS__)
791
792 #define GST_CAT_ERROR(cat,...)                  GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR,   NULL, __VA_ARGS__)
793 #define GST_CAT_WARNING(cat,...)                GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
794 #define GST_CAT_INFO(cat,...)                   GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO,    NULL, __VA_ARGS__)
795 #define GST_CAT_DEBUG(cat,...)                  GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG,   NULL, __VA_ARGS__)
796 #define GST_CAT_LOG(cat,...)                    GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG,     NULL, __VA_ARGS__)
797 #define GST_CAT_FIXME(cat,...)                  GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME,   NULL, __VA_ARGS__)
798
799 #define GST_ERROR_OBJECT(obj,...)       GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR,   obj,  __VA_ARGS__)
800 #define GST_WARNING_OBJECT(obj,...)     GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj,  __VA_ARGS__)
801 #define GST_INFO_OBJECT(obj,...)        GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO,    obj,  __VA_ARGS__)
802 #define GST_DEBUG_OBJECT(obj,...)       GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   obj,  __VA_ARGS__)
803 #define GST_LOG_OBJECT(obj,...)         GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG,     obj,  __VA_ARGS__)
804 #define GST_FIXME_OBJECT(obj,...)       GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME,   obj,  __VA_ARGS__)
805
806 #define GST_ERROR(...)                  GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR,   NULL, __VA_ARGS__)
807 #define GST_WARNING(...)                GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
808 #define GST_INFO(...)                   GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO,    NULL, __VA_ARGS__)
809 #define GST_DEBUG(...)                  GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   NULL, __VA_ARGS__)
810 #define GST_LOG(...)                    GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG,     NULL, __VA_ARGS__)
811 #define GST_FIXME(...)                  GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME,   NULL, __VA_ARGS__)
812
813 #else
814 #ifdef G_HAVE_GNUC_VARARGS
815
816 #define GST_CAT_ERROR_OBJECT(cat,obj,args...)   GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR,   obj,  ##args )
817 #define GST_CAT_WARNING_OBJECT(cat,obj,args...) GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, obj,  ##args )
818 #define GST_CAT_INFO_OBJECT(cat,obj,args...)    GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO,    obj,  ##args )
819 #define GST_CAT_DEBUG_OBJECT(cat,obj,args...)   GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG,   obj,  ##args )
820 #define GST_CAT_LOG_OBJECT(cat,obj,args...)     GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG,     obj,  ##args )
821 #define GST_CAT_FIXME_OBJECT(cat,obj,args...)   GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME,   obj,  ##args )
822
823 #define GST_CAT_ERROR(cat,args...)              GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR,   NULL, ##args )
824 #define GST_CAT_WARNING(cat,args...)            GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, NULL, ##args )
825 #define GST_CAT_INFO(cat,args...)               GST_CAT_LEVEL_LOG (cat, GST_LEVEL_INFO,    NULL, ##args )
826 #define GST_CAT_DEBUG(cat,args...)              GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG,   NULL, ##args )
827 #define GST_CAT_LOG(cat,args...)                GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG,     NULL, ##args )
828 #define GST_CAT_FIXME(cat,args...)              GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME,   NULL, ##args )
829
830 #define GST_ERROR_OBJECT(obj,args...)   GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR,   obj,  ##args )
831 #define GST_WARNING_OBJECT(obj,args...) GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj,  ##args )
832 #define GST_INFO_OBJECT(obj,args...)    GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO,    obj,  ##args )
833 #define GST_DEBUG_OBJECT(obj,args...)   GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   obj,  ##args )
834 #define GST_LOG_OBJECT(obj,args...)     GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG,     obj,  ##args )
835 #define GST_FIXME_OBJECT(obj,args...)   GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME,   obj,  ##args )
836
837 #define GST_ERROR(args...)              GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR,   NULL, ##args )
838 #define GST_WARNING(args...)            GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, ##args )
839 #define GST_INFO(args...)               GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO,    NULL, ##args )
840 #define GST_DEBUG(args...)              GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   NULL, ##args )
841 #define GST_LOG(args...)                GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG,     NULL, ##args )
842 #define GST_FIXME(args...)              GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME,   NULL, ##args )
843
844 #else
845 /* no variadic macros, use inline */
846 static inline void
847 GST_CAT_ERROR_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
848     ...)
849 {
850   va_list varargs;
851
852   va_start (varargs, format);
853   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_ERROR, obj, format, varargs);
854   va_end (varargs);
855 }
856
857 static inline void
858 GST_CAT_WARNING_OBJECT (GstDebugCategory * cat, gpointer obj,
859     const char *format, ...)
860 {
861   va_list varargs;
862
863   va_start (varargs, format);
864   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_WARNING, obj, format, varargs);
865   va_end (varargs);
866 }
867
868 static inline void
869 GST_CAT_INFO_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
870     ...)
871 {
872   va_list varargs;
873
874   va_start (varargs, format);
875   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_INFO, obj, format, varargs);
876   va_end (varargs);
877 }
878
879 static inline void
880 GST_CAT_DEBUG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
881     ...)
882 {
883   va_list varargs;
884
885   va_start (varargs, format);
886   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_DEBUG, obj, format, varargs);
887   va_end (varargs);
888 }
889
890 static inline void
891 GST_CAT_LOG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
892     ...)
893 {
894   va_list varargs;
895
896   va_start (varargs, format);
897   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_LOG, obj, format, varargs);
898   va_end (varargs);
899 }
900
901 static inline void
902 GST_CAT_FIXME_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
903     ...)
904 {
905   va_list varargs;
906
907   va_start (varargs, format);
908   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_FIXME, obj, format, varargs);
909   va_end (varargs);
910 }
911
912 static inline void
913 GST_CAT_ERROR (GstDebugCategory * cat, const char *format, ...)
914 {
915   va_list varargs;
916
917   va_start (varargs, format);
918   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_ERROR, NULL, format, varargs);
919   va_end (varargs);
920 }
921
922 static inline void
923 GST_CAT_WARNING (GstDebugCategory * cat, const char *format, ...)
924 {
925   va_list varargs;
926
927   va_start (varargs, format);
928   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_WARNING, NULL, format, varargs);
929   va_end (varargs);
930 }
931
932 static inline void
933 GST_CAT_INFO (GstDebugCategory * cat, const char *format, ...)
934 {
935   va_list varargs;
936
937   va_start (varargs, format);
938   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_INFO, NULL, format, varargs);
939   va_end (varargs);
940 }
941
942 static inline void
943 GST_CAT_DEBUG (GstDebugCategory * cat, const char *format, ...)
944 {
945   va_list varargs;
946
947   va_start (varargs, format);
948   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_DEBUG, NULL, format, varargs);
949   va_end (varargs);
950 }
951
952 static inline void
953 GST_CAT_LOG (GstDebugCategory * cat, const char *format, ...)
954 {
955   va_list varargs;
956
957   va_start (varargs, format);
958   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_LOG, NULL, format, varargs);
959   va_end (varargs);
960 }
961
962 static inline void
963 GST_CAT_FIXME (GstDebugCategory * cat, const char *format, ...)
964 {
965   va_list varargs;
966
967   va_start (varargs, format);
968   GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_FIXME, NULL, format, varargs);
969   va_end (varargs);
970 }
971
972 static inline void
973 GST_ERROR_OBJECT (gpointer obj, const char *format, ...)
974 {
975   va_list varargs;
976
977   va_start (varargs, format);
978   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_ERROR, obj, format,
979       varargs);
980   va_end (varargs);
981 }
982
983 static inline void
984 GST_WARNING_OBJECT (gpointer obj, const char *format, ...)
985 {
986   va_list varargs;
987
988   va_start (varargs, format);
989   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj, format,
990       varargs);
991   va_end (varargs);
992 }
993
994 static inline void
995 GST_INFO_OBJECT (gpointer obj, const char *format, ...)
996 {
997   va_list varargs;
998
999   va_start (varargs, format);
1000   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_INFO, obj, format,
1001       varargs);
1002   va_end (varargs);
1003 }
1004
1005 static inline void
1006 GST_DEBUG_OBJECT (gpointer obj, const char *format, ...)
1007 {
1008   va_list varargs;
1009
1010   va_start (varargs, format);
1011   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, obj, format,
1012       varargs);
1013   va_end (varargs);
1014 }
1015
1016 static inline void
1017 GST_LOG_OBJECT (gpointer obj, const char *format, ...)
1018 {
1019   va_list varargs;
1020
1021   va_start (varargs, format);
1022   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_LOG, obj, format,
1023       varargs);
1024   va_end (varargs);
1025 }
1026
1027 static inline void
1028 GST_FIXME_OBJECT (gpointer obj, const char *format, ...)
1029 {
1030   va_list varargs;
1031
1032   va_start (varargs, format);
1033   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_FIXME, obj, format,
1034       varargs);
1035   va_end (varargs);
1036 }
1037
1038 static inline void
1039 GST_ERROR (const char *format, ...)
1040 {
1041   va_list varargs;
1042
1043   va_start (varargs, format);
1044   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_ERROR, NULL, format,
1045       varargs);
1046   va_end (varargs);
1047 }
1048
1049 static inline void
1050 GST_WARNING (const char *format, ...)
1051 {
1052   va_list varargs;
1053
1054   va_start (varargs, format);
1055   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, format,
1056       varargs);
1057   va_end (varargs);
1058 }
1059
1060 static inline void
1061 GST_INFO (const char *format, ...)
1062 {
1063   va_list varargs;
1064
1065   va_start (varargs, format);
1066   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, format,
1067       varargs);
1068   va_end (varargs);
1069 }
1070
1071 static inline void
1072 GST_DEBUG (const char *format, ...)
1073 {
1074   va_list varargs;
1075
1076   va_start (varargs, format);
1077   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, format,
1078       varargs);
1079   va_end (varargs);
1080 }
1081
1082 static inline void
1083 GST_LOG (const char *format, ...)
1084 {
1085   va_list varargs;
1086
1087   va_start (varargs, format);
1088   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_LOG, NULL,
1089       format, varargs);
1090   va_end (varargs);
1091 }
1092
1093 static inline void
1094 GST_FIXME (const char *format, ...)
1095 {
1096   va_list varargs;
1097
1098   va_start (varargs, format);
1099   GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_FIXME, NULL, format,
1100       varargs);
1101   va_end (varargs);
1102 }
1103 #endif
1104 #endif
1105
1106
1107 /********** function pointer stuff **********/
1108
1109 /**
1110  * GST_DEBUG_REGISTER_FUNCPTR:
1111  * @ptr: pointer to the function to register
1112  *
1113  * Register a pointer to a function with its name, so it can later be used by
1114  * GST_DEBUG_FUNCPTR_NAME().
1115  *
1116  * Use this variant of #GST_DEBUG_FUNCPTR if you do not need to use @ptr.
1117  *
1118  * Since: 0.10.26
1119  */
1120 #define GST_DEBUG_REGISTER_FUNCPTR(ptr) \
1121   _gst_debug_register_funcptr((gpointer)(ptr), #ptr)
1122 /**
1123  * GST_DEBUG_FUNCPTR:
1124  * @ptr: pointer to the function to register
1125  *
1126  * Register a pointer to a function with its name, so it can later be used by
1127  * GST_DEBUG_FUNCPTR_NAME().
1128  *
1129  * Returns: the value passed to @ptr.
1130  */
1131 #define GST_DEBUG_FUNCPTR(ptr) \
1132   (_gst_debug_register_funcptr((gpointer)(ptr), #ptr) , ptr)
1133
1134 /**
1135  * GST_DEBUG_FUNCPTR_NAME:
1136  * @ptr: address of the function of which to look up the name
1137  *
1138  * Retrieves the name of the function, if it was previously registered with
1139  * GST_DEBUG_FUNCPTR(). If not, it returns a description of the pointer.
1140  *
1141  * This macro returns a constant string which must not be modified or
1142  * freed by the caller.
1143  */
1144 #define GST_DEBUG_FUNCPTR_NAME(ptr) \
1145   _gst_debug_nameof_funcptr((gpointer)ptr)
1146
1147
1148 #else /* GST_DISABLE_GST_DEBUG */
1149
1150
1151 #ifndef GST_INFO_C
1152
1153 #if defined(__GNUC__) && __GNUC__ >= 3
1154 #  pragma GCC poison gst_debug_log
1155 #  pragma GCC poison gst_debug_log_valist
1156 #  pragma GCC poison _gst_debug_category_new
1157 #endif
1158
1159 #define __gst_debug_min GST_LEVEL_NONE
1160
1161 #define _gst_debug_init()                               G_STMT_START{ }G_STMT_END
1162
1163 #define gst_debug_set_default_threshold(level)          G_STMT_START{ }G_STMT_END
1164 #define gst_debug_get_default_threshold()               (GST_LEVEL_NONE)
1165
1166 #define gst_debug_level_get_name(level)                         ("NONE")
1167 #define gst_debug_message_get(message)                          ("")
1168 #define gst_debug_add_log_function(func,data)           G_STMT_START{ }G_STMT_END
1169 guint gst_debug_remove_log_function (GstLogFunction func);
1170 guint gst_debug_remove_log_function_by_data (gpointer data);
1171 #define gst_debug_set_active(active)                    G_STMT_START{ }G_STMT_END
1172 #define gst_debug_is_active()                           (FALSE)
1173 #define gst_debug_set_colored(colored)                  G_STMT_START{ }G_STMT_END
1174 #define gst_debug_is_colored()                          (FALSE)
1175 #define gst_debug_set_default_threshold(level)          G_STMT_START{ }G_STMT_END
1176 #define gst_debug_get_default_threshold()               (GST_LEVEL_NONE)
1177 #define gst_debug_set_threshold_for_name(name,level)    G_STMT_START{ }G_STMT_END
1178 #define gst_debug_unset_threshold_for_name(name)        G_STMT_START{ }G_STMT_END
1179
1180 #define GST_DEBUG_CATEGORY(var)                         void _gst_dummy_declaration (void)
1181 #define GST_DEBUG_CATEGORY_EXTERN(var)                  void _gst_dummy_declaration (void)
1182 #if !defined(G_HAVE_GNUC_VARARGS) && !defined(G_HAVE_ISO_VARARGS)
1183 #define GST_DEBUG_CATEGORY_STATIC(var)                  static GstDebugCategory *var = NULL
1184 #else
1185 #define GST_DEBUG_CATEGORY_STATIC(var)                  void _gst_dummy_declaration (void)
1186 #endif
1187 #define GST_DEBUG_CATEGORY_INIT(var,name,color,desc)    G_STMT_START{ }G_STMT_END
1188 #define GST_DEBUG_CATEGORY_GET(var,name)                G_STMT_START{ }G_STMT_END
1189 #define gst_debug_category_free(category)               G_STMT_START{ }G_STMT_END
1190 #define gst_debug_category_set_threshold(category,level) G_STMT_START{ }G_STMT_END
1191 #define gst_debug_category_reset_threshold(category)    G_STMT_START{ }G_STMT_END
1192 #define gst_debug_category_get_threshold(category)      (GST_LEVEL_NONE)
1193 #define gst_debug_category_get_name(cat)                ("")
1194 #define gst_debug_category_get_color(cat)               (0)
1195 #define gst_debug_category_get_description(cat)         ("")
1196 #define gst_debug_get_all_categories()                  (NULL)
1197 #define gst_debug_construct_term_color(colorinfo)       (g_strdup ("00"))
1198 #define gst_debug_construct_win_color(colorinfo)        (0)
1199
1200 #endif /* !GST_INFO_C */
1201
1202 #ifdef G_HAVE_ISO_VARARGS
1203
1204 #define GST_CAT_LEVEL_LOG(cat,level,...)                G_STMT_START{ }G_STMT_END
1205
1206 #define GST_CAT_ERROR_OBJECT(...)                       G_STMT_START{ }G_STMT_END
1207 #define GST_CAT_WARNING_OBJECT(...)                     G_STMT_START{ }G_STMT_END
1208 #define GST_CAT_INFO_OBJECT(...)                        G_STMT_START{ }G_STMT_END
1209 #define GST_CAT_DEBUG_OBJECT(...)                       G_STMT_START{ }G_STMT_END
1210 #define GST_CAT_LOG_OBJECT(...)                         G_STMT_START{ }G_STMT_END
1211 #define GST_CAT_FIXME_OBJECT(...)                       G_STMT_START{ }G_STMT_END
1212
1213 #define GST_CAT_ERROR(...)                              G_STMT_START{ }G_STMT_END
1214 #define GST_CAT_WARNING(...)                            G_STMT_START{ }G_STMT_END
1215 #define GST_CAT_INFO(...)                               G_STMT_START{ }G_STMT_END
1216 #define GST_CAT_DEBUG(...)                              G_STMT_START{ }G_STMT_END
1217 #define GST_CAT_LOG(...)                                G_STMT_START{ }G_STMT_END
1218 #define GST_CAT_FIXME(...)                              G_STMT_START{ }G_STMT_END
1219
1220 #define GST_ERROR_OBJECT(...)                           G_STMT_START{ }G_STMT_END
1221 #define GST_WARNING_OBJECT(...)                         G_STMT_START{ }G_STMT_END
1222 #define GST_INFO_OBJECT(...)                            G_STMT_START{ }G_STMT_END
1223 #define GST_DEBUG_OBJECT(...)                           G_STMT_START{ }G_STMT_END
1224 #define GST_LOG_OBJECT(...)                             G_STMT_START{ }G_STMT_END
1225 #define GST_FIXME_OBJECT(...)                           G_STMT_START{ }G_STMT_END
1226
1227 #define GST_ERROR(...)                                  G_STMT_START{ }G_STMT_END
1228 #define GST_WARNING(...)                                G_STMT_START{ }G_STMT_END
1229 #define GST_INFO(...)                                   G_STMT_START{ }G_STMT_END
1230 #define GST_DEBUG(...)                                  G_STMT_START{ }G_STMT_END
1231 #define GST_LOG(...)                                    G_STMT_START{ }G_STMT_END
1232 #define GST_FIXME(...)                                  G_STMT_START{ }G_STMT_END
1233
1234 #else /* !G_HAVE_ISO_VARARGS */
1235 #ifdef G_HAVE_GNUC_VARARGS
1236
1237 #define GST_CAT_LEVEL_LOG(cat,level,args...)            G_STMT_START{ }G_STMT_END
1238
1239 #define GST_CAT_ERROR_OBJECT(args...)                   G_STMT_START{ }G_STMT_END
1240 #define GST_CAT_WARNING_OBJECT(args...)                 G_STMT_START{ }G_STMT_END
1241 #define GST_CAT_INFO_OBJECT(args...)                    G_STMT_START{ }G_STMT_END
1242 #define GST_CAT_DEBUG_OBJECT(args...)                   G_STMT_START{ }G_STMT_END
1243 #define GST_CAT_LOG_OBJECT(args...)                     G_STMT_START{ }G_STMT_END
1244 #define GST_CAT_FIXME_OBJECT(args...)                   G_STMT_START{ }G_STMT_END
1245
1246 #define GST_CAT_ERROR(args...)                          G_STMT_START{ }G_STMT_END
1247 #define GST_CAT_WARNING(args...)                        G_STMT_START{ }G_STMT_END
1248 #define GST_CAT_INFO(args...)                           G_STMT_START{ }G_STMT_END
1249 #define GST_CAT_DEBUG(args...)                          G_STMT_START{ }G_STMT_END
1250 #define GST_CAT_LOG(args...)                            G_STMT_START{ }G_STMT_END
1251 #define GST_CAT_FIXME(args...)                          G_STMT_START{ }G_STMT_END
1252
1253 #define GST_ERROR_OBJECT(args...)                       G_STMT_START{ }G_STMT_END
1254 #define GST_WARNING_OBJECT(args...)                     G_STMT_START{ }G_STMT_END
1255 #define GST_INFO_OBJECT(args...)                        G_STMT_START{ }G_STMT_END
1256 #define GST_DEBUG_OBJECT(args...)                       G_STMT_START{ }G_STMT_END
1257 #define GST_LOG_OBJECT(args...)                         G_STMT_START{ }G_STMT_END
1258 #define GST_FIXME_OBJECT(args...)                       G_STMT_START{ }G_STMT_END
1259
1260 #define GST_ERROR(args...)                              G_STMT_START{ }G_STMT_END
1261 #define GST_WARNING(args...)                            G_STMT_START{ }G_STMT_END
1262 #define GST_INFO(args...)                               G_STMT_START{ }G_STMT_END
1263 #define GST_DEBUG(args...)                              G_STMT_START{ }G_STMT_END
1264 #define GST_LOG(args...)                                G_STMT_START{ }G_STMT_END
1265 #define GST_FIXME(args...)                              G_STMT_START{ }G_STMT_END
1266
1267 #else /* !G_HAVE_GNUC_VARARGS */
1268 static inline void
1269 GST_CAT_LEVEL_LOG_valist (GstDebugCategory * cat,
1270     GstDebugLevel level, gpointer object, const char *format, va_list varargs)
1271 {
1272 }
1273
1274 static inline void
1275 GST_CAT_ERROR_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1276     ...)
1277 {
1278 }
1279
1280 static inline void
1281 GST_CAT_WARNING_OBJECT (GstDebugCategory * cat, gpointer obj,
1282     const char *format, ...)
1283 {
1284 }
1285
1286 static inline void
1287 GST_CAT_INFO_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1288     ...)
1289 {
1290 }
1291
1292 static inline void
1293 GST_CAT_DEBUG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1294     ...)
1295 {
1296 }
1297
1298 static inline void
1299 GST_CAT_LOG_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1300     ...)
1301 {
1302 }
1303
1304 static inline void
1305 GST_CAT_FIXME_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
1306     ...)
1307 {
1308 }
1309
1310 static inline void
1311 GST_CAT_ERROR (GstDebugCategory * cat, const char *format, ...)
1312 {
1313 }
1314
1315 static inline void
1316 GST_CAT_WARNING (GstDebugCategory * cat, const char *format, ...)
1317 {
1318 }
1319
1320 static inline void
1321 GST_CAT_INFO (GstDebugCategory * cat, const char *format, ...)
1322 {
1323 }
1324
1325 static inline void
1326 GST_CAT_DEBUG (GstDebugCategory * cat, const char *format, ...)
1327 {
1328 }
1329
1330 static inline void
1331 GST_CAT_LOG (GstDebugCategory * cat, const char *format, ...)
1332 {
1333 }
1334
1335 static inline void
1336 GST_CAT_FIXME (GstDebugCategory * cat, const char *format, ...)
1337 {
1338 }
1339
1340 static inline void
1341 GST_ERROR_OBJECT (gpointer obj, const char *format, ...)
1342 {
1343 }
1344
1345 static inline void
1346 GST_WARNING_OBJECT (gpointer obj, const char *format, ...)
1347 {
1348 }
1349
1350 static inline void
1351 GST_INFO_OBJECT (gpointer obj, const char *format, ...)
1352 {
1353 }
1354
1355 static inline void
1356 GST_DEBUG_OBJECT (gpointer obj, const char *format, ...)
1357 {
1358 }
1359
1360 static inline void
1361 GST_LOG_OBJECT (gpointer obj, const char *format, ...)
1362 {
1363 }
1364
1365 static inline void
1366 GST_FIXME_OBJECT (gpointer obj, const char *format, ...)
1367 {
1368 }
1369
1370 static inline void
1371 GST_ERROR (const char *format, ...)
1372 {
1373 }
1374
1375 static inline void
1376 GST_WARNING (const char *format, ...)
1377 {
1378 }
1379
1380 static inline void
1381 GST_INFO (const char *format, ...)
1382 {
1383 }
1384
1385 static inline void
1386 GST_DEBUG (const char *format, ...)
1387 {
1388 }
1389
1390 static inline void
1391 GST_LOG (const char *format, ...)
1392 {
1393 }
1394
1395 static inline void
1396 GST_FIXME (const char *format, ...)
1397 {
1398 }
1399
1400 #endif /* G_HAVE_GNUC_VARARGS */
1401 #endif /* G_HAVE_ISO_VARARGS */
1402
1403 #define GST_DEBUG_REGISTER_FUNCPTR(ptr) G_STMT_START{ }G_STMT_END
1404 #define GST_DEBUG_FUNCPTR(ptr) (ptr)
1405 #define GST_DEBUG_FUNCPTR_NAME(ptr) (g_strdup_printf ("%p", ptr))
1406
1407 #define GST_CAT_MEMDUMP_OBJECT(cat,obj,msg,data,length) G_STMT_START{ }G_STMT_END
1408 #define GST_CAT_MEMDUMP(cat,msg,data,length)            G_STMT_START{ }G_STMT_END
1409 #define GST_MEMDUMP_OBJECT(obj,msg,data,length)         G_STMT_START{ }G_STMT_END
1410 #define GST_MEMDUMP(msg,data,length)                    G_STMT_START{ }G_STMT_END
1411
1412 #endif /* GST_DISABLE_GST_DEBUG */
1413
1414
1415 void gst_debug_print_stack_trace (void);
1416
1417 G_END_DECLS
1418
1419 #endif /* __GSTINFO_H__ */