From: Benjamin Otte Date: Sat, 19 Feb 2005 12:59:45 +0000 (+0000) Subject: gst/gstinfo.c: make the time that debugging functions print relative to when gst_init... X-Git-Tag: BRANCH-GSTREAMER-0_6-ROOT~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=70fd76df4fb57342f59c96ef0f9c599792eb36ce;p=platform%2Fupstream%2Fgstreamer.git gst/gstinfo.c: make the time that debugging functions print relative to when gst_init was called Original commit message from CVS: * gst/gstinfo.c: (_gst_debug_init), (gst_debug_log_default): make the time that debugging functions print relative to when gst_init was called --- diff --git a/ChangeLog b/ChangeLog index c5fbd18..251c351 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-02-19 Benjamin Otte + + * gst/gstinfo.c: (_gst_debug_init), (gst_debug_log_default): + make the time that debugging functions print relative to when + gst_init was called + 2005-02-18 Tim-Philipp Müller * gst/gsttaginterface.c: diff --git a/gst/gstinfo.c b/gst/gstinfo.c index 616b81f..ac1cd08 100644 --- a/gst/gstinfo.c +++ b/gst/gstinfo.c @@ -47,6 +47,8 @@ /* underscore is to prevent conflict with GST_CAT_DEBUG define */ GST_DEBUG_CATEGORY_STATIC (_GST_CAT_DEBUG); +/* time of initialization, so we get useful debugging output times */ +GstClockTime start_time; #if 0 #if defined __sgi__ @@ -203,9 +205,15 @@ __gst_in_valgrind (void) void _gst_debug_init (void) { + GTimeVal current; + gst_atomic_int_init (&__default_level, GST_LEVEL_DEFAULT); gst_atomic_int_init (&__use_color, 1); + /* get time we started for debugging messages */ + g_get_current_time (¤t); + start_time = GST_TIMEVAL_TO_TIME (current); + #ifdef HAVE_PRINTF_EXTENSION register_printf_function (GST_PTR_FORMAT[0], _gst_info_printf_extension, _gst_info_printf_extension_arginfo); @@ -494,6 +502,7 @@ gst_debug_log_default (GstDebugCategory * category, GstDebugLevel level, gchar *pidcolor; gint pid; GTimeVal now; + GstClockTime elapsed; if (level > gst_debug_category_get_threshold (category)) return; @@ -516,10 +525,11 @@ gst_debug_log_default (GstDebugCategory * category, GstDebugLevel level, obj = object ? gst_debug_print_object (object) : g_strdup (""); g_get_current_time (&now); + elapsed = GST_TIMEVAL_TO_TIME (now) - start_time; g_printerr ("%s (%p - %" GST_TIME_FORMAT ") %s%15s%s(%s%5d%s) %s%s(%d):%s:%s%s %s\n", gst_debug_level_get_name (level), g_thread_self (), - GST_TIME_ARGS (GST_TIMEVAL_TO_TIME (now)), color, + GST_TIME_ARGS (elapsed), color, gst_debug_category_get_name (category), clear, pidcolor, pid, clear, color, file, line, function, obj, clear, gst_debug_message_get (message));