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, ...
This commit is contained in:
Stefan Sauer 2016-01-16 13:24:16 +01:00
parent 485b15d8a9
commit 89ee5d948d
13 changed files with 55 additions and 49 deletions

View file

@ -922,8 +922,8 @@ dnl - src and build dirs need to be added because every piece that gets built
dnl will need the GStreamer source and generated headers
dnl LIBS: XML doesn't need to be added because we don't explicitly use symbols
dnl from LibXML except for in the core library
GST_ALL_CXXFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir)/libs -I\$(top_builddir) $GLIB_CFLAGS \$(GLIB_EXTRA_CFLAGS) $XML_CFLAGS \$(GST_OPTION_CXXFLAGS) \$(ERROR_CXXFLAGS)"
GST_ALL_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir)/libs -I\$(top_builddir) $GLIB_CFLAGS \$(GLIB_EXTRA_CFLAGS) $XML_CFLAGS \$(GST_OPTION_CFLAGS) \$(ERROR_CFLAGS)"
GST_ALL_CXXFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir)/libs -I\$(top_builddir) $GLIB_CFLAGS \$(GLIB_EXTRA_CFLAGS) $XML_CFLAGS \$(GST_OPTION_CXXFLAGS) \$(ERROR_CXXFLAGS) -DGST_USE_UNSTABLE_API"
GST_ALL_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir)/libs -I\$(top_builddir) $GLIB_CFLAGS \$(GLIB_EXTRA_CFLAGS) $XML_CFLAGS \$(GST_OPTION_CFLAGS) \$(ERROR_CFLAGS) -DGST_USE_UNSTABLE_API"
dnl FIXME: check if LTLIBINTL is needed everywhere
dnl I presume it is given that it contains the symbols that _() stuff maps to

View file

@ -75,7 +75,7 @@ extra_files = gst-universe.dot
# CFLAGS and LDFLAGS for compiling scan program. Only needed if your app/lib
# contains GtkObjects/GObjects and you want to document signals and properties.
GTKDOC_CFLAGS = $(GST_OBJ_CFLAGS) -DGST_USE_UNSTABLE_API
GTKDOC_CFLAGS = $(GST_OBJ_CFLAGS)
GTKDOC_LIBS = $(GST_OBJ_LIBS) \
$(top_builddir)/gst/libgstreamer-@GST_API_VERSION@.la \
$(top_builddir)/libs/gst/base/libgstbase-@GST_API_VERSION@.la \

View file

@ -78,6 +78,7 @@
#include <gst/gsttoc.h>
#include <gst/gsttocsetter.h>
#include <gst/gsttracerfactory.h>
#include <gst/gsttracerrecord.h>
#include <gst/gsttypefind.h>
#include <gst/gsttypefindfactory.h>
#include <gst/gsturi.h>

View file

@ -31,8 +31,6 @@
* Since: 1.8
*/
#define GST_USE_UNSTABLE_API
#include "gst_private.h"
#include "gstenumtypes.h"
#include "gsttracer.h"

View file

@ -29,8 +29,6 @@
* Since: 1.8
*/
#define GST_USE_UNSTABLE_API
#include "gst_private.h"
#include "gstinfo.h"
#include "gststructure.h"

View file

@ -52,6 +52,27 @@ void gst_tracer_record_log (GstTracerRecord *self, ...);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstTracerRecord, gst_object_unref)
#endif
/**
* GstTracerValueScope:
* @GST_TRACER_VALUE_SCOPE_PROCESS: the value is related to the process
* @GST_TRACER_VALUE_SCOPE_THREAD: the value is related to a thread
* @GST_TRACER_VALUE_SCOPE_ELEMENT: the value is related to an #GstElement
* @GST_TRACER_VALUE_SCOPE_PAD: the value is related to a #GstPad
*
* Tracing record will contain fields that contain a meassured value or extra
* meta-data. One such meta data are values that tell where a measurement was
* taken. This enumerating declares to which scope such a meta data field
* relates to. If it is e.g. %GST_TRACER_VALUE_SCOPE_PAD, then each of the log
* events may contain values for different #GstPads.
*/
typedef enum
{
GST_TRACER_VALUE_SCOPE_PROCESS,
GST_TRACER_VALUE_SCOPE_THREAD,
GST_TRACER_VALUE_SCOPE_ELEMENT,
GST_TRACER_VALUE_SCOPE_PAD
} GstTracerValueScope;
G_END_DECLS
#endif /* __GST_TRACER_RECORD_H__ */

View file

@ -30,8 +30,6 @@
* to a ';' separated list of tracers.
*/
#define GST_USE_UNSTABLE_API
#include "gst_private.h"
#include "gsttracer.h"
#include "gsttracerfactory.h"

View file

@ -23,8 +23,7 @@ libgstcoretracers_la_SOURCES = \
gststats.c \
gsttracers.c
libgstcoretracers_la_CFLAGS = $(GST_OBJ_CFLAGS) \
-DGST_USE_UNSTABLE_API
libgstcoretracers_la_CFLAGS = $(GST_OBJ_CFLAGS)
libgstcoretracers_la_LIBADD = \
$(GST_PRINTF_LA) \
$(GST_OBJ_LIBS)

View file

@ -38,7 +38,6 @@
#endif
#include "gstlatency.h"
#include <gst/gsttracerrecord.h>
GST_DEBUG_CATEGORY_STATIC (gst_latency_debug);
#define GST_CAT_DEFAULT gst_latency_debug
@ -207,11 +206,11 @@ gst_latency_tracer_class_init (GstLatencyTracerClass * klass)
tr_latency = gst_tracer_record_new (gst_structure_new ("latency.class",
"src", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_STRING,
"related-to", G_TYPE_STRING, "pad", /* TODO: use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_PAD,
NULL),
"sink", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_STRING,
"related-to", G_TYPE_STRING, "pad", /* TODO: use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_PAD,
NULL),
"time", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,

View file

@ -31,7 +31,6 @@
#include <unistd.h>
#include "gstrusage.h"
#include <gst/gsttracerrecord.h>
#ifdef HAVE_SYS_RESOURCE_H
#ifndef __USE_GNU
@ -288,7 +287,7 @@ gst_rusage_tracer_class_init (GstRUsageTracerClass * klass)
tr_thread = gst_tracer_record_new (gst_structure_new ("thread-rusage.class",
"thread-id", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
"related-to", G_TYPE_STRING, "thread", /* TODO: use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_THREAD,
NULL),
"ts", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
@ -319,7 +318,7 @@ gst_rusage_tracer_class_init (GstRUsageTracerClass * klass)
tr_proc = gst_tracer_record_new (gst_structure_new ("proc-rusage.class",
"thread-id", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
"related-to", G_TYPE_STRING, "process", /* TODO: use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_PROCESS,
NULL),
"ts", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,

View file

@ -30,7 +30,6 @@
#endif
#include "gststats.h"
#include <gst/gsttracerrecord.h>
#include <stdio.h>
@ -520,7 +519,7 @@ gst_stats_tracer_class_init (GstStatsTracerClass * klass)
tr_buffer = gst_tracer_record_new (gst_structure_new ("buffer.class",
"thread-id", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
"related-to", G_TYPE_STRING, "thread", /* TODO use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_THREAD,
NULL),
"ts", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
@ -528,19 +527,19 @@ gst_stats_tracer_class_init (GstStatsTracerClass * klass)
NULL),
"pad-ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT,
"related-to", G_TYPE_STRING, "pad", /* TODO: use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_PAD,
NULL),
"element-ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT,
"related-to", G_TYPE_STRING, "element", /* TODO: use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_ELEMENT,
NULL),
"peer-pad-ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT,
"related-to", G_TYPE_STRING, "pad", /* TODO: use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_PAD,
NULL),
"peer-element-ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT,
"related-to", G_TYPE_STRING, "element", /* TODO: use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_ELEMENT,
NULL),
"buffer-size", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"type", G_TYPE_GTYPE, G_TYPE_UINT,
@ -568,7 +567,7 @@ gst_stats_tracer_class_init (GstStatsTracerClass * klass)
tr_event = gst_tracer_record_new (gst_structure_new ("event.class",
"thread-id", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
"related-to", G_TYPE_STRING, "thread", /* TODO use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_THREAD,
NULL),
"ts", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
@ -576,11 +575,11 @@ gst_stats_tracer_class_init (GstStatsTracerClass * klass)
NULL),
"pad-ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT,
"related-to", G_TYPE_STRING, "pad", /* TODO: use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_PAD,
NULL),
"element-ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT,
"related-to", G_TYPE_STRING, "element", /* TODO: use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_ELEMENT,
NULL),
"name", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"type", G_TYPE_GTYPE, G_TYPE_STRING,
@ -591,7 +590,7 @@ gst_stats_tracer_class_init (GstStatsTracerClass * klass)
tr_message = gst_tracer_record_new (gst_structure_new ("message.class",
"thread-id", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
"related-to", G_TYPE_STRING, "thread", /* TODO use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_THREAD,
NULL),
"ts", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
@ -599,7 +598,7 @@ gst_stats_tracer_class_init (GstStatsTracerClass * klass)
NULL),
"element-ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT,
"related-to", G_TYPE_STRING, "element", /* TODO: use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_ELEMENT,
NULL),
"name", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"type", G_TYPE_GTYPE, G_TYPE_STRING,
@ -615,7 +614,7 @@ gst_stats_tracer_class_init (GstStatsTracerClass * klass)
"element-query.class",
"thread-id", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
"related-to", G_TYPE_STRING, "thread", /* TODO use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_THREAD,
NULL),
"ts", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
@ -623,18 +622,17 @@ gst_stats_tracer_class_init (GstStatsTracerClass * klass)
NULL),
"element-ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT,
"related-to", G_TYPE_STRING, "element", /* TODO: use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_ELEMENT,
NULL),
"name", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"type", G_TYPE_GTYPE, G_TYPE_STRING,
"description", G_TYPE_STRING, "name of the query",
"flags", G_TYPE_STRING, "", /* TODO: use gflags */
NULL),
NULL));
tr_query = gst_tracer_record_new (gst_structure_new ("query.class",
"thread-id", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
"related-to", G_TYPE_STRING, "thread", /* TODO use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_THREAD,
NULL),
"ts", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
@ -642,29 +640,27 @@ gst_stats_tracer_class_init (GstStatsTracerClass * klass)
NULL),
"pad-ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT,
"related-to", G_TYPE_STRING, "pad", /* TODO: use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_PAD,
NULL),
"element-ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT,
"related-to", G_TYPE_STRING, "element", /* TODO: use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_ELEMENT,
NULL),
"peer-pad-ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT,
"related-to", G_TYPE_STRING, "pad", /* TODO: use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_PAD,
NULL),
"peer-element-ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT,
"related-to", G_TYPE_STRING, "element", /* TODO: use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_ELEMENT,
NULL),
"name", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"type", G_TYPE_GTYPE, G_TYPE_STRING,
"description", G_TYPE_STRING, "name of the query",
"flags", G_TYPE_STRING, "", /* TODO: use gflags */
NULL),
"structure", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"type", G_TYPE_GTYPE, GST_TYPE_STRUCTURE,
"description", G_TYPE_STRING, "query structure",
"flags", G_TYPE_STRING, "", /* TODO: use gflags */
NULL),
"have-res", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"type", G_TYPE_GTYPE, G_TYPE_BOOLEAN,
@ -680,7 +676,7 @@ gst_stats_tracer_class_init (GstStatsTracerClass * klass)
"new-element.class",
"thread-id", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
"related-to", G_TYPE_STRING, "thread", /* TODO use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_THREAD,
NULL),
"ts", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
@ -688,21 +684,19 @@ gst_stats_tracer_class_init (GstStatsTracerClass * klass)
NULL),
"ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT,
"related-to", G_TYPE_STRING, "element", /* TODO: use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_ELEMENT,
NULL),
"parent-ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT,
"related-to", G_TYPE_STRING, "element", /* TODO: use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_ELEMENT,
NULL),
"name", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"type", G_TYPE_GTYPE, G_TYPE_STRING,
"description", G_TYPE_STRING, "name of the element",
"flags", G_TYPE_STRING, "", /* TODO: use gflags */
NULL),
"type", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"type", G_TYPE_GTYPE, G_TYPE_STRING,
"description", G_TYPE_STRING, "type name of the element",
"flags", G_TYPE_STRING, "", /* TODO: use gflags */
NULL),
"is-bin", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"type", G_TYPE_GTYPE, G_TYPE_BOOLEAN,
@ -712,25 +706,23 @@ gst_stats_tracer_class_init (GstStatsTracerClass * klass)
tr_new_pad = gst_tracer_record_new (gst_structure_new ("new-pad.class",
"thread-id", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
"related-to", G_TYPE_STRING, "thread", /* TODO use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_THREAD,
NULL),
"ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT,
"related-to", G_TYPE_STRING, "pad", /* TODO: use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_PAD,
NULL),
"parent-ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
"type", G_TYPE_GTYPE, G_TYPE_UINT,
"related-to", G_TYPE_STRING, "element", /* TODO: use genum */
"related-to", GST_TYPE_TRACER_VALUE_SCOPE, GST_TRACER_VALUE_SCOPE_ELEMENT,
NULL),
"name", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"type", G_TYPE_GTYPE, G_TYPE_STRING,
"description", G_TYPE_STRING, "name of the pad",
"flags", G_TYPE_STRING, "", /* TODO: use gflags */
NULL),
"type", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"type", G_TYPE_GTYPE, G_TYPE_STRING,
"description", G_TYPE_STRING, "type name of the pad",
"flags", G_TYPE_STRING, "", /* TODO: use gflags */
NULL),
"is-ghostpad", GST_TYPE_STRUCTURE, gst_structure_new ("value",
"type", G_TYPE_GTYPE, G_TYPE_BOOLEAN,

View file

@ -207,7 +207,7 @@ gst_gstcpp_SOURCES = gst/gstcpp.cc
libs_gstlibscpp_SOURCES = libs/gstlibscpp.cc
gst_gsttracerrecord_CFLAGS = $(GST_OBJ_CFLAGS) $(AM_CFLAGS) -DGST_USE_UNSTABLE_API
gst_gsttracerrecord_CFLAGS = $(GST_OBJ_CFLAGS) $(AM_CFLAGS)
gst_gstutils_LDADD = $(LDADD) $(GSL_LIBS) $(GMP_LIBS)

View file

@ -1395,6 +1395,7 @@ EXPORTS
gst_tracer_record_log
gst_tracer_record_new
gst_tracer_register
gst_tracer_value_scope_get_type
gst_tracing_register_hook
gst_type_find_factory_call_function
gst_type_find_factory_get_caps