2 * Copyright (c) 2012 Intel Corporation. All Rights Reserved.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the
6 * "Software"), to deal in the Software without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sub license, and/or sell copies of the Software, and to
9 * permit persons to whom the Software is furnished to do so, subject to
10 * the following conditions:
12 * The above copyright notice and this permission notice (including the
13 * next paragraph) shall be included in all copies or substantial portions
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
19 * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
20 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 #include <EGL/eglext.h>
35 typedef void *VASurfaceEGL;
37 /*This function is used to get EGLClientBuffer
38 * (lower 16bits is buffer index, upper 16bits
39 * is BC device id.) from surface id. Application
40 * should maintain EGLClientBuffer itself.*/
42 VAStatus vaGetEGLClientBufferFromSurface (
45 EGLClientBuffer *buffer /* out*/
49 * Return a suitable VADisplay for VA API
51 * @param[in] native_dpy the native display
52 * @param[in] egl_dpy the EGL display
55 VADisplay vaGetDisplayEGL(
56 VANativeDisplay native_dpy,
61 * Return maximum number of EGL targets supported by the implementation
63 * @param[in] dpy the VADisplay
64 * @return the maximum number of EGL Target
66 int vaMaxNumSurfaceTargetsEGL(
71 * Return maximum number of EGL surface attributes supported by the implementation
73 * @param[in] dpy the VADisplay
74 * @return the maximum number of EGL surface attributes
76 int vaMaxNumSurfaceAttributesEGL(
81 * Query supported EGL targets for eglCreateImageKHR().
83 * The caller must provide a "target_list" array that can hold at
84 * least vaMaxNumSurfaceTargetsEGL() entries. The actual number of
85 * targets returned in "target_list" is returned in "num_targets".
87 * @param[in]] dpy the VADisplay
88 * @param[out] target_list the array to hold target entries
89 * @param[out] num_targets the actual number of targets
90 * @return VA_STATUS_SUCCESS if successful
92 VAStatus vaQuerySurfaceTargetsEGL(
94 EGLenum *target_list, /* out */
95 int *num_targets /* out */
99 * Creates a VA/EGL surface with the specified target
101 * If target is 0, this means the best efficient target by default.
103 * @param[in] dpy the VADisplay
104 * @param[in] target the specified EGL target
105 * @param[in] width the surface width
106 * @param[in] height the surface height
107 * @param[out] gl_surface the VA/EGL surface
108 * @return VA_STATUS_SUCCESS if successful
110 VAStatus vaCreateSurfaceEGL(
115 VASurfaceEGL *gl_surface
119 * Destroy a VA/EGL surface
121 * The application shall maintain the live EGL context itself.
123 * @param[in] dpy the VA display
124 * @param[in] gl_surface the VA surface
125 * @return VA_STATUS_SUCCESS if successful
127 VAStatus vaDestroySurfaceEGL(
129 VASurfaceEGL gl_surface
133 * Associate a EGL surface with a VA surface
135 * @param[in] dpy the VA display
136 * @param[in] egl_surface the VA/EGL destination surface
137 * @param[in] surface the VA surface
138 * @param[in] flags the flags to PutSurface
139 * @return VA_STATUS_SUCCESS if successful
141 VAStatus vaAssociateSurfaceEGL(
143 VASurfaceEGL egl_surface,
149 * Update the content of a VA/EGL surface
151 * Changes to VA surface are committed to VA/EGL surface at this point.
153 * @param[in] dpy the VA display
154 * @param[in] egl_surface the VA/EGL surface that has been associated with a VA surface
155 * @return VA_STATUS_SUCCESS if successful
157 VAStatus vaSyncSurfaceEGL(
159 VASurfaceEGL egl_surface
163 * Get the necessary information for eglCreateImageKHR()
165 * The caller must provide a "attrib_list" array that can hold at
166 * least (2 * vaMaxNumSurfaceAttributesEGL()) entries. The last attribute
167 * specified in attrib_list must be EGL_NONE
169 * @param[in] dpy the VA display
170 * @param[in] egl_surface the VA/EGL surface that has been associated with a VA surface
171 * @param[out] target the type of <buffer> for eglCreateImageKHR()
172 * @param[out] buffer the EGLClientBuffer for eglCreateImageKHR()
173 * @param[out] attrib_list the list of attribute-value pairs for eglCreateImageKHR()
174 * @param[in/out] num_attribs input: the number of allocated attribute-value pairs in attrib_list; output: the actual number of attribute-value pairs
175 * @return VA_STATUS_SUCCESS if successful
177 VAStatus vaGetSurfaceInfoEGL(
179 VASurfaceEGL egl_surface,
180 EGLenum *target, /* out, the type of <buffer> */
181 EGLClientBuffer *buffer, /* out */
182 EGLint *attrib_list, /* out, the last attribute must be EGL_NONE */
183 int *num_attribs /* in/out, the number of attribute-value pairs */
187 * Deassociate a EGL surface
189 * @param[in] dpy the VA display
190 * @param[in] egl_surface the VA/EGL destination surface
191 * @return VA_STATUS_SUCCESS if successful
193 VAStatus vaDeassociateSurfaceEGL(
195 VASurfaceEGL egl_surface
202 #endif /* _VA_EGL_H_ */