Tizen 2.1 base
[framework/multimedia/gstreamer-vaapi.git] / gst-libs / gst / vaapi / gstvaapivideobuffer.h
1 /*
2  *  gstvaapivideobuffer.h - Gstreamer/VA video buffer
3  *
4  *  Copyright (C) 2010-2011 Splitted-Desktop Systems
5  *  Copyright (C) 2011 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_VIDEO_BUFFER_H
24 #define GST_VAAPI_VIDEO_BUFFER_H
25
26 #include <gst/video/gstsurfacebuffer.h>
27 #include <gst/vaapi/gstvaapidisplay.h>
28 #include <gst/vaapi/gstvaapiimage.h>
29 #include <gst/vaapi/gstvaapisurface.h>
30 #include <gst/vaapi/gstvaapisurfaceproxy.h>
31 #include <gst/vaapi/gstvaapivideopool.h>
32
33 G_BEGIN_DECLS
34
35 #define GST_VAAPI_TYPE_VIDEO_BUFFER \
36     (gst_vaapi_video_buffer_get_type())
37
38 #define GST_VAAPI_VIDEO_BUFFER(obj)                             \
39     (G_TYPE_CHECK_INSTANCE_CAST((obj),                          \
40                                 GST_VAAPI_TYPE_VIDEO_BUFFER,    \
41                                 GstVaapiVideoBuffer))
42
43 #define GST_VAAPI_VIDEO_BUFFER_CLASS(klass)                     \
44     (G_TYPE_CHECK_CLASS_CAST((klass),                           \
45                              GST_VAAPI_TYPE_VIDEO_BUFFER,       \
46                              GstVaapiVideoBufferClass))
47
48 #define GST_VAAPI_IS_VIDEO_BUFFER(obj) \
49     (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_VIDEO_BUFFER))
50
51 #define GST_VAAPI_IS_VIDEO_BUFFER_CLASS(klass) \
52     (G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_VIDEO_BUFFER))
53
54 #define GST_VAAPI_VIDEO_BUFFER_GET_CLASS(obj)                   \
55     (G_TYPE_INSTANCE_GET_CLASS((obj),                           \
56                                GST_VAAPI_TYPE_VIDEO_BUFFER,     \
57                                GstVaapiVideoBufferClass))
58
59 typedef struct _GstVaapiVideoBuffer             GstVaapiVideoBuffer;
60 typedef struct _GstVaapiVideoBufferPrivate      GstVaapiVideoBufferPrivate;
61 typedef struct _GstVaapiVideoBufferClass        GstVaapiVideoBufferClass;
62
63 /**
64  * GstVaapiVideoBuffer:
65  *
66  * A #GstBuffer holding video objects (#GstVaapiSurface and #GstVaapiImage).
67  */
68 struct _GstVaapiVideoBuffer {
69     /*< private >*/
70     GstSurfaceBuffer parent_instance;
71
72     GstVaapiVideoBufferPrivate *priv;
73 };
74
75 /**
76  * GstVaapiVideoBufferClass:
77  *
78  * A #GstBuffer holding video objects
79  */
80 struct _GstVaapiVideoBufferClass {
81     /*< private >*/
82     GstSurfaceBufferClass parent_class;
83 };
84
85 GType
86 gst_vaapi_video_buffer_get_type(void) G_GNUC_CONST;
87
88 GstVaapiDisplay *
89 gst_vaapi_video_buffer_get_display(GstVaapiVideoBuffer *buffer);
90
91 GstVaapiImage *
92 gst_vaapi_video_buffer_get_image(GstVaapiVideoBuffer *buffer);
93
94 void
95 gst_vaapi_video_buffer_set_image(
96     GstVaapiVideoBuffer *buffer,
97     GstVaapiImage       *image
98 );
99
100 gboolean
101 gst_vaapi_video_buffer_set_image_from_pool(
102     GstVaapiVideoBuffer *buffer,
103     GstVaapiVideoPool   *pool
104 );
105
106 GstVaapiSurface *
107 gst_vaapi_video_buffer_get_surface(GstVaapiVideoBuffer *buffer);
108
109 void
110 gst_vaapi_video_buffer_set_surface(
111     GstVaapiVideoBuffer *buffer,
112     GstVaapiSurface     *surface
113 );
114
115 gboolean
116 gst_vaapi_video_buffer_set_surface_from_pool(
117     GstVaapiVideoBuffer *buffer,
118     GstVaapiVideoPool   *pool
119 );
120
121 GstVaapiSurfaceProxy *
122 gst_vaapi_video_buffer_get_surface_proxy(GstVaapiVideoBuffer *buffer);
123
124 void
125 gst_vaapi_video_buffer_set_surface_proxy(
126     GstVaapiVideoBuffer  *buffer,
127     GstVaapiSurfaceProxy *proxy
128 );
129
130 guint
131 gst_vaapi_video_buffer_get_render_flags(GstVaapiVideoBuffer *buffer);
132
133 void
134 gst_vaapi_video_buffer_set_render_flags(GstVaapiVideoBuffer *buffer, guint flags);
135
136 gboolean
137 gst_vaapi_video_buffer_ensure_pointer(GstVaapiVideoBuffer *buffer);
138
139 G_END_DECLS
140
141 #endif /* GST_VAAPI_VIDEO_BUFFER_H */