From 4670036691a329cc1b42696ea6797a8b56ed2a91 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 13 Apr 2017 16:28:54 +0200 Subject: [PATCH] latency tracer: add timestamp to tracer records Include the timestamp of the recorded log as in the 'stats' tracer. This can be useful, for example, to plot a graph showing the latency over time. https://bugzilla.gnome.org/show_bug.cgi?id=781315 --- plugins/tracers/gstlatency.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/tracers/gstlatency.c b/plugins/tracers/gstlatency.c index 2d2123035d..a32b517918 100644 --- a/plugins/tracers/gstlatency.c +++ b/plugins/tracers/gstlatency.c @@ -106,7 +106,7 @@ log_latency (const GstStructure * data, GstPad * sink_pad, guint64 sink_ts) sink = g_strdup_printf ("%s_%s", GST_DEBUG_PAD_NAME (sink_pad)); gst_tracer_record_log (tr_latency, src, sink, - GST_CLOCK_DIFF (src_ts, sink_ts)); + GST_CLOCK_DIFF (src_ts, sink_ts), sink_ts); g_free (src); g_free (sink); } @@ -216,6 +216,12 @@ gst_latency_tracer_class_init (GstLatencyTracerClass * klass) "min", G_TYPE_UINT64, G_GUINT64_CONSTANT (0), "max", G_TYPE_UINT64, G_MAXUINT64, NULL), + "ts", GST_TYPE_STRUCTURE, gst_structure_new ("value", + "type", G_TYPE_GTYPE, G_TYPE_UINT64, + "description", G_TYPE_STRING, "ts when the latency has been logged", + "min", G_TYPE_UINT64, G_GUINT64_CONSTANT (0), + "max", G_TYPE_UINT64, G_MAXUINT64, + NULL), NULL); /* *INDENT-ON* */ }