4c1ab57a3e6f9a2040917a6de325ab84d47def34
[platform/upstream/gstreamer.git] / gst / oldcore / gststatistics.h
1 /* GStreamer
2  * Copyright (C) 2001 David I. Lehn <dlehn@users.sourceforge.net>
3  *
4  * gststatistics.h: 
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., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21
22
23 #ifndef __GST_STATISTICS_H__
24 #define __GST_STATISTICS_H__
25
26
27 #include <gst/gst.h>
28
29 G_BEGIN_DECLS
30
31
32 #define GST_TYPE_STATISTICS \
33   (gst_statistics_get_type())
34 #define GST_STATISTICS(obj) \
35   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_STATISTICS,GstStatistics))
36 #define GST_STATISTICS_CLASS(klass) \
37   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_STATISTICS,GstStatisticsClass))
38 #define GST_IS_STATISTICS(obj) \
39   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_STATISTICS))
40 #define GST_IS_STATISTICS_CLASS(obj) \
41   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_STATISTICS))
42
43 typedef struct _GstStatistics GstStatistics;
44 typedef struct _GstStatisticsClass GstStatisticsClass;
45
46 typedef struct _stats stats;
47
48 struct _stats {
49   gint64 buffers;
50   gint64 bytes;
51   gint64 events;
52 };
53
54 struct _GstStatistics {
55   GstElement element;
56
57   GstPad *sinkpad;
58   GstPad *srcpad;
59
60   GTimer *timer;
61   GTimer *last_timer;
62
63   stats stats;
64   stats last_stats;
65   stats update_count;
66   stats update_freq;
67
68   gboolean update_on_eos; 
69   gboolean update;
70   gboolean silent;
71 };
72
73 struct _GstStatisticsClass {
74   GstElementClass parent_class;
75
76   /* signals */
77   void (*update) (GstElement *element);
78 };
79
80 GType gst_statistics_get_type(void);
81
82 G_END_DECLS
83
84 #endif /* __GST_STATISTICS_H__ */