mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
tracers: stats: add message structure to output
The name of the message is not enough. For example, state-change is not enough to know the transition. https://bugzilla.gnome.org/show_bug.cgi?id=754496
This commit is contained in:
parent
72ca02b1de
commit
7c5f7173c8
1 changed files with 17 additions and 5 deletions
|
@ -471,13 +471,21 @@ do_post_message_pre (GstStatsTracer * self, guint64 ts, GstElement * elem,
|
||||||
GstMessage * msg)
|
GstMessage * msg)
|
||||||
{
|
{
|
||||||
GstElementStats *stats = get_element_stats (self, elem);
|
GstElementStats *stats = get_element_stats (self, elem);
|
||||||
|
const GstStructure *msg_s;
|
||||||
|
GstStructure *structure = gst_structure_new ("message",
|
||||||
|
"thread-id", G_TYPE_UINT, GPOINTER_TO_UINT (g_thread_self ()),
|
||||||
|
"ts", G_TYPE_UINT64, ts,
|
||||||
|
"elem-ix", G_TYPE_UINT, stats->index,
|
||||||
|
"name", G_TYPE_STRING, GST_MESSAGE_TYPE_NAME (msg),
|
||||||
|
NULL);
|
||||||
|
|
||||||
stats->last_ts = ts;
|
stats->last_ts = ts;
|
||||||
gst_tracer_log_trace (gst_structure_new ("message",
|
|
||||||
"thread-id", G_TYPE_UINT, GPOINTER_TO_UINT (g_thread_self ()),
|
if ((msg_s = gst_message_get_structure (msg))) {
|
||||||
"ts", G_TYPE_UINT64, ts,
|
gst_structure_set (structure, "structure", GST_TYPE_STRUCTURE, msg_s, NULL);
|
||||||
"elem-ix", G_TYPE_UINT, stats->index,
|
}
|
||||||
"name", G_TYPE_STRING, GST_MESSAGE_TYPE_NAME (msg), NULL));
|
|
||||||
|
gst_tracer_log_trace (structure);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -592,6 +600,10 @@ gst_stats_tracer_class_init (GstStatsTracerClass * klass)
|
||||||
"description", G_TYPE_STRING, "name of the message",
|
"description", G_TYPE_STRING, "name of the message",
|
||||||
"flags", G_TYPE_STRING, "", /* TODO: use gflags */
|
"flags", G_TYPE_STRING, "", /* TODO: use gflags */
|
||||||
NULL),
|
NULL),
|
||||||
|
"structure", GST_TYPE_STRUCTURE, gst_structure_new ("structure",
|
||||||
|
"type", G_TYPE_GTYPE, GST_TYPE_STRUCTURE,
|
||||||
|
"description", G_TYPE_STRING, "message structure",
|
||||||
|
NULL),
|
||||||
NULL));
|
NULL));
|
||||||
gst_tracer_log_trace (gst_structure_new ("elementquery.class",
|
gst_tracer_log_trace (gst_structure_new ("elementquery.class",
|
||||||
"thread-id", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
|
"thread-id", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
|
||||||
|
|
Loading…
Reference in a new issue