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 _GstVaapiContextInfo GstVaapiContextInfo;
61 typedef struct _GstVaapiContextPrivate GstVaapiContextPrivate;
62 typedef struct _GstVaapiContextClass GstVaapiContextClass;
65 * GstVaapiContextInfo:
67 * Structure holding VA context info like encoded size, decoder
68 * profile and entry-point to use, and maximum number of reference
69 * frames reported by the bitstream.
71 struct _GstVaapiContextInfo {
72 GstVaapiProfile profile;
73 GstVaapiEntrypoint entrypoint;
82 * A VA context wrapper.
84 struct _GstVaapiContext {
86 GstVaapiObject parent_instance;
88 GstVaapiContextPrivate *priv;
92 * GstVaapiContextClass:
94 * A VA context wrapper class.
96 struct _GstVaapiContextClass {
98 GstVaapiObjectClass parent_class;
102 gst_vaapi_context_get_type(void) G_GNUC_CONST;
105 gst_vaapi_context_new(
106 GstVaapiDisplay *display,
107 GstVaapiProfile profile,
108 GstVaapiEntrypoint entrypoint,
114 gst_vaapi_context_new_full(GstVaapiDisplay *display, GstVaapiContextInfo *cip);
117 gst_vaapi_context_reset(
118 GstVaapiContext *context,
119 GstVaapiProfile profile,
120 GstVaapiEntrypoint entrypoint,
126 gst_vaapi_context_reset_full(GstVaapiContext *context, GstVaapiContextInfo *cip);
129 gst_vaapi_context_get_id(GstVaapiContext *context);
132 gst_vaapi_context_get_profile(GstVaapiContext *context);
135 gst_vaapi_context_set_profile(GstVaapiContext *context, GstVaapiProfile profile);
138 gst_vaapi_context_get_entrypoint(GstVaapiContext *context);
141 gst_vaapi_context_get_size(
142 GstVaapiContext *context,
148 gst_vaapi_context_get_surface(GstVaapiContext *context);
150 GstVaapiSurfacePool *
151 gst_vaapi_context_get_surface_pool(GstVaapiContext *context);
155 gst_vaapi_context_get_surface_count(GstVaapiContext *context);
158 gst_vaapi_context_put_surface(GstVaapiContext *context, GstVaapiSurface *surface);
161 gst_vaapi_context_find_surface_by_id(GstVaapiContext *context, GstVaapiID id);
164 gst_vaapi_context_apply_composition(
165 GstVaapiContext *context,
166 GstVideoOverlayComposition *composition
171 #endif /* GST_VAAPI_CONTEXT_H */