encoder(h264,h263,mpeg4): changed styles, names
[profile/ivi/gstreamer-vaapi.git] / gst-libs / gst / vaapi / gstvaapisurfaceproxy.h
1 /*
2  *  gstvaapisurfaceproxy.h - VA surface proxy
3  *
4  *  Copyright (C) 2010-2011 Splitted-Desktop Systems
5  *  Copyright (C) 2011-2012 Intel Corporation
6  *
7  *  This library is free software; you can redistribute it and/or
8  *  modify it under the terms of the GNU Lesser General Public License
9  *  as published by the Free Software Foundation; either version 2.1
10  *  of the License, or (at your option) any later version.
11  *
12  *  This library is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  *  Lesser General Public License for more details.
16  *
17  *  You should have received a copy of the GNU Lesser General Public
18  *  License along with this library; if not, write to the Free
19  *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  *  Boston, MA 02110-1301 USA
21  */
22
23 #ifndef GST_VAAPI_SURFACE_PROXY_H
24 #define GST_VAAPI_SURFACE_PROXY_H
25
26 #include <glib-object.h>
27 #include <gst/vaapi/gstvaapicontext.h>
28 #include <gst/vaapi/gstvaapisurface.h>
29
30 G_BEGIN_DECLS
31
32 #define GST_VAAPI_TYPE_SURFACE_PROXY \
33     (gst_vaapi_surface_proxy_get_type())
34
35 #define GST_VAAPI_SURFACE_PROXY(obj)                            \
36     (G_TYPE_CHECK_INSTANCE_CAST((obj),                          \
37                                 GST_VAAPI_TYPE_SURFACE_PROXY,   \
38                                 GstVaapiSurfaceProxy))
39
40 #define GST_VAAPI_SURFACE_PROXY_CLASS(klass)                    \
41     (G_TYPE_CHECK_CLASS_CAST((klass),                           \
42                              GST_VAAPI_TYPE_SURFACE_PROXY,      \
43                              GstVaapiSurfaceProxyClass))
44
45 #define GST_VAAPI_IS_SURFACE_PROXY(obj) \
46     (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_SURFACE_PROXY))
47
48 #define GST_VAAPI_IS_SURFACE_PROXY_CLASS(klass) \
49     (G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_SURFACE_PROXY))
50
51 #define GST_VAAPI_SURFACE_PROXY_GET_CLASS(obj)                  \
52     (G_TYPE_INSTANCE_GET_CLASS((obj),                           \
53                                GST_VAAPI_TYPE_SURFACE_PROXY,    \
54                                GstVaapiSurfaceProxyClass))
55
56 /**
57  * GST_VAAPI_SURFACE_PROXY_SURFACE:
58  * @surface: a #GstVaapiSurfaceProxy
59  *
60  * Macro that evaluates to the #GstVaapiSurface of @surface.
61  */
62 #define GST_VAAPI_SURFACE_PROXY_SURFACE(surface) \
63     gst_vaapi_surface_proxy_get_surface(surface)
64
65 /**
66  * GST_VAAPI_SURFACE_PROXY_TIMESTAMP:
67  * @surface: a #GstVaapiSurfaceProxy
68  *
69  * Macro that evaluates to the @surface timestamp, or
70  * %GST_CLOCK_TIME_NONE if none was set.
71  */
72 #define GST_VAAPI_SURFACE_PROXY_TIMESTAMP(surface) \
73     gst_vaapi_surface_proxy_get_timestamp(surface)
74
75 /**
76  * GST_VAAPI_SURFACE_PROXY_DURATION:
77  * @surface: a #GstVaapiSurfaceProxy
78  *
79  * Macro that evaluates to the amount of time the @surface should be
80  * displayed, or %GST_CLOCK_TIME_NONE if none was set.
81  */
82 #define GST_VAAPI_SURFACE_PROXY_DURATION(surface) \
83     gst_vaapi_surface_proxy_get_duration(surface)
84
85 /**
86  * GST_VAAPI_SURFACE_PROXY_INTERLACED:
87  * @surface: a #GstVaapiSurfaceProxy
88  *
89  * Macro that evaluates to %TRUE if the @surface is interlaced.
90  */
91 #define GST_VAAPI_SURFACE_PROXY_INTERLACED(surface) \
92     gst_vaapi_surface_proxy_get_interlaced(surface)
93
94 /**
95  * GST_VAAPI_SURFACE_PROXY_TFF:
96  * @surface: a #GstVaapiSurfaceProxy
97  *
98  * Macro that evaluates to the tff flag of the @surface
99  */
100 #define GST_VAAPI_SURFACE_PROXY_TFF(surface) \
101     gst_vaapi_surface_proxy_get_tff(surface)
102
103 typedef struct _GstVaapiSurfaceProxy            GstVaapiSurfaceProxy;
104 typedef struct _GstVaapiSurfaceProxyPrivate     GstVaapiSurfaceProxyPrivate;
105 typedef struct _GstVaapiSurfaceProxyClass       GstVaapiSurfaceProxyClass;
106
107 /**
108  * GstVaapiSurfaceProxy:
109  *
110  * A wrapper around a VA surface and context.
111  */
112 struct _GstVaapiSurfaceProxy {
113     /*< private >*/
114     GObject parent_instance;
115
116     GstVaapiSurfaceProxyPrivate *priv;
117 };
118
119 /**
120  * GstVaapiSurfaceProxyClass:
121  *
122  * A wrapper around a VA surface and context.
123  */
124 struct _GstVaapiSurfaceProxyClass {
125     /*< private >*/
126     GObjectClass parent_class;
127 };
128
129 GType
130 gst_vaapi_surface_proxy_get_type(void) G_GNUC_CONST;
131
132 GstVaapiSurfaceProxy *
133 gst_vaapi_surface_proxy_new(GstVaapiContext *context, GstVaapiSurface *surface);
134
135 GstVaapiContext *
136 gst_vaapi_surface_proxy_get_context(GstVaapiSurfaceProxy *proxy);
137
138 void
139 gst_vaapi_surface_proxy_set_context(
140     GstVaapiSurfaceProxy *proxy,
141     GstVaapiContext      *context
142 );
143
144 GstVaapiSurface *
145 gst_vaapi_surface_proxy_get_surface(GstVaapiSurfaceProxy *proxy);
146
147 GstVaapiID
148 gst_vaapi_surface_proxy_get_surface_id(GstVaapiSurfaceProxy *proxy);
149
150 void
151 gst_vaapi_surface_proxy_set_surface(
152     GstVaapiSurfaceProxy *proxy,
153     GstVaapiSurface      *surface
154 );
155
156 GstClockTime
157 gst_vaapi_surface_proxy_get_timestamp(GstVaapiSurfaceProxy *proxy);
158
159 void
160 gst_vaapi_surface_proxy_set_timestamp(
161     GstVaapiSurfaceProxy *proxy,
162     GstClockTime          timestamp
163 );
164
165 GstClockTime
166 gst_vaapi_surface_proxy_get_duration(GstVaapiSurfaceProxy *proxy);
167
168 void
169 gst_vaapi_surface_proxy_set_duration(
170     GstVaapiSurfaceProxy *proxy,
171     GstClockTime          duration
172 );
173
174 gboolean
175 gst_vaapi_surface_proxy_get_interlaced(GstVaapiSurfaceProxy *proxy);
176
177 void
178 gst_vaapi_surface_proxy_set_interlaced(GstVaapiSurfaceProxy *proxy, gboolean b);
179
180 gboolean
181 gst_vaapi_surface_proxy_get_tff(GstVaapiSurfaceProxy *proxy);
182
183 void
184 gst_vaapi_surface_proxy_set_tff(GstVaapiSurfaceProxy *proxy, gboolean tff);
185
186 G_END_DECLS
187
188 #endif /* GST_VAAPI_SURFACE_PROXY_H */