gst-stats: format latency as GST_TIME
authorGuillaume Desmottes <guillaume.desmottes@collabora.com>
Thu, 25 Apr 2019 05:11:54 +0000 (10:41 +0530)
committerSebastian Dröge <slomo@coaxion.net>
Thu, 25 Apr 2019 06:28:26 +0000 (06:28 +0000)
Latency is easier to read when formatted as time rather than displayed
as a flat number in ns.
Especially when displaying GST_CLOCK_TIME_NONE which is now formated as
99:99:99.999999999 instead of 18446744073709551615.

tools/gst-stats.c

index 5c57f85..17868b7 100644 (file)
@@ -124,16 +124,17 @@ typedef struct
 static void
 latencies_foreach_print_stats (gchar * key, GstLatencyStats * ls, gpointer data)
 {
-  printf ("\t%s: mean=%" G_GUINT64_FORMAT " min=%" G_GUINT64_FORMAT " max=%"
-      G_GUINT64_FORMAT "\n", key, ls->total / ls->count, ls->min, ls->max);
+  printf ("\t%s: mean=%" GST_TIME_FORMAT " min=%" GST_TIME_FORMAT " max=%"
+      GST_TIME_FORMAT "\n", key, GST_TIME_ARGS (ls->total / ls->count),
+      GST_TIME_ARGS (ls->min), GST_TIME_ARGS (ls->max));
 }
 
 static void
 reported_latencies_foreach_print_stats (GstReportedLatency * rl, gpointer data)
 {
-  printf ("\t%s: min=%" G_GUINT64_FORMAT " max=%" G_GUINT64_FORMAT " ts=%"
-      GST_TIME_FORMAT "\n", rl->element, rl->min,
-      rl->max, GST_TIME_ARGS (rl->ts));
+  printf ("\t%s: min=%" GST_TIME_FORMAT " max=%" GST_TIME_FORMAT " ts=%"
+      GST_TIME_FORMAT "\n", rl->element, GST_TIME_ARGS (rl->min),
+      GST_TIME_ARGS (rl->max), GST_TIME_ARGS (rl->ts));
 }
 
 static void