diff options
author | Thiago Santos <thiagoss@osg.samsung.com> | 2015-09-01 16:39:30 -0300 |
---|---|---|
committer | Thiago Santos <thiagoss@osg.samsung.com> | 2015-09-01 17:21:17 -0300 |
commit | 9c2dd418eb32ff0690854603592a7a47efefaa2e (patch) | |
tree | 0c30ff4234ef7f6fc571e6e26356289b742396bf | |
parent | 759acb27c18d13a624271831ebe9a919451a20b2 (diff) |
tracers: stats: add message structure to outputtracer
The name of the message is not enough. For example, state-change
is not enough to know the transition.
-rw-r--r-- | plugins/tracers/gststats.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/plugins/tracers/gststats.c b/plugins/tracers/gststats.c index abcd1946d..6bd93ed88 100644 --- a/plugins/tracers/gststats.c +++ b/plugins/tracers/gststats.c @@ -471,13 +471,21 @@ do_post_message_pre (GstStatsTracer * self, guint64 ts, GstElement * elem, GstMessage * msg) { GstElementStats *stats = get_element_stats (self, elem); + 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; - gst_tracer_log_trace (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)); + + if ((msg_s = gst_message_get_structure (msg))) { + gst_structure_set (structure, "details", GST_TYPE_STRUCTURE, msg_s, NULL); + } + + gst_tracer_log_trace (structure); } static void @@ -592,6 +600,10 @@ gst_stats_tracer_class_init (GstStatsTracerClass * klass) "description", G_TYPE_STRING, "name of the message", "flags", G_TYPE_STRING, "", /* TODO: use gflags */ NULL), + "structure", GST_TYPE_STRUCTURE, gst_structure_new ("structure", + "type", G_TYPE_GTYPE, GST_TYPE_STRUCTURE, + "description", G_TYPE_STRING, "message details", + NULL), NULL)); gst_tracer_log_trace (gst_structure_new ("elementquery.class", "thread-id", GST_TYPE_STRUCTURE, gst_structure_new ("scope", |