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., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19 
20 
21 #ifndef __GST_VIDEO_FILTER_H__
22 #define __GST_VIDEO_FILTER_H__
23 
24 #include <gst/base/gstbasetransform.h>
25 #include <gst/video/video.h>
26 
27 G_BEGIN_DECLS
28 
29 typedef struct _GstVideoFilter GstVideoFilter;
30 typedef struct _GstVideoFilterClass GstVideoFilterClass;
31 
32 #define GST_TYPE_VIDEO_FILTER \
33   (gst_video_filter_get_type())
34 #define GST_VIDEO_FILTER(obj) \
35   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VIDEO_FILTER,GstVideoFilter))
36 #define GST_VIDEO_FILTER_CLASS(klass) \
37   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VIDEO_FILTER,GstVideoFilterClass))
38 #define GST_VIDEO_FILTER_GET_CLASS(obj) \
39   (G_TYPE_INSTANCE_GET_CLASS((obj), GST_TYPE_VIDEO_FILTER, GstVideoFilterClass))
40 #define GST_IS_VIDEO_FILTER(obj) \
41   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VIDEO_FILTER))
42 #define GST_IS_VIDEO_FILTER_CLASS(klass) \
43   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VIDEO_FILTER))
44 #define GST_VIDEO_FILTER_CAST(obj)  ((GstVideoFilter *)(obj))
45 
46 struct _GstVideoFilter {
47   GstBaseTransform element;
48 
49   gboolean negotiated;
50   GstVideoInfo in_info;
51   GstVideoInfo out_info;
52 
53   /*< private >*/
54   gpointer _gst_reserved[GST_PADDING];
55 };
56 
57 /**
58  * GstVideoFilterClass:
59  * @parent_class: the parent class structure
60  * @set_info: function to be called with the negotiated caps and video infos
61  * @transform_frame: transform a video frame
62  * @transform_frame_ip: transform a video frame in place
63  *
64  * The video filter class structure.
65  */
66 struct _GstVideoFilterClass {
67   GstBaseTransformClass parent_class;
68 
69   gboolean      (*set_info)           (GstVideoFilter *filter,
70                                        GstCaps *incaps, GstVideoInfo *in_info,
71                                        GstCaps *outcaps, GstVideoInfo *out_info);
72 
73   /* transform */
74   GstFlowReturn (*transform_frame)    (GstVideoFilter *filter,
75                                        GstVideoFrame *inframe, GstVideoFrame *outframe);
76   GstFlowReturn (*transform_frame_ip) (GstVideoFilter *trans, GstVideoFrame *frame);
77 
78   /*< private >*/
79   gpointer _gst_reserved[GST_PADDING];
80 };
81 
82 GST_VIDEO_API
83 GType gst_video_filter_get_type (void);
84 
85 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
86 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVideoFilter, gst_object_unref)
87 #endif
88 
89 G_END_DECLS
90 
91 #endif /* __GST_VIDEO_FILTER_H__ */
92