9923a2a75bb9bcad730df0ab15335e4f90a330b7
[platform/upstream/gstreamer.git] / gst / videofilter / gstvideofilter.h
1 /* GStreamer
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_VIDEOFILTER_H__
22 #define __GST_VIDEOFILTER_H__
23
24
25 #include <gst/gst.h>
26
27
28 G_BEGIN_DECLS
29
30 typedef struct _GstVideofilter GstVideofilter;
31 typedef struct _GstVideofilterClass GstVideofilterClass;
32
33 typedef void (*GstVideofilterFilterFunc)(GstVideofilter *filter,
34     void *out_data, void *in_data);
35
36 typedef void (*GstVideofilterSetupFunc)(GstVideofilter *filter);
37
38 typedef struct _GstVideofilterFormat GstVideofilterFormat;
39 struct _GstVideofilterFormat {
40   char *fourcc;
41   int bpp;
42   GstVideofilterFilterFunc filter_func;
43   int depth;
44   unsigned int endianness;
45   unsigned int red_mask;
46   unsigned int green_mask;
47   unsigned int blue_mask;
48 };
49
50 #define GST_TYPE_VIDEOFILTER \
51   (gst_videofilter_get_type())
52 #define GST_VIDEOFILTER(obj) \
53   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VIDEOFILTER,GstVideofilter))
54 #define GST_VIDEOFILTER_CLASS(klass) \
55   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VIDEOFILTER,GstVideofilterClass))
56 #define GST_IS_VIDEOFILTER(obj) \
57   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VIDEOFILTER))
58 #define GST_IS_VIDEOFILTER_CLASS(obj) \
59   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VIDEOFILTER))
60
61 struct _GstVideofilter {
62   GstElement element;
63
64   GstPad *sinkpad,*srcpad;
65
66   /* video state */
67   gboolean inited;
68   GstVideofilterFormat *format;
69   gint to_width;
70   gint to_height;
71   gint from_width;
72   gint from_height;
73   gboolean passthru;
74
75   /* private */
76   gint from_buf_size;
77   gint to_buf_size;
78   GValue framerate;
79
80   GstBuffer *in_buf;
81   GstBuffer *out_buf;
82 };
83
84 struct _GstVideofilterClass {
85   GstElementClass parent_class;
86
87   GPtrArray *formats;
88   GstVideofilterSetupFunc setup;
89 };
90
91 GType gst_videofilter_get_type(void);
92
93 int gst_videofilter_get_input_width(GstVideofilter *videofilter);
94 int gst_videofilter_get_input_height(GstVideofilter *videofilter);
95 void gst_videofilter_set_output_size(GstVideofilter *videofilter,
96     int width, int height);
97 GstVideofilterFormat *gst_videofilter_find_format_by_structure (GstVideofilter *filter,
98     const GstStructure *structure);
99 GstCaps *gst_videofilter_class_get_capslist(GstVideofilterClass *videofilterclass);
100 void gst_videofilter_setup (GstVideofilter * videofilter);
101
102 void gst_videofilter_class_add_format(GstVideofilterClass *videofilterclass,
103     GstVideofilterFormat *format);
104 void gst_videofilter_class_add_pad_templates (GstVideofilterClass *videofilterclass);
105
106 G_END_DECLS
107
108 #endif /* __GST_VIDEOFILTER_H__ */
109