| 1 | /* GStreamer | 
| 2 |  * Copyright (C) 2016 Stefan Sauer <ensonic@users.sf.net> | 
| 3 |  * | 
| 4 |  * gsttracerrecord.h: tracer log record class | 
| 5 |  * | 
| 6 |  * This library is free software; you can redistribute it and/or | 
| 7 |  * modify it under the terms of the GNU Library General Public | 
| 8 |  * License as published by the Free Software Foundation; either | 
| 9 |  * version 2 of the License, or (at your option) any later version. | 
| 10 |  * | 
| 11 |  * This library is distributed in the hope that it will be useful, | 
| 12 |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
| 13 |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | 
| 14 |  * Library General Public License for more details. | 
| 15 |  * | 
| 16 |  * You should have received a copy of the GNU Library General Public | 
| 17 |  * License along with this library; if not, write to the | 
| 18 |  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, | 
| 19 |  * Boston, MA 02110-1301, USA. | 
| 20 |  */ | 
| 21 |  | 
| 22 | #ifndef __GST_TRACER_RECORD_H__ | 
| 23 | #define __GST_TRACER_RECORD_H__ | 
| 24 |  | 
| 25 | #include <gst/gstobject.h> | 
| 26 |  | 
| 27 | G_BEGIN_DECLS | 
| 28 |  | 
| 29 | /** | 
| 30 |  * GstTracerRecord: | 
| 31 |  * | 
| 32 |  * The opaque GstTracerRecord instance structure | 
| 33 |  * | 
| 34 |  * Since: 1.8 | 
| 35 |  */ | 
| 36 | typedef struct _GstTracerRecord GstTracerRecord; | 
| 37 | typedef struct _GstTracerRecordClass GstTracerRecordClass; | 
| 38 |  | 
| 39 | #define GST_TYPE_TRACER_RECORD            (gst_tracer_record_get_type()) | 
| 40 | #define GST_TRACER_RECORD(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_TRACER_RECORD,GstTracerRecord)) | 
| 41 | #define GST_TRACER_RECORD_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_TRACER_RECORD,GstTracerRecordClass)) | 
| 42 | #define GST_IS_TRACER_RECORD(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TRACER_RECORD)) | 
| 43 | #define GST_IS_TRACER_RECORD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TRACER_RECORD)) | 
| 44 | #define GST_TRACER_RECORD_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_TRACER_RECORD,GstTracerRecordClass)) | 
| 45 | #define GST_TRACER_RECORD_CAST(obj)       ((GstTracerRecord *)(obj)) | 
| 46 |  | 
| 47 | GST_API | 
| 48 | GType gst_tracer_record_get_type          (void); | 
| 49 |  | 
| 50 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstTracerRecord, gst_object_unref) | 
| 51 |  | 
| 52 | /** | 
| 53 |  * GstTracerValueScope: | 
| 54 |  * @GST_TRACER_VALUE_SCOPE_PROCESS: the value is related to the process | 
| 55 |  * @GST_TRACER_VALUE_SCOPE_THREAD: the value is related to a thread | 
| 56 |  * @GST_TRACER_VALUE_SCOPE_ELEMENT: the value is related to an #GstElement | 
| 57 |  * @GST_TRACER_VALUE_SCOPE_PAD: the value is related to a #GstPad | 
| 58 |  * | 
| 59 |  * Tracing record will contain fields that contain a measured value or extra | 
| 60 |  * meta-data. One such meta data are values that tell where a measurement was | 
| 61 |  * taken. This enumerating declares to which scope such a meta data field | 
| 62 |  * relates to. If it is e.g. %GST_TRACER_VALUE_SCOPE_PAD, then each of the log | 
| 63 |  * events may contain values for different #GstPads. | 
| 64 |  * | 
| 65 |  * Since: 1.8 | 
| 66 |  */ | 
| 67 | typedef enum | 
| 68 | { | 
| 69 |   GST_TRACER_VALUE_SCOPE_PROCESS, | 
| 70 |   GST_TRACER_VALUE_SCOPE_THREAD, | 
| 71 |   GST_TRACER_VALUE_SCOPE_ELEMENT, | 
| 72 |   GST_TRACER_VALUE_SCOPE_PAD | 
| 73 | } GstTracerValueScope; | 
| 74 |  | 
| 75 | /** | 
| 76 |  * GstTracerValueFlags: | 
| 77 |  * @GST_TRACER_VALUE_FLAGS_NONE: no flags | 
| 78 |  * @GST_TRACER_VALUE_FLAGS_OPTIONAL: the value is optional. When using this flag | 
| 79 |  *   one need to have an additional boolean arg before this value in the | 
| 80 |  *   var-args list passed to  gst_tracer_record_log(). | 
| 81 |  * @GST_TRACER_VALUE_FLAGS_AGGREGATED: the value is a combined figure, since the | 
| 82 |  *   start of tracing. Examples are averages or timestamps. | 
| 83 |  * | 
| 84 |  * Flag that describe the value. These flags help applications processing the | 
| 85 |  * logs to understand the values. | 
| 86 |  */ | 
| 87 | typedef enum | 
| 88 | { | 
| 89 |   GST_TRACER_VALUE_FLAGS_NONE = 0, | 
| 90 |   GST_TRACER_VALUE_FLAGS_OPTIONAL = (1 << 0), | 
| 91 |   GST_TRACER_VALUE_FLAGS_AGGREGATED = (1 << 1), | 
| 92 | } GstTracerValueFlags; | 
| 93 |  | 
| 94 | GST_API | 
| 95 | GstTracerRecord * gst_tracer_record_new (const gchar * name, const gchar * firstfield, ...) G_GNUC_NULL_TERMINATED; | 
| 96 |  | 
| 97 | #ifndef GST_DISABLE_GST_DEBUG | 
| 98 | GST_API | 
| 99 | void              gst_tracer_record_log (GstTracerRecord *self, ...); | 
| 100 | #else | 
| 101 | #define gst_tracer_record_log(...) G_STMT_START {} G_STMT_END | 
| 102 | #endif | 
| 103 |  | 
| 104 | G_END_DECLS | 
| 105 |  | 
| 106 | #endif /* __GST_TRACER_RECORD_H__ */ | 
| 107 |  |