Added the excellent mpeg2dec decoder. Not 100% optimized but allready very fast.
[platform/upstream/gstreamer.git] / gst / gsttrace.h
1 /* Gnome-Streamer
2  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20
21 #ifndef __GST_TRACE_H__
22 #define __GST_TRACE_H__
23
24
25 typedef struct _GstTrace        GstTrace;
26 typedef struct _GstTraceEntry   GstTraceEntry;
27
28 struct _GstTrace {
29   /* where this trace is going */
30   gchar *filename;
31   int fd;
32
33   /* current buffer, size, head offset */
34   GstTraceEntry *buf;
35   gint bufsize;
36   gint bufoffset;
37 };
38
39 struct _GstTraceEntry {
40   guint64 timestamp;
41   guint32 sequence;
42   guint32 data;
43   gchar message[112];
44 };
45
46 GstTrace*       gst_trace_new                   (guchar *filename, gint size);
47
48 void            gst_trace_destroy               (GstTrace *trace);
49 void            gst_trace_flush                 (GstTrace *trace);
50 #define         gst_trace_get_size(trace)       ((trace)->bufsize)
51 #define         gst_trace_get_offset(trace)     ((trace)->bufoffset)
52 #define         gst_trace_get_remaining(trace)  ((trace)->bufsize - (trace)->bufoffset)
53 void            gst_trace_set_default           (GstTrace *trace);
54
55 void            _gst_trace_add_entry            (GstTrace *trace, guint32 seq, 
56                                                  guint32 data, gchar *msg);
57
58 void            gst_trace_read_tsc              (guint64 *dst);
59
60 #define TRACE_ENABLE
61
62 #ifdef TRACE_ENABLE
63 extern gint _gst_trace_on;
64 #define gst_trace_add_entry(trace,seq,data,msg) \
65   if (_gst_trace_on) { \
66     _gst_trace_add_entry(trace,(guint32)seq,(guint32)data,msg); \
67   }
68 #else
69 #define gst_trace_add_entry(trace,seq,data,msg)
70 #endif
71
72 #endif /* __GST_TRACE_H__ */