gstreamer/gst/gsttracerrecord.h
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

58 lines
2.3 KiB
C

/* GStreamer
* Copyright (C) 2016 Stefan Sauer <ensonic@users.sf.net>
*
* gsttracerrecord.h: tracer log record class
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_TRACER_RECORD_H__
#define __GST_TRACER_RECORD_H__
#ifndef GST_USE_UNSTABLE_API
#warning "The tracer subsystem is unstable API and may change in future."
#warning "You can define GST_USE_UNSTABLE_API to avoid this warning."
#endif
#include <gst/gstobject.h>
G_BEGIN_DECLS
typedef struct _GstTracerRecord GstTracerRecord;
typedef struct _GstTracerRecordPrivate GstTracerRecordPrivate;
typedef struct _GstTracerRecordClass GstTracerRecordClass;
#define GST_TYPE_TRACER_RECORD (gst_tracer_record_get_type())
#define GST_TRACER_RECORD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_TRACER_RECORD,GstTracerRecord))
#define GST_TRACER_RECORD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_TRACER_RECORD,GstTracerRecordClass))
#define GST_IS_TRACER_RECORD(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TRACER_RECORD))
#define GST_IS_TRACER_RECORD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TRACER_RECORD))
#define GST_TRACER_RECORD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_TRACER_RECORD,GstTracerRecordClass))
#define GST_TRACER_RECORD_CAST(obj) ((GstTracerRecord *)(obj))
GType gst_tracer_record_get_type (void);
GstTracerRecord * gst_tracer_record_new (GstStructure *spec);
void gst_tracer_record_log (GstTracerRecord *self, ...);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstTracerRecord, gst_object_unref)
#endif
G_END_DECLS
#endif /* __GST_TRACER_RECORD_H__ */