build: define stubs when disabling gst-debug subsystem. Fixes #575922
authorStefan Kost <ensonic@users.sf.net>
Mon, 23 Mar 2009 13:18:21 +0000 (15:18 +0200)
committerStefan Kost <ensonic@users.sf.net>
Mon, 23 Mar 2009 14:21:58 +0000 (16:21 +0200)
Running configure with e.g. --disable-dst-debug was compiling out the debug
system (ABI break). Now stubs are added and only if one does e.g.
make CFLAGS="-DGST_REMOVE_DISABLED" the symbols are ommitted.

gst/gstdebugutils.c
gst/gstinfo.c

index e7f8ba1..9bfacf9 100644 (file)
@@ -714,5 +714,18 @@ _gst_debug_bin_to_dot_file_with_ts (GstBin * bin, GstDebugGraphDetails details,
   _gst_debug_bin_to_dot_file (bin, details, ts_file_name);
   g_free (ts_file_name);
 }
+#else /* !GST_DISABLE_GST_DEBUG */
+#ifndef GST_REMOVE_DISABLED
+void
+_gst_debug_bin_to_dot_file (GstBin * bin, GstDebugGraphDetails details,
+    const gchar * file_name)
+{
+}
 
+void
+_gst_debug_bin_to_dot_file_with_ts (GstBin * bin, GstDebugGraphDetails details,
+    const gchar * file_name)
+{
+}
+#endif /* GST_REMOVE_DISABLED */
 #endif /* GST_DISABLE_GST_DEBUG */
index 45f0e18..258fc32 100644 (file)
@@ -1469,6 +1469,57 @@ _gst_info_printf_extension_arginfo (const struct printf_info *info, size_t n,
 #endif /* HAVE_PRINTF_EXTENSION */
 
 #else /* !GST_DISABLE_GST_DEBUG */
+#ifndef GST_REMOVE_DISABLED
+void
+gst_debug_log (GstDebugCategory * category, GstDebugLevel level,
+    const gchar * file, const gchar * function, gint line,
+    GObject * object, const gchar * format, ...)
+{
+}
+
+void
+gst_debug_log_valist (GstDebugCategory * category, GstDebugLevel level,
+    const gchar * file, const gchar * function, gint line,
+    GObject * object, const gchar * format, va_list args)
+{
+}
+
+const gchar *
+gst_debug_message_get (GstDebugMessage * message)
+{
+  return "";
+}
+
+gchar *
+gst_debug_construct_term_color (guint colorinfo)
+{
+  return g_strdup ("");
+}
+
+gint
+gst_debug_construct_win_color (guint colorinfo)
+{
+  return 0;
+}
+
+void
+gst_debug_log_default (GstDebugCategory * category, GstDebugLevel level,
+    const gchar * file, const gchar * function, gint line,
+    GObject * object, GstDebugMessage * message, gpointer unused)
+{
+}
+
+const gchar *
+gst_debug_level_get_name (GstDebugLevel level)
+{
+  return "";
+}
+
+void
+gst_debug_add_log_function (GstLogFunction func, gpointer data)
+{
+}
+
 guint
 gst_debug_remove_log_function (GstLogFunction func)
 {
@@ -1486,7 +1537,7 @@ _priv_gst_in_valgrind (void)
 {
   return FALSE;
 }
-
+#endif /* GST_REMOVE_DISABLED */
 #endif /* GST_DISABLE_GST_DEBUG */