Add support for GstVaapiSurfaceProxy to GstVaapiVideoBuffer.
[vaapi:gstreamer-vaapi.git] / gst-libs / gst / vaapi / gstvaapivideobuffer.h
1 /*
2  *  gstvaapivideobuffer.h - Gstreamer/VA video buffer
3  *
4  *  gstreamer-vaapi (C) 2010 Splitted-Desktop Systems
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (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
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
19  */
20
21 #ifndef GST_VAAPI_VIDEO_BUFFER_H
22 #define GST_VAAPI_VIDEO_BUFFER_H
23
24 #include <gst/gstbuffer.h>
25 #include <gst/vaapi/gstvaapiimage.h>
26 #include <gst/vaapi/gstvaapisurface.h>
27 #include <gst/vaapi/gstvaapisurfaceproxy.h>
28 #include <gst/vaapi/gstvaapivideopool.h>
29
30 G_BEGIN_DECLS
31
32 #define GST_VAAPI_TYPE_VIDEO_BUFFER \
33     (gst_vaapi_video_buffer_get_type())
34
35 #define GST_VAAPI_VIDEO_BUFFER(obj)                             \
36     (G_TYPE_CHECK_INSTANCE_CAST((obj),                          \
37                                 GST_VAAPI_TYPE_VIDEO_BUFFER,    \
38                                 GstVaapiVideoBuffer))
39
40 #define GST_VAAPI_VIDEO_BUFFER_CLASS(klass)                     \
41     (G_TYPE_CHECK_CLASS_CAST((klass),                           \
42                              GST_VAAPI_TYPE_VIDEO_BUFFER,       \
43                              GstVaapiVideoBufferClass))
44
45 #define GST_VAAPI_IS_VIDEO_BUFFER(obj) \
46     (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_VIDEO_BUFFER))
47
48 #define GST_VAAPI_IS_VIDEO_BUFFER_CLASS(klass) \
49     (G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_VIDEO_BUFFER))
50
51 #define GST_VAAPI_VIDEO_BUFFER_GET_CLASS(obj)                   \
52     (G_TYPE_INSTANCE_GET_CLASS((obj),                           \
53                                GST_VAAPI_TYPE_VIDEO_BUFFER,     \
54                                GstVaapiVideoBufferClass))
55
56 typedef struct _GstVaapiVideoBuffer             GstVaapiVideoBuffer;
57 typedef struct _GstVaapiVideoBufferPrivate      GstVaapiVideoBufferPrivate;
58 typedef struct _GstVaapiVideoBufferClass        GstVaapiVideoBufferClass;
59
60 /**
61  * GstVaapiVideoBuffer:
62  *
63  * A #GstBuffer holding video objects (#GstVaapiSurface and #GstVaapiImage).
64  */
65 struct _GstVaapiVideoBuffer {
66     /*< private >*/
67     GstBuffer parent_instance;
68
69     GstVaapiVideoBufferPrivate *priv;
70 };
71
72 /**
73  * GstVaapiVideoBufferClass:
74  *
75  * A #GstBuffer holding video objects
76  */
77 struct _GstVaapiVideoBufferClass {
78     /*< private >*/
79     GstBufferClass parent_class;
80 };
81
82 GType
83 gst_vaapi_video_buffer_get_type(void);
84
85 GstBuffer *
86 gst_vaapi_video_buffer_new_from_pool(GstVaapiVideoPool *pool);
87
88 GstBuffer *
89 gst_vaapi_video_buffer_new_with_image(GstVaapiImage *image);
90
91 GstBuffer *
92 gst_vaapi_video_buffer_new_with_surface(GstVaapiSurface *surface);
93
94 GstBuffer *
95 gst_vaapi_video_buffer_new_with_surface_proxy(GstVaapiSurfaceProxy *proxy);
96
97 GstVaapiImage *
98 gst_vaapi_video_buffer_get_image(GstVaapiVideoBuffer *buffer);
99
100 void
101 gst_vaapi_video_buffer_set_image(
102     GstVaapiVideoBuffer *buffer,
103     GstVaapiImage       *image
104 );
105
106 gboolean
107 gst_vaapi_video_buffer_set_image_from_pool(
108     GstVaapiVideoBuffer *buffer,
109     GstVaapiVideoPool   *pool
110 );
111
112 GstVaapiSurface *
113 gst_vaapi_video_buffer_get_surface(GstVaapiVideoBuffer *buffer);
114
115 void
116 gst_vaapi_video_buffer_set_surface(
117     GstVaapiVideoBuffer *buffer,
118     GstVaapiSurface     *surface
119 );
120
121 gboolean
122 gst_vaapi_video_buffer_set_surface_from_pool(
123     GstVaapiVideoBuffer *buffer,
124     GstVaapiVideoPool   *pool
125 );
126
127 GstVaapiSurfaceProxy *
128 gst_vaapi_video_buffer_get_surface_proxy(GstVaapiVideoBuffer *buffer);
129
130 void
131 gst_vaapi_video_buffer_set_surface_proxy(
132     GstVaapiVideoBuffer  *buffer,
133     GstVaapiSurfaceProxy *proxy
134 );
135
136 G_END_DECLS
137
138 #endif /* GST_VAAPI_VIDEO_BUFFER_H */