Tizen 2.0 Release
[framework/multimedia/gstreamer-vaapi.git] / gst-libs / gst / vaapi / gstvaapitexture.h
1 /*
2  *  gstvaapitexture.h - VA texture abstraction
3  *
4  *  Copyright (C) 2010-2011 Splitted-Desktop Systems
5  *
6  *  This library 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 library 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 library; 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_VAAPI_TEXTURE_H
23 #define GST_VAAPI_TEXTURE_H
24
25 #include <GL/gl.h>
26 #include <gst/vaapi/gstvaapitypes.h>
27 #include <gst/vaapi/gstvaapiobject.h>
28 #include <gst/vaapi/gstvaapidisplay.h>
29 #include <gst/vaapi/gstvaapisurface.h>
30
31 G_BEGIN_DECLS
32
33 #define GST_VAAPI_TYPE_TEXTURE \
34     (gst_vaapi_texture_get_type())
35
36 #define GST_VAAPI_TEXTURE(obj)                          \
37     (G_TYPE_CHECK_INSTANCE_CAST((obj),                  \
38                                 GST_VAAPI_TYPE_TEXTURE, \
39                                 GstVaapiTexture))
40
41 #define GST_VAAPI_TEXTURE_CLASS(klass)                  \
42     (G_TYPE_CHECK_CLASS_CAST((klass),                   \
43                              GST_VAAPI_TYPE_TEXTURE,    \
44                              GstVaapiTextureClass))
45
46 #define GST_VAAPI_IS_TEXTURE(obj) \
47     (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_TEXTURE))
48
49 #define GST_VAAPI_IS_TEXTURE_CLASS(klass) \
50     (G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_TEXTURE))
51
52 #define GST_VAAPI_TEXTURE_GET_CLASS(obj)                \
53     (G_TYPE_INSTANCE_GET_CLASS((obj),                   \
54                                GST_VAAPI_TYPE_TEXTURE,  \
55                                GstVaapiTextureClass))
56
57 typedef struct _GstVaapiTexture                 GstVaapiTexture;
58 typedef struct _GstVaapiTexturePrivate          GstVaapiTexturePrivate;
59 typedef struct _GstVaapiTextureClass            GstVaapiTextureClass;
60
61 /**
62  * GstVaapiTexture:
63  *
64  * Base class for system-dependent textures.
65  */
66 struct _GstVaapiTexture {
67     /*< private >*/
68     GstVaapiObject parent_instance;
69
70     GstVaapiTexturePrivate *priv;
71 };
72
73 /**
74  * GstVaapiTextureClass:
75  *
76  * Base class for system-dependent textures.
77  */
78 struct _GstVaapiTextureClass {
79     /*< private >*/
80     GstVaapiObjectClass parent_class;
81 };
82
83 GType
84 gst_vaapi_texture_get_type(void) G_GNUC_CONST;
85
86 GstVaapiTexture *
87 gst_vaapi_texture_new(
88     GstVaapiDisplay *display,
89     GLenum           target,
90     GLenum           format,
91     guint            width,
92     guint            height
93 );
94
95 GstVaapiTexture *
96 gst_vaapi_texture_new_with_texture(
97     GstVaapiDisplay *display,
98     GLuint           texture,
99     GLenum           target,
100     GLenum           format
101 );
102
103 GLuint
104 gst_vaapi_texture_get_id(GstVaapiTexture *texture);
105
106 GLenum
107 gst_vaapi_texture_get_target(GstVaapiTexture *texture);
108
109 GLenum
110 gst_vaapi_texture_get_format(GstVaapiTexture *texture);
111
112 guint
113 gst_vaapi_texture_get_width(GstVaapiTexture *texture);
114
115 guint
116 gst_vaapi_texture_get_height(GstVaapiTexture *texture);
117
118 void
119 gst_vaapi_texture_get_size(
120     GstVaapiTexture *texture,
121     guint           *pwidth,
122     guint           *pheight
123 );
124
125 gboolean
126 gst_vaapi_texture_put_surface(
127     GstVaapiTexture *texture,
128     GstVaapiSurface *surface,
129     guint            flags
130 );
131
132 G_END_DECLS
133
134 #endif /* GST_VAAPI_TEXTURE_H */