2 * Copyright (c) 2007 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.
26 * Video Decode Acceleration -Backend API
29 #ifndef _VA_BACKEND_H_
30 #define _VA_BACKEND_H_
38 typedef struct VADriverContext *VADriverContextP;
42 VAStatus (*vaTerminate) ( VADriverContextP ctx );
44 VAStatus (*vaQueryConfigProfiles) (
46 VAProfile *profile_list, /* out */
47 int *num_profiles /* out */
50 VAStatus (*vaQueryConfigEntrypoints) (
53 VAEntrypoint *entrypoint_list, /* out */
54 int *num_entrypoints /* out */
57 VAStatus (*vaGetConfigAttributes) (
60 VAEntrypoint entrypoint,
61 VAConfigAttrib *attrib_list, /* in/out */
65 VAStatus (*vaCreateConfig) (
68 VAEntrypoint entrypoint,
69 VAConfigAttrib *attrib_list,
71 VAConfigID *config_id /* out */
74 VAStatus (*vaDestroyConfig) (
79 VAStatus (*vaQueryConfigAttributes) (
82 VAProfile *profile, /* out */
83 VAEntrypoint *entrypoint, /* out */
84 VAConfigAttrib *attrib_list, /* out */
85 int *num_attribs /* out */
88 VAStatus (*vaCreateSurfaces) (
94 VASurfaceID *surfaces /* out */
97 VAStatus (*vaDestroySurfaces) (
99 VASurfaceID *surface_list,
103 VAStatus (*vaCreateContext) (
104 VADriverContextP ctx,
105 VAConfigID config_id,
109 VASurfaceID *render_targets,
110 int num_render_targets,
111 VAContextID *context /* out */
114 VAStatus (*vaDestroyContext) (
115 VADriverContextP ctx,
119 VAStatus (*vaCreateBuffer) (
120 VADriverContextP ctx,
121 VAContextID context, /* in */
122 VABufferType type, /* in */
123 unsigned int size, /* in */
124 unsigned int num_elements, /* in */
126 VABufferID *buf_id /* out */
129 VAStatus (*vaBufferSetNumElements) (
130 VADriverContextP ctx,
131 VABufferID buf_id, /* in */
132 unsigned int num_elements /* in */
135 VAStatus (*vaMapBuffer) (
136 VADriverContextP ctx,
137 VABufferID buf_id, /* in */
138 void **pbuf /* out */
141 VAStatus (*vaUnmapBuffer) (
142 VADriverContextP ctx,
143 VABufferID buf_id /* in */
146 VAStatus (*vaDestroyBuffer) (
147 VADriverContextP ctx,
151 VAStatus (*vaBeginPicture) (
152 VADriverContextP ctx,
154 VASurfaceID render_target
157 VAStatus (*vaRenderPicture) (
158 VADriverContextP ctx,
164 VAStatus (*vaEndPicture) (
165 VADriverContextP ctx,
169 VAStatus (*vaSyncSurface) (
170 VADriverContextP ctx,
172 VASurfaceID render_target
175 VAStatus (*vaQuerySurfaceStatus) (
176 VADriverContextP ctx,
177 VASurfaceID render_target,
178 VASurfaceStatus *status /* out */
181 VAStatus (*vaPutSurface) (
182 VADriverContextP ctx,
184 Drawable draw, /* X Drawable */
191 unsigned short destw,
192 unsigned short desth,
193 VARectangle *cliprects, /* client supplied clip list */
194 unsigned int number_cliprects, /* number of clip rects in the clip list */
195 unsigned int flags /* de-interlacing flags */
198 VAStatus (*vaQueryImageFormats) (
199 VADriverContextP ctx,
200 VAImageFormat *format_list, /* out */
201 int *num_formats /* out */
204 VAStatus (*vaCreateImage) (
205 VADriverContextP ctx,
206 VAImageFormat *format,
209 VAImage *image /* out */
212 VAStatus (*vaDestroyImage) (
213 VADriverContextP ctx,
217 VAStatus (*vaSetImagePalette) (
218 VADriverContextP ctx,
221 * pointer to an array holding the palette data. The size of the array is
222 * num_palette_entries * entry_bytes in size. The order of the components
223 * in the palette is described by the component_order in VAImage struct
225 unsigned char *palette
228 VAStatus (*vaGetImage) (
229 VADriverContextP ctx,
231 int x, /* coordinates of the upper left source pixel */
233 unsigned int width, /* width and height of the region */
238 VAStatus (*vaPutImage) (
239 VADriverContextP ctx,
250 VAStatus (*vaQuerySubpictureFormats) (
251 VADriverContextP ctx,
252 VAImageFormat *format_list, /* out */
253 unsigned int *flags, /* out */
254 unsigned int *num_formats /* out */
257 VAStatus (*vaCreateSubpicture) (
258 VADriverContextP ctx,
260 VASubpictureID *subpicture /* out */
263 VAStatus (*vaDestroySubpicture) (
264 VADriverContextP ctx,
265 VASubpictureID subpicture
268 VAStatus (*vaSetSubpictureImage) (
269 VADriverContextP ctx,
270 VASubpictureID subpicture,
274 VAStatus (*vaSetSubpicturePalette) (
275 VADriverContextP ctx,
276 VASubpictureID subpicture,
278 * pointer to an array holding the palette data. The size of the array is
279 * num_palette_entries * entry_bytes in size. The order of the components
280 * in the palette is described by the component_order in VASubpicture struct
282 unsigned char *palette
285 VAStatus (*vaSetSubpictureChromakey) (
286 VADriverContextP ctx,
287 VASubpictureID subpicture,
288 unsigned int chromakey_min,
289 unsigned int chromakey_max,
290 unsigned int chromakey_mask
293 VAStatus (*vaSetSubpictureGlobalAlpha) (
294 VADriverContextP ctx,
295 VASubpictureID subpicture,
299 VAStatus (*vaAssociateSubpicture) (
300 VADriverContextP ctx,
301 VASubpictureID subpicture,
302 VASurfaceID *target_surfaces,
304 short src_x, /* upper left offset in subpicture */
306 short dest_x, /* upper left offset in surface */
308 unsigned short width,
309 unsigned short height,
311 * whether to enable chroma-keying or global-alpha
312 * see VA_SUBPICTURE_XXX values
317 VAStatus (*vaDeassociateSubpicture) (
318 VADriverContextP ctx,
319 VASubpictureID subpicture,
320 VASurfaceID *target_surfaces,
324 VAStatus (*vaQueryDisplayAttributes) (
325 VADriverContextP ctx,
326 VADisplayAttribute *attr_list, /* out */
327 int *num_attributes /* out */
330 VAStatus (*vaGetDisplayAttributes) (
331 VADriverContextP ctx,
332 VADisplayAttribute *attr_list, /* in/out */
336 VAStatus (*vaSetDisplayAttributes) (
337 VADriverContextP ctx,
338 VADisplayAttribute *attr_list,
343 VAStatus (*vaDbgCopySurfaceToBuffer) (
344 VADriverContextP ctx,
346 void **buffer, /* out */
347 unsigned int *stride /* out */
351 struct VADriverContext
353 VADriverContextP pNext;
356 struct VADriverVTable vtable;
366 int max_image_formats;
367 int max_subpic_formats;
368 int max_display_attributes;
369 const char *str_vendor;
371 void *handle; /* dlopen handle */
374 typedef VAStatus (*VADriverInit) (
375 VADriverContextP driver_context
379 #endif /* _VA_BACKEND_H_ */