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
This commit is contained in:
Guillaume Desmottes 2017-04-13 16:28:54 +02:00 committed by Nicolas Dufresne
parent 40187f9247
commit 4670036691

View file

@ -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* */
}