Tizen 2.0 Release
[framework/multimedia/gstreamer-vaapi.git] / gst-libs / gst / vaapi / gstvaapisurface_userptr.h
1 /*
2  *  gstvaapisurface_userptr.h - VA surface abstraction for userptr
3  *
4  *  Copyright (C) 2011 Intel Corporation
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_SURFACE_USERPTR_H
23 #define GST_VAAPI_SURFACE_USERPTR_H
24
25 #include <gst/vaapi/gstvaapiobject.h>
26 #include <gst/vaapi/gstvaapisurface.h>
27 #include <gst/vaapi/gstvaapiimageformat.h>
28
29 G_BEGIN_DECLS
30
31 #define GST_VAAPI_TYPE_SURFACE_USERPTR \
32     (gst_vaapi_surface_userptr_get_type())
33
34 #define GST_VAAPI_SURFACE_USERPTR(obj)                          \
35     (G_TYPE_CHECK_INSTANCE_CAST((obj),                          \
36                                 GST_VAAPI_TYPE_SURFACE_USERPTR, \
37                                 GstVaapiSurfaceUserPtr))
38
39 #define GST_VAAPI_SURFACE_USERPTR_CLASS(klass)                          \
40     (G_TYPE_CHECK_CLASS_CAST((klass),                           \
41                              GST_VAAPI_TYPE_SURFACE_USERPTR,    \
42                              GstVaapiSurfaceUserPtrClass))
43
44 #define GST_VAAPI_IS_SURFACE_USERPTR(obj) \
45     (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_SURFACE_USERPTR))
46
47 #define GST_VAAPI_IS_SURFACE_USERPTR_CLASS(klass) \
48     (G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_SURFACE_USERPTR))
49
50 #define GST_VAAPI_SURFACE_USERPTR_GET_CLASS(obj)                        \
51     (G_TYPE_INSTANCE_GET_CLASS((obj),                           \
52                                GST_VAAPI_TYPE_SURFACE_USERPTR,  \
53                                GstVaapiSurfaceUserPtrClass))
54
55 typedef struct _GstVaapiSurfaceUserPtr          GstVaapiSurfaceUserPtr;
56 typedef struct _GstVaapiSurfaceUserPtrPrivate   GstVaapiSurfaceUserPtrPrivate;
57 typedef struct _GstVaapiSurfaceUserPtrClass     GstVaapiSurfaceUserPtrClass;
58
59 /**
60  * GstVaapiSurfaceUserPtr:
61  *
62  * A VA surface userptr wrapper.
63  */
64 struct _GstVaapiSurfaceUserPtr {
65     /*< private >*/
66     GstVaapiSurface parent_instance;
67
68     GstVaapiSurfaceUserPtrPrivate *priv;
69 };
70
71 /**
72  * GstVaapiSurfaceUserPtrClass:
73  *
74  * A VA surface userptr wrapper class.
75  */
76 struct _GstVaapiSurfaceUserPtrClass {
77     /*< private >*/
78     GstVaapiSurfaceClass parent_class;
79 };
80
81 GType
82 gst_vaapi_surface_userptr_get_type(void) G_GNUC_CONST;
83
84 GstVaapiSurfaceUserPtr *
85 gst_vaapi_surface_userptr_new(
86     GstVaapiDisplay    *display,
87     GstVaapiChromaType  chroma_type,
88     GstVaapiImageFormat format,
89     guint               width,
90     guint               height
91 );
92
93 GstVaapiImageFormat
94 gst_vaapi_surface_userptr_get_format(GstVaapiSurfaceUserPtr *surface);
95
96 G_END_DECLS
97
98 #endif /* GST_VAAPI_SURFACE_USERPTR_H */