2 * gstvaapicontext.h - VA context abstraction
4 * Copyright (C) 2010-2011 Splitted-Desktop Systems
5 * Copyright (C) 2011 Intel Corporation
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.
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.
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
23 #ifndef GST_VAAPI_CONTEXT_H
24 #define GST_VAAPI_CONTEXT_H
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>
35 #define GST_VAAPI_TYPE_CONTEXT \
36 (gst_vaapi_context_get_type())
38 #define GST_VAAPI_CONTEXT(obj) \
39 (G_TYPE_CHECK_INSTANCE_CAST((obj), \
40 GST_VAAPI_TYPE_CONTEXT, \
43 #define GST_VAAPI_CONTEXT_CLASS(klass) \
44 (G_TYPE_CHECK_CLASS_CAST((klass), \
45 GST_VAAPI_TYPE_CONTEXT, \
46 GstVaapiContextClass))
48 #define GST_VAAPI_IS_CONTEXT(obj) \
49 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_CONTEXT))
51 #define GST_VAAPI_IS_CONTEXT_CLASS(klass) \
52 (G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_CONTEXT))
54 #define GST_VAAPI_CONTEXT_GET_CLASS(obj) \
55 (G_TYPE_INSTANCE_GET_CLASS((obj), \
56 GST_VAAPI_TYPE_CONTEXT, \
57 GstVaapiContextClass))
59 typedef struct _GstVaapiContext GstVaapiContext;
60 typedef struct _GstVaapiContextPrivate GstVaapiContextPrivate;
61 typedef struct _GstVaapiContextClass GstVaapiContextClass;
66 * A VA context wrapper.
68 struct _GstVaapiContext {
70 GstVaapiObject parent_instance;
72 GstVaapiContextPrivate *priv;
76 * GstVaapiContextClass:
78 * A VA context wrapper class.
80 struct _GstVaapiContextClass {
82 GstVaapiObjectClass parent_class;
86 gst_vaapi_context_get_type(void) G_GNUC_CONST;
89 gst_vaapi_context_new(
90 GstVaapiDisplay *display,
91 GstVaapiProfile profile,
92 GstVaapiEntrypoint entrypoint,
93 GstVaapiRateControl rate_control,
100 gst_vaapi_context_reset(
101 GstVaapiContext *context,
102 GstVaapiProfile profile,
103 GstVaapiEntrypoint entrypoint,
106 unsigned int surface_num
110 gst_vaapi_context_get_id(GstVaapiContext *context);
113 gst_vaapi_context_get_profile(GstVaapiContext *context);
116 gst_vaapi_context_set_profile(GstVaapiContext *context, GstVaapiProfile profile);
119 gst_vaapi_context_get_entrypoint(GstVaapiContext *context);
122 gst_vaapi_context_get_size(
123 GstVaapiContext *context,
129 gst_vaapi_context_get_surface(GstVaapiContext *context);
131 GstVaapiSurfacePool *
132 gst_vaapi_context_get_surface_pool(GstVaapiContext *context);
136 gst_vaapi_context_get_surface_count(GstVaapiContext *context);
139 gst_vaapi_context_get_surface_left_capability(GstVaapiContext *context);
142 gst_vaapi_context_put_surface(GstVaapiContext *context, GstVaapiSurface *surface);
145 gst_vaapi_context_find_surface_by_id(GstVaapiContext *context, GstVaapiID id);
148 gst_vaapi_context_apply_composition(
149 GstVaapiContext *context,
150 GstVideoOverlayComposition *composition
155 #endif /* GST_VAAPI_CONTEXT_H */