[Bug 760267] tracer: how to pass and structure tracing data (GstStructure, GVariant, etc.)
GStreamer (GNOME Bugzilla)
bugzilla at gnome.org
Fri Jan 8 00:38:06 PST 2016
https://bugzilla.gnome.org/show_bug.cgi?id=760267
--- Comment #2 from Stefan Sauer (gstreamer, gtkdoc dev) <ensonic at sonicpulse.de> ---
I've tried to use GVariant. The logging could be something like:
void
gst_tracer_log_trace (const gchar *format, ...)
{
va_list var_args;
GVariant *v;
gchar *s;
va_start (var_args, format);
v = g_variant_new_va (format, NULLL, var_args);
s = g_variant_print (v, FALSE);
GST_TRACE ("%s", s);
g_free (s);
g_variant_unref (v);
va_end (var_args);
}
The issue is that GVariant is only providing very few data types. Right now
with the GstStructure we can serialize GEnums
("pad-direction=(GstPadDirection)GST_PAD_SINK"), GstFractions and many more.
Also avoiding the intermediate GVariants would be nice. Another option could
be:
void
gst_tracer_log_trace (GType *types, guint n_types, ...)
{
/* iterate over types and serialize them using GStValue. */
}
But if that hits a structure as a child (e.g. a message) it would serialize
this as we know it (with fields).
Anyway, this would only log the data. And we could log the types with the
initial spec.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list