]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gstreamer0-10.git/blobdiff - gst/gstinfo.h
Changes to make it possible to LD_PRELOAD libttif
[glsdk/gstreamer0-10.git] / gst / gstinfo.h
index 6266014d289aad144c2e4a9cd3d0ab939270a97e..3abdb2dd42512de0733a3ca29224fa11169f9762 100644 (file)
 #include <glib-object.h>
 #include <gst/gstconfig.h>
 
-#ifndef M_PI
-#define M_PI  3.14159265358979323846
-#endif
-
 G_BEGIN_DECLS
 
 /**
@@ -52,18 +48,23 @@ G_BEGIN_DECLS
  *  successfully determined the type of the stream or when an mp3 plugin detects
  *  the format to be used. ("This file has mono sound.")
  * @GST_LEVEL_DEBUG: Debugging messages should be used when something common
- *  happens that is not the expected default behavior.
- *  An example would be notifications about state changes or receiving/sending of
- *  events.
+ *  happens that is not the expected default behavior, or something that's
+ *  useful to know but doesn't happen all the time (ie. per loop iteration or
+ *  buffer processed or event handled).
+ *  An example would be notifications about state changes or receiving/sending
+ *  of events.
  * @GST_LEVEL_LOG: Log messages are messages that are very common but might be
  *  useful to know. As a rule of thumb a pipeline that is iterating as expected
- *  should never output anzthing else but LOG messages.
- *  Examples for this are referencing/dereferencing of objects or cothread switches.
+ *  should never output anything else but LOG messages. Use this log level to
+ *  log recurring information in chain functions and loop functions, for
+ *  example.
  * @GST_LEVEL_FIXME: Fixme messages are messages that indicate that something
  *  in the executed code path is not fully implemented or handled yet. Note
  *  that this does not replace proper error handling in any way, the purpose
  *  of this message is to make it easier to spot incomplete/unfinished pieces
  *  of code when reading the debug log. (Since: 0.10.23)
+ * @GST_LEVEL_TRACE: Tracing-related messages (Since: 0.10.30)
+ *  Examples for this are referencing/dereferencing of objects.
  * @GST_LEVEL_MEMDUMP: memory dump messages are used to log (small) chunks of
  *  data as memory dumps in the log. They will be displayed as hexdump with
  *  ASCII characters. (Since: 0.10.23)
@@ -80,6 +81,7 @@ typedef enum {
   GST_LEVEL_DEBUG,
   GST_LEVEL_LOG,
   GST_LEVEL_FIXME = 6,
+  GST_LEVEL_TRACE = 7,
   /* add more */
   GST_LEVEL_MEMDUMP = 9,
   /* add more */
@@ -175,6 +177,8 @@ struct _GstDebugCategory {
 
   const gchar *                name;
   const gchar *                description;
+
+  void *ext;                /**< for use by LD_PRELOADED trace extension */
 };
 
 /********** some convenience macros for debugging **********/
@@ -254,11 +258,18 @@ typedef void (*GstLogFunction)  (GstDebugCategory * category,
                                  GstDebugMessage  * message,
                                  gpointer           data);
 
-#ifndef GST_DISABLE_GST_DEBUG
 
 /* FIXME 0.11: move this into private headers */
 void            _gst_debug_init (void);
 
+typedef struct {
+       const gchar *file;
+       const gchar *function;
+       const gint   line;
+} GstDebugTraceLocation;
+
+#define GST_DEBUG_TRACE_LOCATION() \
+       { __FILE__, GST_FUNCTION, __LINE__ }
 
 #ifdef GST_USING_PRINTF_EXTENSION
 
@@ -272,6 +283,13 @@ void                   gst_debug_log            (GstDebugCategory * category,
                                           const gchar      * format,
                                           ...) G_GNUC_NO_INSTRUMENT;
 
+void               gst_debug_log2           (GstDebugCategory * category,
+                                          GstDebugLevel      level,
+                                          const GstDebugTraceLocation *location,
+                                          GObject          * object,
+                                          const gchar      * format,
+                                          ...) G_GNUC_NO_INSTRUMENT;
+
 #else /* GST_USING_PRINTF_EXTENSION */
 
 void               gst_debug_log            (GstDebugCategory * category,
@@ -283,6 +301,13 @@ void                   gst_debug_log            (GstDebugCategory * category,
                                           const gchar      * format,
                                           ...) G_GNUC_PRINTF (7, 8) G_GNUC_NO_INSTRUMENT;
 
+void               gst_debug_log2           (GstDebugCategory * category,
+                                          GstDebugLevel      level,
+                                          const GstDebugTraceLocation *location,
+                                          GObject          * object,
+                                          const gchar      * format,
+                                          ...) G_GNUC_PRINTF (5, 6) G_GNUC_NO_INSTRUMENT;
+
 #endif /* GST_USING_PRINTF_EXTENSION */
 
 void            gst_debug_log_valist     (GstDebugCategory * category,
@@ -294,8 +319,47 @@ void            gst_debug_log_valist     (GstDebugCategory * category,
                                           const gchar      * format,
                                           va_list            args) G_GNUC_NO_INSTRUMENT;
 
+/* do not use this function, use the GST_DEBUG_CATEGORY_INIT macro */
+GstDebugCategory *_gst_debug_category_new (const gchar * name,
+                                           guint         color,
+                                           const gchar * description);
+/* do not use this function, use the GST_DEBUG_CATEGORY_GET macro */
+GstDebugCategory *_gst_debug_get_category (const gchar *name);
+
+
+/* do not use this function, use the GST_CAT_MEMDUMP_* macros */
+void _gst_debug_dump_mem (GstDebugCategory * cat, const gchar * file,
+    const gchar * func, gint line, GObject * obj, const gchar * msg,
+    const guint8 * data, guint length);
+
+/* we define this to avoid a compiler warning regarding a cast from a function
+ * pointer to a void pointer
+ * (see https://bugzilla.gnome.org/show_bug.cgi?id=309253)
+ */
+typedef        void (* GstDebugFuncPtr)        (void);
+
+/* do no use these functions, use the GST_DEBUG*_FUNCPTR macros */
+void   _gst_debug_register_funcptr     (GstDebugFuncPtr        func,
+                                        const gchar *          ptrname);
+const gchar *
+       _gst_debug_nameof_funcptr       (GstDebugFuncPtr        func) G_GNUC_NO_INSTRUMENT;
+
+
+void            gst_debug_log_valist2    (GstDebugCategory * category,
+                                          GstDebugLevel      level,
+                                          const GstDebugTraceLocation *location,
+                                          GObject          * object,
+                                          const gchar      * format,
+                                          va_list            args) G_GNUC_NO_INSTRUMENT;
+
 const gchar   * gst_debug_message_get    (GstDebugMessage  * message);
 
+gchar *         gst_debug_print_object (gpointer ptr);
+
+#ifdef HAVE_PRINTF_EXTENSION
+gchar *         gst_debug_print_segment (gpointer ptr);
+#endif
+
 void            gst_debug_log_default    (GstDebugCategory * category,
                                           GstDebugLevel      level,
                                           const gchar      * file,
@@ -305,11 +369,11 @@ void            gst_debug_log_default    (GstDebugCategory * category,
                                           GstDebugMessage  * message,
                                           gpointer           unused) G_GNUC_NO_INSTRUMENT;
 
-G_CONST_RETURN gchar *
-                gst_debug_level_get_name (GstDebugLevel level);
+const gchar *   gst_debug_level_get_name (GstDebugLevel level);
 
 void            gst_debug_add_log_function            (GstLogFunction func,
                                                        gpointer       data);
+
 guint           gst_debug_remove_log_function         (GstLogFunction func);
 guint           gst_debug_remove_log_function_by_data (gpointer       data);
 
@@ -319,11 +383,43 @@ gboolean        gst_debug_is_active   (void);
 void            gst_debug_set_colored (gboolean colored);
 gboolean        gst_debug_is_colored  (void);
 
-void            gst_debug_set_default_threshold            (GstDebugLevel level);
-GstDebugLevel   gst_debug_get_default_threshold            (void);
-void            gst_debug_set_threshold_for_name    (const gchar * name,
-                                                     GstDebugLevel level);
-void            gst_debug_unset_threshold_for_name  (const gchar * name);
+void            gst_debug_set_default_threshold      (GstDebugLevel level);
+GstDebugLevel   gst_debug_get_default_threshold      (void);
+void            gst_debug_set_threshold_for_name     (const gchar * name,
+                                                      GstDebugLevel level);
+void            gst_debug_unset_threshold_for_name   (const gchar * name);
+
+
+void            gst_debug_category_free              (GstDebugCategory *       category);
+void               gst_debug_category_set_threshold     (GstDebugCategory *    category,
+                                                      GstDebugLevel            level);
+void            gst_debug_category_reset_threshold   (GstDebugCategory *       category);
+GstDebugLevel   gst_debug_category_get_threshold     (GstDebugCategory *       category);
+const gchar *   gst_debug_category_get_name          (GstDebugCategory *       category);
+guint           gst_debug_category_get_color         (GstDebugCategory *       category);
+const gchar *   gst_debug_category_get_description   (GstDebugCategory *       category);
+GSList *        gst_debug_get_all_categories   (void);
+
+
+gchar * gst_debug_construct_term_color (guint colorinfo);
+gint    gst_debug_construct_win_color  (guint colorinfo);
+
+
+#ifndef GST_DISABLE_GST_DEBUG
+
+#define gst_debug_add_log_function(func,data) \
+G_STMT_START{                                 \
+  if (func == gst_debug_log_default) {        \
+    gst_debug_add_log_function(NULL,data);    \
+  } else {                                    \
+    gst_debug_add_log_function(func,data);    \
+  }                                           \
+}G_STMT_END
+
+#define gst_debug_remove_log_function(func)   \
+    (func == gst_debug_log_default) ?         \
+        gst_debug_remove_log_function(NULL) : \
+        gst_debug_remove_log_function(func)
 
 /**
  * GST_DEBUG_CATEGORY:
@@ -351,10 +447,6 @@ void            gst_debug_unset_threshold_for_name  (const gchar * name);
  */
 #define GST_DEBUG_CATEGORY_STATIC(cat) static GstDebugCategory *cat = NULL
 
-/* do not use this function, use the GST_DEBUG_CATEGORY_INIT macro below */
-GstDebugCategory *_gst_debug_category_new (const gchar * name,
-                                           guint         color,
-                                           const gchar * description);
 /**
  * GST_DEBUG_CATEGORY_INIT:
  * @cat: the category to initialize.
@@ -395,31 +487,14 @@ GstDebugCategory *_gst_debug_category_new (const gchar * name,
     cat = _gst_debug_category_new (name,color,description);            \
 }G_STMT_END
 
-void   gst_debug_category_free         (GstDebugCategory *     category);
-void   gst_debug_category_set_threshold (GstDebugCategory *    category,
-                                        GstDebugLevel          level);
-void   gst_debug_category_reset_threshold(GstDebugCategory *   category);
-GstDebugLevel
-       gst_debug_category_get_threshold (GstDebugCategory *    category);
-G_CONST_RETURN gchar *
-       gst_debug_category_get_name     (GstDebugCategory *     category);
-guint  gst_debug_category_get_color    (GstDebugCategory *     category);
-G_CONST_RETURN gchar *
-       gst_debug_category_get_description (GstDebugCategory *  category);
-GSList *
-        gst_debug_get_all_categories   (void);
-
-/* do not use this function, use the GST_DEBUG_CATEGORY_GET macro below */
-GstDebugCategory *_gst_debug_get_category (const gchar *name);
-
 /**
  * GST_DEBUG_CATEGORY_GET:
  * @cat: the category to initialize.
  * @name: log category name
  *
- * Lookup an exiting #GstDebugCategory by its @name and sets @cat. If category
- * is not found, but GST_CAT_DEFAULT is defined, that is assigned to @cat.
- * Otherwise cat will be NULL.
+ * Looks up an existing #GstDebugCategory by its @name and sets @cat. If the
+ * category is not found, but GST_CAT_DEFAULT is defined, that is assigned to
+ * @cat. Otherwise @cat will be NULL.
  *
  * |[
  * GST_DEBUG_CATEGORY_STATIC (gst_myplugin_debug);
@@ -427,7 +502,7 @@ GstDebugCategory *_gst_debug_get_category (const gchar *name);
  * GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE);
  * ...
  * GST_DEBUG_CATEGORY_INIT (gst_myplugin_debug, "myplugin", 0, "nice element");
- * GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "performance");
+ * GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "GST_PERFORMANCE");
  * ]|
  *
  * Since: 0.10.24
@@ -445,11 +520,6 @@ GstDebugCategory *_gst_debug_get_category (const gchar *name);
 }G_STMT_END
 #endif
 
-
-gchar * gst_debug_construct_term_color (guint colorinfo);
-gint    gst_debug_construct_win_color (guint colorinfo);
-
-
 /**
  * GST_CAT_DEFAULT:
  *
@@ -461,7 +531,7 @@ extern gboolean                     __gst_debug_enabled;
 
 /* since 0.10.7, the min debug level, used for quickly discarding debug
  * messages that fall under the threshold. */
-GST_EXPORT GstDebugLevel            __gst_debug_min; 
+GST_EXPORT GstDebugLevel            __gst_debug_min;
 
 /**
  * GST_CAT_LEVEL_LOG:
@@ -474,19 +544,41 @@ GST_EXPORT GstDebugLevel            __gst_debug_min;
  * debugging messages. You will probably want to use one of the ones described
  * below.
  */
+#if defined(GST_USING_PRINTF_EXTENSION) && defined(G_HAVE_GNUC_VARARGS)
+#define GST_CAT_LEVEL_LOG_obj(cat,level,object,str,args...) G_STMT_START{  \
+  if (G_UNLIKELY (level <= __gst_debug_min)) {                             \
+    const GstDebugTraceLocation loc = GST_DEBUG_TRACE_LOCATION();          \
+    gst_debug_log2 ((cat), (level), &loc, NULL, "%"GST_PTR_FORMAT" "str,   \
+        (object), ##args );                                                \
+  }                                                                        \
+}G_STMT_END
+#define GST_CAT_LEVEL_LOG_noobj(cat,level,object,str,args...) G_STMT_START{\
+  if (G_UNLIKELY (level <= __gst_debug_min)) {                             \
+    const GstDebugTraceLocation loc = GST_DEBUG_TRACE_LOCATION();          \
+    gst_debug_log2 ((cat), (level), &loc, NULL, (str), ##args );           \
+  }                                                                        \
+}G_STMT_END
+#else
+#  define GST_CAT_LEVEL_LOG_obj   GST_CAT_LEVEL_LOG
+#  define GST_CAT_LEVEL_LOG_noobj GST_CAT_LEVEL_LOG
+#endif
+
+
 #ifdef G_HAVE_ISO_VARARGS
 #define GST_CAT_LEVEL_LOG(cat,level,object,...) G_STMT_START{          \
-  if (G_UNLIKELY (level <= __gst_debug_min)) {                                         \
-    gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__,   \
-        (GObject *) (object), __VA_ARGS__);                            \
+  if (G_UNLIKELY (level <= __gst_debug_min)) { \
+       const GstDebugTraceLocation loc = GST_DEBUG_TRACE_LOCATION();   \
+    gst_debug_log2 ((cat), (level), &loc, (GObject *) (object),                \
+            __VA_ARGS__);                                                                                      \
   }                                                                    \
 }G_STMT_END
 #else /* G_HAVE_GNUC_VARARGS */
 #ifdef G_HAVE_GNUC_VARARGS
 #define GST_CAT_LEVEL_LOG(cat,level,object,args...) G_STMT_START{      \
   if (G_UNLIKELY (level <= __gst_debug_min)) {                                         \
-    gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__,   \
-        (GObject *) (object), ##args );                                        \
+    const GstDebugTraceLocation loc = GST_DEBUG_TRACE_LOCATION();      \
+    gst_debug_log2 ((cat), (level), &loc, (GObject *) (object),                \
+            ##args );                                                                                      \
   }                                                                    \
 }G_STMT_END
 #else /* no variadic macros, use inline */
@@ -513,11 +605,6 @@ GST_CAT_LEVEL_LOG (GstDebugCategory * cat, GstDebugLevel level,
 #endif
 #endif /* G_HAVE_ISO_VARARGS */
 
-/* private helper function */
-void _gst_debug_dump_mem (GstDebugCategory * cat, const gchar * file,
-    const gchar * func, gint line, GObject * obj, const gchar * msg,
-    const guint8 * data, guint length);
-
 /* This one doesn't have varargs in the macro, so it's different than all the
  * other macros and hence in a separate block right here. Docs chunks are
  * with the other doc chunks below though. */
@@ -588,6 +675,17 @@ void _gst_debug_dump_mem (GstDebugCategory * cat, const gchar * file,
  *
  * Since: 0.10.23
  */
+/**
+ * GST_CAT_TRACE_OBJECT:
+ * @cat: category to use
+ * @obj: the #GObject the message belongs to
+ * @...: printf-style message to output
+ *
+ * Output a tracing message belonging to the given object in the given
+ * category.
+ *
+ * Since: 0.10.30
+ */
 /**
  * GST_CAT_MEMDUMP_OBJECT:
  * @cat: category to use
@@ -647,6 +745,15 @@ void _gst_debug_dump_mem (GstDebugCategory * cat, const gchar * file,
  *
  * Since: 0.10.23
  */
+/**
+ * GST_CAT_TRACE:
+ * @cat: category to use
+ * @...: printf-style message to output
+ *
+ * Output a tracing message in the given category.
+ *
+ * Since: 0.10.30
+ */
 /**
  * GST_CAT_MEMDUMP:
  * @cat: category to use
@@ -702,10 +809,19 @@ void _gst_debug_dump_mem (GstDebugCategory * cat, const gchar * file,
  * @obj: the #GObject the message belongs to
  * @...: printf-style message to output
  *
- * Output a logging message belonging to the given object in the default category.
+ * Output a fixme message belonging to the given object in the default category.
  *
  * Since: 0.10.23
  */
+/**
+ * GST_TRACE_OBJECT:
+ * @obj: the #GObject the message belongs to
+ * @...: printf-style message to output
+ *
+ * Output a tracing message belonging to the given object in the default category.
+ *
+ * Since: 0.10.30
+ */
 /**
  * GST_MEMDUMP_OBJECT:
  * @obj: the #GObject the message belongs to
@@ -757,6 +873,14 @@ void _gst_debug_dump_mem (GstDebugCategory * cat, const gchar * file,
  *
  * Since: 0.10.23
  */
+/**
+ * GST_TRACE:
+ * @...: printf-style message to output
+ *
+ * Output a tracing message in the default category.
+ *
+ * Since: 0.10.30
+ */
 /**
  * GST_MEMDUMP:
  * @msg: message string to log with the data
@@ -776,6 +900,7 @@ void _gst_debug_dump_mem (GstDebugCategory * cat, const gchar * file,
 #define GST_CAT_DEBUG_OBJECT(cat,obj,...)      GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG,   obj,  __VA_ARGS__)
 #define GST_CAT_LOG_OBJECT(cat,obj,...)                GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG,     obj,  __VA_ARGS__)
 #define GST_CAT_FIXME_OBJECT(cat,obj,...)      GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME,   obj,  __VA_ARGS__)
+#define GST_CAT_TRACE_OBJECT(cat,obj,...)      GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE,   obj,  __VA_ARGS__)
 
 #define GST_CAT_ERROR(cat,...)                 GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR,   NULL, __VA_ARGS__)
 #define GST_CAT_WARNING(cat,...)               GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
@@ -783,6 +908,7 @@ void _gst_debug_dump_mem (GstDebugCategory * cat, const gchar * file,
 #define GST_CAT_DEBUG(cat,...)                 GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG,   NULL, __VA_ARGS__)
 #define GST_CAT_LOG(cat,...)                   GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG,     NULL, __VA_ARGS__)
 #define GST_CAT_FIXME(cat,...)                 GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME,   NULL, __VA_ARGS__)
+#define GST_CAT_TRACE(cat,...)         GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE,   NULL, __VA_ARGS__)
 
 #define GST_ERROR_OBJECT(obj,...)      GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR,   obj,  __VA_ARGS__)
 #define GST_WARNING_OBJECT(obj,...)    GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj,  __VA_ARGS__)
@@ -790,6 +916,7 @@ void _gst_debug_dump_mem (GstDebugCategory * cat, const gchar * file,
 #define GST_DEBUG_OBJECT(obj,...)      GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   obj,  __VA_ARGS__)
 #define GST_LOG_OBJECT(obj,...)                GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG,     obj,  __VA_ARGS__)
 #define GST_FIXME_OBJECT(obj,...)      GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME,   obj,  __VA_ARGS__)
+#define GST_TRACE_OBJECT(obj,...)      GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE,   obj,  __VA_ARGS__)
 
 #define GST_ERROR(...)                 GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR,   NULL, __VA_ARGS__)
 #define GST_WARNING(...)               GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
@@ -797,6 +924,7 @@ void _gst_debug_dump_mem (GstDebugCategory * cat, const gchar * file,
 #define GST_DEBUG(...)                 GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   NULL, __VA_ARGS__)
 #define GST_LOG(...)                   GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG,     NULL, __VA_ARGS__)
 #define GST_FIXME(...)                 GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME,   NULL, __VA_ARGS__)
+#define GST_TRACE(...)         GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE,   NULL, __VA_ARGS__)
 
 #else
 #ifdef G_HAVE_GNUC_VARARGS
@@ -807,6 +935,7 @@ void _gst_debug_dump_mem (GstDebugCategory * cat, const gchar * file,
 #define GST_CAT_DEBUG_OBJECT(cat,obj,args...)  GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG,   obj,  ##args )
 #define GST_CAT_LOG_OBJECT(cat,obj,args...)    GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG,     obj,  ##args )
 #define GST_CAT_FIXME_OBJECT(cat,obj,args...)  GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME,   obj,  ##args )
+#define GST_CAT_TRACE_OBJECT(cat,obj,args...)  GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE,   obj,  ##args )
 
 #define GST_CAT_ERROR(cat,args...)             GST_CAT_LEVEL_LOG (cat, GST_LEVEL_ERROR,   NULL, ##args )
 #define GST_CAT_WARNING(cat,args...)           GST_CAT_LEVEL_LOG (cat, GST_LEVEL_WARNING, NULL, ##args )
@@ -814,6 +943,7 @@ void _gst_debug_dump_mem (GstDebugCategory * cat, const gchar * file,
 #define GST_CAT_DEBUG(cat,args...)             GST_CAT_LEVEL_LOG (cat, GST_LEVEL_DEBUG,   NULL, ##args )
 #define GST_CAT_LOG(cat,args...)               GST_CAT_LEVEL_LOG (cat, GST_LEVEL_LOG,     NULL, ##args )
 #define GST_CAT_FIXME(cat,args...)             GST_CAT_LEVEL_LOG (cat, GST_LEVEL_FIXME,   NULL, ##args )
+#define GST_CAT_TRACE(cat,args...)             GST_CAT_LEVEL_LOG (cat, GST_LEVEL_TRACE,   NULL, ##args )
 
 #define GST_ERROR_OBJECT(obj,args...)  GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR,   obj,  ##args )
 #define GST_WARNING_OBJECT(obj,args...)        GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, obj,  ##args )
@@ -821,6 +951,7 @@ void _gst_debug_dump_mem (GstDebugCategory * cat, const gchar * file,
 #define GST_DEBUG_OBJECT(obj,args...)  GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   obj,  ##args )
 #define GST_LOG_OBJECT(obj,args...)    GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG,     obj,  ##args )
 #define GST_FIXME_OBJECT(obj,args...)  GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME,   obj,  ##args )
+#define GST_TRACE_OBJECT(obj,args...)  GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE,   obj,  ##args )
 
 #define GST_ERROR(args...)             GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR,   NULL, ##args )
 #define GST_WARNING(args...)           GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, ##args )
@@ -828,6 +959,7 @@ void _gst_debug_dump_mem (GstDebugCategory * cat, const gchar * file,
 #define GST_DEBUG(args...)             GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG,   NULL, ##args )
 #define GST_LOG(args...)               GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG,     NULL, ##args )
 #define GST_FIXME(args...)             GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_FIXME,   NULL, ##args )
+#define GST_TRACE(args...)             GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE,   NULL, ##args )
 
 #else
 /* no variadic macros, use inline */
@@ -897,6 +1029,17 @@ GST_CAT_FIXME_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
   va_end (varargs);
 }
 
+static inline void
+GST_CAT_TRACE_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
+    ...)
+{
+  va_list varargs;
+
+  va_start (varargs, format);
+  GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_TRACE, obj, format, varargs);
+  va_end (varargs);
+}
+
 static inline void
 GST_CAT_ERROR (GstDebugCategory * cat, const char *format, ...)
 {
@@ -957,6 +1100,16 @@ GST_CAT_FIXME (GstDebugCategory * cat, const char *format, ...)
   va_end (varargs);
 }
 
+static inline void
+GST_CAT_TRACE (GstDebugCategory * cat, const char *format, ...)
+{
+  va_list varargs;
+
+  va_start (varargs, format);
+  GST_CAT_LEVEL_LOG_valist (cat, GST_LEVEL_TRACE, NULL, format, varargs);
+  va_end (varargs);
+}
+
 static inline void
 GST_ERROR_OBJECT (gpointer obj, const char *format, ...)
 {
@@ -1023,6 +1176,17 @@ GST_FIXME_OBJECT (gpointer obj, const char *format, ...)
   va_end (varargs);
 }
 
+static inline void
+GST_TRACE_OBJECT (gpointer obj, const char *format, ...)
+{
+  va_list varargs;
+
+  va_start (varargs, format);
+  GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_TRACE, obj, format,
+      varargs);
+  va_end (varargs);
+}
+
 static inline void
 GST_ERROR (const char *format, ...)
 {
@@ -1088,18 +1252,23 @@ GST_FIXME (const char *format, ...)
       varargs);
   va_end (varargs);
 }
+
+static inline void
+GST_TRACE (const char *format, ...)
+{
+  va_list varargs;
+
+  va_start (varargs, format);
+  GST_CAT_LEVEL_LOG_valist (GST_CAT_DEFAULT, GST_LEVEL_TRACE, NULL, format,
+      varargs);
+  va_end (varargs);
+}
 #endif
 #endif
 
 
 /********** function pointer stuff **********/
 
-typedef        void (* GstDebugFuncPtr)        (void);
-void   _gst_debug_register_funcptr     (GstDebugFuncPtr        func,
-                                        const gchar *          ptrname);
-G_CONST_RETURN gchar *
-       _gst_debug_nameof_funcptr       (GstDebugFuncPtr        func);
-
 /**
  * GST_DEBUG_REGISTER_FUNCPTR:
  * @ptr: pointer to the function to register
@@ -1146,6 +1315,7 @@ G_CONST_RETURN gchar *
 
 #if defined(__GNUC__) && __GNUC__ >= 3
 #  pragma GCC poison gst_debug_log
+#  pragma GCC poison gst_debug_log2
 #  pragma GCC poison gst_debug_log_valist
 #  pragma GCC poison _gst_debug_category_new
 #endif
@@ -1160,8 +1330,6 @@ G_CONST_RETURN gchar *
 #define gst_debug_level_get_name(level)                                ("NONE")
 #define gst_debug_message_get(message)                         ("")
 #define gst_debug_add_log_function(func,data)          G_STMT_START{ }G_STMT_END
-guint gst_debug_remove_log_function (GstLogFunction func);
-guint gst_debug_remove_log_function_by_data (gpointer data);
 #define gst_debug_set_active(active)                   G_STMT_START{ }G_STMT_END
 #define gst_debug_is_active()                          (FALSE)
 #define gst_debug_set_colored(colored)                 G_STMT_START{ }G_STMT_END
@@ -1171,13 +1339,12 @@ guint gst_debug_remove_log_function_by_data (gpointer data);
 #define gst_debug_set_threshold_for_name(name,level)   G_STMT_START{ }G_STMT_END
 #define gst_debug_unset_threshold_for_name(name)       G_STMT_START{ }G_STMT_END
 
-#define GST_DEBUG_CATEGORY(var)                                void _gst_dummy_declaration (void)
-#define GST_DEBUG_CATEGORY_EXTERN(var)                 void _gst_dummy_declaration (void)
-#if !defined(G_HAVE_GNUC_VARARGS) && !defined(G_HAVE_ISO_VARARGS)
-#define GST_DEBUG_CATEGORY_STATIC(var)                 static GstDebugCategory *var = NULL
-#else
-#define GST_DEBUG_CATEGORY_STATIC(var)                 void _gst_dummy_declaration (void)
-#endif
+/* we are using dummy function prototypes here to eat ';' as these macros are
+ * used outside of functions */
+#define GST_DEBUG_CATEGORY(var)                                void _gst_debug_dummy_##var (void)
+#define GST_DEBUG_CATEGORY_EXTERN(var)                 void _gst_debug_dummy_extern_##var (void)
+#define GST_DEBUG_CATEGORY_STATIC(var)                 void _gst_debug_dummy_static_##var (void)
+
 #define GST_DEBUG_CATEGORY_INIT(var,name,color,desc)   G_STMT_START{ }G_STMT_END
 #define GST_DEBUG_CATEGORY_GET(var,name)               G_STMT_START{ }G_STMT_END
 #define gst_debug_category_free(category)              G_STMT_START{ }G_STMT_END
@@ -1203,6 +1370,7 @@ guint gst_debug_remove_log_function_by_data (gpointer data);
 #define GST_CAT_DEBUG_OBJECT(...)                      G_STMT_START{ }G_STMT_END
 #define GST_CAT_LOG_OBJECT(...)                                G_STMT_START{ }G_STMT_END
 #define GST_CAT_FIXME_OBJECT(...)                      G_STMT_START{ }G_STMT_END
+#define GST_CAT_TRACE_OBJECT(...)                      G_STMT_START{ }G_STMT_END
 
 #define GST_CAT_ERROR(...)                             G_STMT_START{ }G_STMT_END
 #define GST_CAT_WARNING(...)                           G_STMT_START{ }G_STMT_END
@@ -1210,6 +1378,7 @@ guint gst_debug_remove_log_function_by_data (gpointer data);
 #define GST_CAT_DEBUG(...)                             G_STMT_START{ }G_STMT_END
 #define GST_CAT_LOG(...)                               G_STMT_START{ }G_STMT_END
 #define GST_CAT_FIXME(...)                             G_STMT_START{ }G_STMT_END
+#define GST_CAT_TRACE(...)                             G_STMT_START{ }G_STMT_END
 
 #define GST_ERROR_OBJECT(...)                          G_STMT_START{ }G_STMT_END
 #define GST_WARNING_OBJECT(...)                                G_STMT_START{ }G_STMT_END
@@ -1217,6 +1386,7 @@ guint gst_debug_remove_log_function_by_data (gpointer data);
 #define GST_DEBUG_OBJECT(...)                          G_STMT_START{ }G_STMT_END
 #define GST_LOG_OBJECT(...)                            G_STMT_START{ }G_STMT_END
 #define GST_FIXME_OBJECT(...)                          G_STMT_START{ }G_STMT_END
+#define GST_TRACE_OBJECT(...)                          G_STMT_START{ }G_STMT_END
 
 #define GST_ERROR(...)                                 G_STMT_START{ }G_STMT_END
 #define GST_WARNING(...)                               G_STMT_START{ }G_STMT_END
@@ -1224,6 +1394,7 @@ guint gst_debug_remove_log_function_by_data (gpointer data);
 #define GST_DEBUG(...)                                 G_STMT_START{ }G_STMT_END
 #define GST_LOG(...)                                   G_STMT_START{ }G_STMT_END
 #define GST_FIXME(...)                                 G_STMT_START{ }G_STMT_END
+#define GST_TRACE(...)                                 G_STMT_START{ }G_STMT_END
 
 #else /* !G_HAVE_ISO_VARARGS */
 #ifdef G_HAVE_GNUC_VARARGS
@@ -1236,6 +1407,7 @@ guint gst_debug_remove_log_function_by_data (gpointer data);
 #define GST_CAT_DEBUG_OBJECT(args...)                  G_STMT_START{ }G_STMT_END
 #define GST_CAT_LOG_OBJECT(args...)                    G_STMT_START{ }G_STMT_END
 #define GST_CAT_FIXME_OBJECT(args...)                  G_STMT_START{ }G_STMT_END
+#define GST_CAT_TRACE_OBJECT(args...)                  G_STMT_START{ }G_STMT_END
 
 #define GST_CAT_ERROR(args...)                         G_STMT_START{ }G_STMT_END
 #define GST_CAT_WARNING(args...)                       G_STMT_START{ }G_STMT_END
@@ -1243,6 +1415,7 @@ guint gst_debug_remove_log_function_by_data (gpointer data);
 #define GST_CAT_DEBUG(args...)                         G_STMT_START{ }G_STMT_END
 #define GST_CAT_LOG(args...)                           G_STMT_START{ }G_STMT_END
 #define GST_CAT_FIXME(args...)                         G_STMT_START{ }G_STMT_END
+#define GST_CAT_TRACE(args...)                         G_STMT_START{ }G_STMT_END
 
 #define GST_ERROR_OBJECT(args...)                      G_STMT_START{ }G_STMT_END
 #define GST_WARNING_OBJECT(args...)                    G_STMT_START{ }G_STMT_END
@@ -1250,6 +1423,7 @@ guint gst_debug_remove_log_function_by_data (gpointer data);
 #define GST_DEBUG_OBJECT(args...)                      G_STMT_START{ }G_STMT_END
 #define GST_LOG_OBJECT(args...)                                G_STMT_START{ }G_STMT_END
 #define GST_FIXME_OBJECT(args...)                      G_STMT_START{ }G_STMT_END
+#define GST_TRACE_OBJECT(args...)                      G_STMT_START{ }G_STMT_END
 
 #define GST_ERROR(args...)                             G_STMT_START{ }G_STMT_END
 #define GST_WARNING(args...)                           G_STMT_START{ }G_STMT_END
@@ -1257,6 +1431,7 @@ guint gst_debug_remove_log_function_by_data (gpointer data);
 #define GST_DEBUG(args...)                             G_STMT_START{ }G_STMT_END
 #define GST_LOG(args...)                               G_STMT_START{ }G_STMT_END
 #define GST_FIXME(args...)                             G_STMT_START{ }G_STMT_END
+#define GST_TRACE(args...)                             G_STMT_START{ }G_STMT_END
 
 #else /* !G_HAVE_GNUC_VARARGS */
 static inline void
@@ -1301,6 +1476,12 @@ GST_CAT_FIXME_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
 {
 }
 
+static inline void
+GST_CAT_TRACE_OBJECT (GstDebugCategory * cat, gpointer obj, const char *format,
+    ...)
+{
+}
+
 static inline void
 GST_CAT_ERROR (GstDebugCategory * cat, const char *format, ...)
 {
@@ -1331,6 +1512,11 @@ GST_CAT_FIXME (GstDebugCategory * cat, const char *format, ...)
 {
 }
 
+static inline void
+GST_CAT_TRACE (GstDebugCategory * cat, const char *format, ...)
+{
+}
+
 static inline void
 GST_ERROR_OBJECT (gpointer obj, const char *format, ...)
 {
@@ -1361,6 +1547,11 @@ GST_FIXME_OBJECT (gpointer obj, const char *format, ...)
 {
 }
 
+static inline void
+GST_TRACE_OBJECT (gpointer obj, const char *format, ...)
+{
+}
+
 static inline void
 GST_ERROR (const char *format, ...)
 {
@@ -1391,6 +1582,11 @@ GST_FIXME (const char *format, ...)
 {
 }
 
+static inline void
+GST_TRACE (const char *format, ...)
+{
+}
+
 #endif /* G_HAVE_GNUC_VARARGS */
 #endif /* G_HAVE_ISO_VARARGS */