Tizen 2.0 Release
[framework/multimedia/gstreamer-vaapi.git] / gst / vaapi / gstvaapipostproc.h
1 /*
2  *  gstvaapipostproc.h - VA-API video post processing
3  *
4  *  Copyright (C) 2012 Intel Corporation
5  *
6  *  This program is free software; you can redistribute it and/or
7  *  modify it under the terms of the GNU Lesser General Public License
8  *  as published by the Free Software Foundation; either version 2.1
9  *  of the License, or (at your option) any later version.
10  *
11  *  This program 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  *  Lesser General Public License for more details.
15  *
16  *  You should have received a copy of the GNU Lesser General Public
17  *  License along with this program; if not, write to the Free
18  *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  *  Boston, MA 02110-1301 USA
20 */
21
22 #ifndef GST_VAAPIPOSTPROC_H
23 #define GST_VAAPIPOSTPROC_H
24
25 #include <gst/gst.h>
26 #include <gst/vaapi/gstvaapidisplay.h>
27 #include <gst/vaapi/gstvaapisurface.h>
28 #include <gst/vaapi/gstvaapisurfacepool.h>
29 #include <gst/vaapi/gstvaapivideobuffer.h>
30
31 G_BEGIN_DECLS
32
33 #define GST_TYPE_VAAPIPOSTPROC \
34     (gst_vaapipostproc_get_type())
35
36 #define GST_VAAPIPOSTPROC(obj)                          \
37     (G_TYPE_CHECK_INSTANCE_CAST((obj),                  \
38                                 GST_TYPE_VAAPIPOSTPROC, \
39                                 GstVaapiPostproc))
40
41 #define GST_VAAPIPOSTPROC_CLASS(klass)                  \
42     (G_TYPE_CHECK_CLASS_CAST((klass),                   \
43                              GST_TYPE_VAAPIPOSTPROC,    \
44                              GstVaapiPostprocClass))
45
46 #define GST_IS_VAAPIPOSTPROC(obj) \
47     (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_VAAPIPOSTPROC))
48
49 #define GST_IS_VAAPIPOSTPROC_CLASS(klass) \
50     (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_VAAPIPOSTPROC))
51
52 #define GST_VAAPIPOSTPROC_GET_CLASS(obj)                \
53     (G_TYPE_INSTANCE_GET_CLASS((obj),                   \
54                                GST_TYPE_VAAPIPOSTPROC,  \
55                                GstVaapiPostprocClass))
56
57 typedef struct _GstVaapiPostproc                GstVaapiPostproc;
58 typedef struct _GstVaapiPostprocClass           GstVaapiPostprocClass;
59
60 typedef enum _GstVaapiDeinterlaceMode           GstVaapiDeinterlaceMode;
61 typedef enum _GstVaapiDeinterlaceMethod         GstVaapiDeinterlaceMethod;
62
63 /**
64  * GstVaapiDeinterlaceMode:
65  * @GST_VAAPI_DEINTERLACE_MODE_AUTO: Auto detect needs for deinterlacing.
66  * @GST_VAAPI_DEINTERLACE_MODE_INTERLACED: Force deinterlacing.
67  * @GST_VAAPI_DEINTERLACE_MODE_DISABLED: Never perform deinterlacing.
68  */
69 enum _GstVaapiDeinterlaceMode {
70     GST_VAAPI_DEINTERLACE_MODE_AUTO = 0,
71     GST_VAAPI_DEINTERLACE_MODE_INTERLACED,
72     GST_VAAPI_DEINTERLACE_MODE_DISABLED,
73 };
74
75 /**
76  * GstVaapiDeinterlaceMethod:
77  * @GST_VAAPI_DEINTERLACE_METHOD_BOB: Basic bob deinterlacing algorithm.
78  * @GST_VAAPI_DEINTERLACE_METHOD_WEAVE: Weave deinterlacing algorithm.
79  * @GST_VAAPI_DEINTERLACE_METHOD_MOTION_ADAPTIVE: Motion adaptive deinterlacing algorithm.
80  * @GST_VAAPI_DEINTERLACE_METHOD_MOTION_COMPENSATED: Motion compensated deinterlacing algorithm.
81  */
82 enum _GstVaapiDeinterlaceMethod {
83     GST_VAAPI_DEINTERLACE_METHOD_BOB = 1,
84     GST_VAAPI_DEINTERLACE_METHOD_WEAVE,
85     GST_VAAPI_DEINTERLACE_METHOD_MOTION_ADAPTIVE,
86     GST_VAAPI_DEINTERLACE_METHOD_MOTION_COMPENSATED,
87 };
88
89 struct _GstVaapiPostproc {
90     /*< private >*/
91     GstElement                  parent_instance;
92
93     GstPad                     *sinkpad;
94     GstCaps                    *sinkpad_caps;
95     GstPad                     *srcpad;
96     GstCaps                    *srcpad_caps;
97     GstCaps                    *allowed_caps;
98     GstCaps                    *postproc_caps;
99
100     GstVaapiDisplay            *display;
101     guint                       surface_width;
102     guint                       surface_height;
103
104     /* Deinterlacing */
105     gboolean                    deinterlace;
106     GstVaapiDeinterlaceMode     deinterlace_mode;
107     GstVaapiDeinterlaceMethod   deinterlace_method;
108     GstClockTime                field_duration;
109     gint                        fps_n;
110     gint                        fps_d;
111 };
112
113 struct _GstVaapiPostprocClass {
114     /*< private >*/
115     GstElementClass             parent_class;
116 };
117
118 GType
119 gst_vaapipostproc_get_type(void) G_GNUC_CONST;
120
121 G_END_DECLS
122
123 #endif /* GST_VAAPIPOSTPROC_H */