goom2k1: post QoS messages when dropping frames due to QoS
[platform/upstream/gst-plugins-good.git] / gst / goom2k1 / gstgoom.h
1 /* gstgoom.c: implementation of goom drawing element
2  * Copyright (C) <2001> Richard Boulton <richard@tartarus.org>
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., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19
20 #ifndef __GST_GOOM_H__
21 #define __GST_GOOM_H__
22
23 G_BEGIN_DECLS
24
25 #include <gst/gst.h>
26 #include <gst/base/gstadapter.h>
27 #include "goom_core.h"
28
29 #define GOOM_SAMPLES 512
30
31 #define GST_TYPE_GOOM            (gst_goom_get_type())
32 #define GST_GOOM(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GOOM,GstGoom))
33 #define GST_GOOM_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_GOOM,GstGoomClass))
34 #define GST_IS_GOOM(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GOOM))
35 #define GST_IS_GOOM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GOOM))
36
37 typedef struct _GstGoom GstGoom;
38 typedef struct _GstGoomClass GstGoomClass;
39
40 struct _GstGoom
41 {
42   GstElement element;
43
44   /* pads */
45   GstPad *sinkpad, *srcpad;
46   GstAdapter *adapter;
47
48   /* input tracking */
49   gint rate;
50   gint channels;
51   guint bps;
52
53   /* video state */
54   gint fps_n;
55   gint fps_d;
56   gint width;
57   gint height;
58   GstClockTime duration;
59   guint outsize;
60   GstBufferPool *pool;
61
62   guint dropped;        /* frames dropped / not dropped */
63   guint processed;
64
65   /* samples per frame */
66   guint spf;
67   /* bytes per frame */
68   guint bpf;
69
70   /* goom stuff */
71   gint16 datain[2][GOOM_SAMPLES];
72   GoomData goomdata;
73
74   /* segment state */
75   GstSegment segment;
76
77   /* QoS stuff *//* with LOCK */
78   gdouble proportion;
79   GstClockTime earliest_time;
80 };
81
82 struct _GstGoomClass
83 {
84   GstElementClass parent_class;
85 };
86
87 GType gst_goom_get_type (void);
88
89 G_END_DECLS
90
91 #endif /* __GST_GOOM_H__ */
92