Commit graph

10 commits

Author SHA1 Message Date
Sebastian Dröge
c904e00661 tracerrecord: Remove useless NULL check and add assertion for making assumptions explicit
gst_structure_new_empty() is not returning NULL in any valid scenarios,
checking for NULL here is useless. Especially because we would dereference any
NULL right after the NULL check again.
CID 1352037.

We previously check if the string ends on .class, as such strrchr() should
return something non-NULL. Add an assertion for that.
CID 1349642.
2016-03-02 10:37:09 +02:00
Stefan Sauer
ec75b68984 tracerrecord: don't leak the spec structures
Change the gst_tracer_record_new() api to take the parameters the make the
spec structure directly. This allows us to own the top-level structure and
also collect the args so that we can take ownership of the sub-structures.

https://bugzilla.gnome.org/show_bug.cgi?id=760821
2016-01-22 10:07:26 +01:00
Vineeth TM
7738236968 tracerrecord: Fix self->spec structure invalid free
self->spec is got using g_value_get_boxed(), which is a transfer none function.
So the same should not be freed, which is resulting in wrong behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=760821
2016-01-20 09:28:07 +01:00
Vineeth TM
fc02815459 tracerrecord: Initialise flags to avoid wrong comparision
GstTracerValueFlags is not being initialized and the same could result in wrong
comparision and behavior. Hence initializing it to GST_TRACER_VALUE_FLAGS_NONE.

https://bugzilla.gnome.org/show_bug.cgi?id=760821
2016-01-20 09:25:44 +01:00
Luis de Bethencourt
227c387b43 tracerrecord: avoid overwriting value
res value is overwritten, remove the assignment.
priv__gst_structure_append_template_to_gstring () always returns TRUE
anyway.

CID 1349645
2016-01-19 12:04:19 +00:00
Edward Hervey
128760f246 tracerrecord: Disable logging if GST_DISABLE_GST_DEBUG
Make the gst_tracer_record_log() a no-op if the gst-debug subsystem
is disabled.
2016-01-19 11:12:21 +01:00
Stefan Sauer
af91d23204 tracer: use the new flags to create the optional field in the format string
This spares us explicitly listing the field in the spec. and thus hide this
implementation detail.
2016-01-16 19:21:00 +01:00
Tim-Philipp Müller
8b88fc487f gst.h: Don't spew warnings if GST_USE_UNSTABLE_API is not defined
Only hide GstTracer and GstTracerRecord API behind GST_USE_UNSTABLE_API,
but don't spew any warnings, otherwise everyone has to define this
to avoid compiler warnings.

This reverts parts of commit 89ee5d948d.
2016-01-16 16:00:16 +00:00
Stefan Sauer
89ee5d948d tracer: add a GFlag for the tracer scope
Port all tracers. Add the GST_USE_UNSTABLE_API flag to the internal CFLAGS so
that we don't have to specify this for gir, docs, mkenum, ...
2016-01-16 13:31:51 +01:00
Stefan Sauer
10b78d872b tracerrecord: add a log record class
We use this class to register tracer log entry metadata and build a log
template. With the log template we can serialize log data very efficiently.
This also simplifies the logging code, since that is now a simple varargs
function that is not exposing the implementation details.

Add docs for the new class and basic tests.

Remove the previous log handler.

Fixes #760267
2016-01-15 21:54:01 +01:00