5ae71c201a448a6b8cebadcf67988369b0fcc3ae
[platform/upstream/gstreamer.git] / gst-libs / gst / vaapi / gstvaapitexture.h
1 /*
2  *  gstvaapitexture.h - VA texture abstraction
3  *
4  *  Copyright (C) 2010-2011 Splitted-Desktop Systems
5  *    Author: Gwenole Beauchesne <gwenole.beauchesne@splitted-desktop.com>
6  *  Copyright (C) 2012-2013 Intel Corporation
7  *    Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
8  *
9  *  This library is free software; you can redistribute it and/or
10  *  modify it under the terms of the GNU Lesser General Public License
11  *  as published by the Free Software Foundation; either version 2.1
12  *  of the License, or (at your option) any later version.
13  *
14  *  This library is distributed in the hope that it will be useful,
15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  *  Lesser General Public License for more details.
18  *
19  *  You should have received a copy of the GNU Lesser General Public
20  *  License along with this library; if not, write to the Free
21  *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22  *  Boston, MA 02110-1301 USA
23  */
24
25 #ifndef GST_VAAPI_TEXTURE_H
26 #define GST_VAAPI_TEXTURE_H
27
28 #include <GL/gl.h>
29 #include <gst/vaapi/gstvaapitypes.h>
30 #include <gst/vaapi/gstvaapiobject.h>
31 #include <gst/vaapi/gstvaapidisplay.h>
32 #include <gst/vaapi/gstvaapisurface.h>
33
34 G_BEGIN_DECLS
35
36 typedef struct _GstVaapiTexture GstVaapiTexture;
37
38 GstVaapiTexture *
39 gst_vaapi_texture_new (GstVaapiDisplay * display, GLenum target, GLenum format,
40     guint width, guint height);
41
42 GstVaapiTexture *
43 gst_vaapi_texture_new_with_texture (GstVaapiDisplay * display, GLuint texture_id,
44     GLenum target, GLenum format);
45
46 GstVaapiTexture *
47 gst_vaapi_texture_ref (GstVaapiTexture * texture);
48
49 void
50 gst_vaapi_texture_unref (GstVaapiTexture * texture);
51
52 void
53 gst_vaapi_texture_replace (GstVaapiTexture ** old_texture_ptr,
54     GstVaapiTexture * new_texture);
55
56 GLuint
57 gst_vaapi_texture_get_id (GstVaapiTexture * texture);
58
59 GLenum
60 gst_vaapi_texture_get_target (GstVaapiTexture * texture);
61
62 GLenum
63 gst_vaapi_texture_get_format (GstVaapiTexture * texture);
64
65 guint
66 gst_vaapi_texture_get_width (GstVaapiTexture * texture);
67
68 guint
69 gst_vaapi_texture_get_height (GstVaapiTexture * texture);
70
71 void
72 gst_vaapi_texture_get_size (GstVaapiTexture * texture, guint * width_ptr,
73     guint * height_ptr);
74
75 gboolean
76 gst_vaapi_texture_put_surface (GstVaapiTexture * texture,
77     GstVaapiSurface * surface, const GstVaapiRectangle * crop_rect,
78     guint flags);
79
80 G_END_DECLS
81
82 #endif /* GST_VAAPI_TEXTURE_H */