Tizen 2.0 Release
[framework/multimedia/gstreamer-vaapi.git] / gst-libs / gst / vaapi / gstvaapicontext.h
1 /*
2  *  gstvaapicontext.h - VA context abstraction
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_CONTEXT_H
24 #define GST_VAAPI_CONTEXT_H
25
26 #include <gst/vaapi/gstvaapiobject.h>
27 #include <gst/vaapi/gstvaapiprofile.h>
28 #include <gst/vaapi/gstvaapidisplay.h>
29 #include <gst/vaapi/gstvaapisurface.h>
30 #include <gst/video/video-overlay-composition.h>
31 #include <gst/vaapi/gstvaapisurfacepool.h>
32
33 G_BEGIN_DECLS
34
35 #define GST_VAAPI_TYPE_CONTEXT \
36     (gst_vaapi_context_get_type())
37
38 #define GST_VAAPI_CONTEXT(obj)                          \
39     (G_TYPE_CHECK_INSTANCE_CAST((obj),                  \
40                                 GST_VAAPI_TYPE_CONTEXT, \
41                                 GstVaapiContext))
42
43 #define GST_VAAPI_CONTEXT_CLASS(klass)                  \
44     (G_TYPE_CHECK_CLASS_CAST((klass),                   \
45                              GST_VAAPI_TYPE_CONTEXT,    \
46                              GstVaapiContextClass))
47
48 #define GST_VAAPI_IS_CONTEXT(obj) \
49     (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_CONTEXT))
50
51 #define GST_VAAPI_IS_CONTEXT_CLASS(klass) \
52     (G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_CONTEXT))
53
54 #define GST_VAAPI_CONTEXT_GET_CLASS(obj)                \
55     (G_TYPE_INSTANCE_GET_CLASS((obj),                   \
56                                GST_VAAPI_TYPE_CONTEXT,  \
57                                GstVaapiContextClass))
58
59 typedef struct _GstVaapiContext                 GstVaapiContext;
60 typedef struct _GstVaapiContextPrivate          GstVaapiContextPrivate;
61 typedef struct _GstVaapiContextClass            GstVaapiContextClass;
62
63 /**
64  * GstVaapiContext:
65  *
66  * A VA context wrapper.
67  */
68 struct _GstVaapiContext {
69     /*< private >*/
70     GstVaapiObject parent_instance;
71
72     GstVaapiContextPrivate *priv;
73 };
74
75 /**
76  * GstVaapiContextClass:
77  *
78  * A VA context wrapper class.
79  */
80 struct _GstVaapiContextClass {
81     /*< private >*/
82     GstVaapiObjectClass parent_class;
83 };
84
85 GType
86 gst_vaapi_context_get_type(void) G_GNUC_CONST;
87
88 GstVaapiContext *
89 gst_vaapi_context_new(
90     GstVaapiDisplay    *display,
91     GstVaapiProfile     profile,
92     GstVaapiEntrypoint  entrypoint,
93     GstVaapiRateControl rate_control,
94     guint               width,
95     guint               height,
96     guint               surface_num
97 );
98
99 gboolean
100 gst_vaapi_context_reset(
101     GstVaapiContext    *context,
102     GstVaapiProfile     profile,
103     GstVaapiEntrypoint  entrypoint,
104     unsigned int        width,
105     unsigned int        height,
106     unsigned int        surface_num
107 );
108
109 GstVaapiID
110 gst_vaapi_context_get_id(GstVaapiContext *context);
111
112 GstVaapiProfile
113 gst_vaapi_context_get_profile(GstVaapiContext *context);
114
115 gboolean
116 gst_vaapi_context_set_profile(GstVaapiContext *context, GstVaapiProfile profile);
117
118 GstVaapiEntrypoint
119 gst_vaapi_context_get_entrypoint(GstVaapiContext *context);
120
121 void
122 gst_vaapi_context_get_size(
123     GstVaapiContext *context,
124     guint           *pwidth,
125     guint           *pheight
126 );
127
128 GstVaapiSurface *
129 gst_vaapi_context_get_surface(GstVaapiContext *context);
130
131 GstVaapiSurfacePool *
132 gst_vaapi_context_get_surface_pool(GstVaapiContext *context);
133
134
135 guint
136 gst_vaapi_context_get_surface_count(GstVaapiContext *context);
137
138 guint
139 gst_vaapi_context_get_surface_left_capability(GstVaapiContext *context);
140
141 void
142 gst_vaapi_context_put_surface(GstVaapiContext *context, GstVaapiSurface *surface);
143
144 GstVaapiSurface *
145 gst_vaapi_context_find_surface_by_id(GstVaapiContext *context, GstVaapiID id);
146
147 gboolean
148 gst_vaapi_context_apply_composition(
149     GstVaapiContext            *context,
150     GstVideoOverlayComposition *composition
151 );
152
153 G_END_DECLS
154
155 #endif /* GST_VAAPI_CONTEXT_H */