OSDN Git Service

93b5c42f08828cd88c7064b28dcf3d43caf0d410
[android-x86/hardware-intel-common-libva.git] / va / va_vpp.h
1 /*
2  * Copyright (c) 2007-2011 Intel Corporation. All Rights Reserved.
3  *
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:
11  *
12  * The above copyright notice and this permission notice (including the
13  * next paragraph) shall be included in all copies or substantial portions
14  * of the Software.
15  *
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 INTEL 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.
23  */
24
25 /**
26  * \file va_vpp.h
27  * \brief The video processing API
28  *
29  * This file contains the \ref api_vpp "Video processing API".
30  */
31
32 #ifndef VA_VPP_H
33 #define VA_VPP_H
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 /**
40  * \defgroup api_vpp Video processing API
41  *
42  * @{
43  *
44  * The video processing API uses the same paradigm as for decoding:
45  * - Query for supported filters;
46  * - Set up a video processing pipeline;
47  * - Send video processing parameters through VA buffers.
48  *
49  * \section api_vpp_caps Query for supported filters
50  *
51  * Checking whether video processing is supported can be performed
52  * with vaQueryConfigEntrypoints() and the profile argument set to
53  * #VAProfileNone. If video processing is supported, then the list of
54  * returned entry-points will include #VAEntrypointVideoProc.
55  *
56  * \code
57  * VAEntrypoint *entrypoints;
58  * int i, num_entrypoints, supportsVideoProcessing = 0;
59  *
60  * num_entrypoints = vaMaxNumEntrypoints();
61  * entrypoints = malloc(num_entrypoints * sizeof(entrypoints[0]);
62  * vaQueryConfigEntrypoints(va_dpy, VAProfileNone,
63  *     entrypoints, &num_entrypoints);
64  *
65  * for (i = 0; !supportsVideoProcessing && i < num_entrypoints; i++) {
66  *     if (entrypoints[i] == VAEntrypointVideoProc)
67  *         supportsVideoProcessing = 1;
68  * }
69  * \endcode
70  *
71  * Then, the vaQueryVideoProcFilters() function is used to query the
72  * list of video processing filters.
73  *
74  * \code
75  * VAProcFilterType filters[VAProcFilterCount];
76  * unsigned int num_filters = VAProcFilterCount;
77  *
78  * // num_filters shall be initialized to the length of the array
79  * vaQueryVideoProcFilters(va_dpy, vpp_ctx, &filters, &num_filters);
80  * \endcode
81  *
82  * Finally, individual filter capabilities can be checked with
83  * vaQueryVideoProcFilterCaps().
84  *
85  * \code
86  * VAProcFilterCap denoise_caps;
87  * unsigned int num_denoise_caps = 1;
88  * vaQueryVideoProcFilterCaps(va_dpy, vpp_ctx,
89  *     VAProcFilterNoiseReduction,
90  *     &denoise_caps, &num_denoise_caps
91  * );
92  *
93  * VAProcFilterCapDeinterlacing deinterlacing_caps[VAProcDeinterlacingCount];
94  * unsigned int num_deinterlacing_caps = VAProcDeinterlacingCount;
95  * vaQueryVideoProcFilterCaps(va_dpy, vpp_ctx,
96  *     VAProcFilterDeinterlacing,
97  *     &deinterlacing_caps, &num_deinterlacing_caps
98  * );
99  * \endcode
100  *
101  * \section api_vpp_setup Set up a video processing pipeline
102  *
103  * A video processing pipeline buffer is created for each source
104  * surface we want to process. However, buffers holding filter
105  * parameters can be created once and for all. Rationale is to avoid
106  * multiple creation/destruction chains of filter buffers and also
107  * because filter parameters generally won't change frame after
108  * frame. e.g. this makes it possible to implement a checkerboard of
109  * videos where the same filters are applied to each video source.
110  *
111  * The general control flow is demonstrated by the following pseudo-code:
112  * \code
113  * // Create filters
114  * VABufferID denoise_filter, deint_filter;
115  * VABufferID filter_bufs[VAProcFilterCount];
116  * unsigned int num_filter_bufs;
117  *
118  * for (i = 0; i < num_filters; i++) {
119  *     switch (filters[i]) {
120  *     case VAProcFilterNoiseReduction: {       // Noise reduction filter
121  *         VAProcFilterParameterBuffer denoise;
122  *         denoise.type  = VAProcFilterNoiseReduction;
123  *         denoise.value = 0.5;
124  *         vaCreateBuffer(va_dpy, vpp_ctx,
125  *             VAProcFilterParameterBufferType, sizeof(denoise), 1,
126  *             &denoise, &denoise_filter
127  *         );
128  *         filter_bufs[num_filter_bufs++] = denoise_filter;
129  *         break;
130  *     }
131  *
132  *     case VAProcFilterDeinterlacing:          // Motion-adaptive deinterlacing
133  *         for (j = 0; j < num_deinterlacing_caps; j++) {
134  *             VAProcFilterCapDeinterlacing * const cap = &deinterlacing_caps[j];
135  *             if (cap->type != VAProcDeinterlacingMotionAdaptive)
136  *                 continue;
137  *
138  *             VAProcFilterParameterBufferDeinterlacing deint;
139  *             deint.type                   = VAProcFilterDeinterlacing;
140  *             deint.algorithm              = VAProcDeinterlacingMotionAdaptive;
141  *             vaCreateBuffer(va_dpy, vpp_ctx,
142  *                 VAProcFilterParameterBufferType, sizeof(deint), 1,
143  *                 &deint, &deint_filter
144  *             );
145  *             filter_bufs[num_filter_bufs++] = deint_filter;
146  *         }
147  *     }
148  * }
149  * \endcode
150  *
151  * Once the video processing pipeline is set up, the caller shall check the
152  * implied capabilities and requirements with vaQueryVideoProcPipelineCaps().
153  * This function can be used to validate the number of reference frames are
154  * needed by the specified deinterlacing algorithm, the supported color
155  * primaries, etc.
156  * \code
157  * // Create filters
158  * VAProcPipelineCaps pipeline_caps;
159  * VASurfaceID *forward_references;
160  * unsigned int num_forward_references;
161  * VASurfaceID *backward_references;
162  * unsigned int num_backward_references;
163  * VAProcColorStandardType in_color_standards[VAProcColorStandardCount];
164  * VAProcColorStandardType out_color_standards[VAProcColorStandardCount];
165  *
166  * pipeline_caps.input_color_standards      = NULL;
167  * pipeline_caps.num_input_color_standards  = ARRAY_ELEMS(in_color_standards);
168  * pipeline_caps.output_color_standards     = NULL;
169  * pipeline_caps.num_output_color_standards = ARRAY_ELEMS(out_color_standards);
170  * vaQueryVideoProcPipelineCaps(va_dpy, vpp_ctx,
171  *     filter_bufs, num_filter_bufs,
172  *     &pipeline_caps
173  * );
174  *
175  * num_forward_references  = pipeline_caps.num_forward_references;
176  * forward_references      =
177  *     malloc(num__forward_references * sizeof(VASurfaceID));
178  * num_backward_references = pipeline_caps.num_backward_references;
179  * backward_references     =
180  *     malloc(num_backward_references * sizeof(VASurfaceID));
181  * \endcode
182  *
183  * \section api_vpp_submit Send video processing parameters through VA buffers
184  *
185  * Video processing pipeline parameters are submitted for each source
186  * surface to process. Video filter parameters can also change, per-surface.
187  * e.g. the list of reference frames used for deinterlacing.
188  *
189  * \code
190  * foreach (iteration) {
191  *     vaBeginPicture(va_dpy, vpp_ctx, vpp_surface);
192  *     foreach (surface) {
193  *         VARectangle output_region;
194  *         VABufferID pipeline_buf;
195  *         VAProcPipelineParameterBuffer *pipeline_param;
196  *
197  *         vaCreateBuffer(va_dpy, vpp_ctx,
198  *             VAProcPipelineParameterBuffer, sizeof(*pipeline_param), 1,
199  *             NULL, &pipeline_buf
200  *         );
201  *
202  *         // Setup output region for this surface
203  *         // e.g. upper left corner for the first surface
204  *         output_region.x     = BORDER;
205  *         output_region.y     = BORDER;
206  *         output_region.width =
207  *             (vpp_surface_width - (Nx_surfaces + 1) * BORDER) / Nx_surfaces;
208  *         output_region.height =
209  *             (vpp_surface_height - (Ny_surfaces + 1) * BORDER) / Ny_surfaces;
210  *
211  *         vaMapBuffer(va_dpy, pipeline_buf, &pipeline_param);
212  *         pipeline_param->surface              = surface;
213  *         pipeline_param->surface_region       = NULL;
214  *         pipeline_param->output_region        = &output_region;
215  *         pipeline_param->output_background_color = 0;
216  *         if (first surface to render)
217  *             pipeline_param->output_background_color = 0xff000000; // black
218  *         pipeline_param->filter_flags         = VA_FILTER_SCALING_HQ;
219  *         pipeline_param->filters              = filter_bufs;
220  *         pipeline_param->num_filters          = num_filter_bufs;
221  *         vaUnmapBuffer(va_dpy, pipeline_buf);
222  *
223  *         // Update reference frames for deinterlacing, if necessary
224  *         pipeline_param->forward_references      = forward_references;
225  *         pipeline_param->num_forward_references  = num_forward_references_used;
226  *         pipeline_param->backward_references     = backward_references;
227  *         pipeline_param->num_backward_references = num_bacward_references_used;
228  *
229  *         // Apply filters
230  *         vaRenderPicture(va_dpy, vpp_ctx, &pipeline_buf, 1);
231  *     }
232  *     vaEndPicture(va_dpy, vpp_ctx);
233  * }
234  * \endcode
235  */
236
237 /** \brief Video filter types. */
238 typedef enum _VAProcFilterType {
239     VAProcFilterNone = 0,
240     /** \brief Noise reduction filter. */
241     VAProcFilterNoiseReduction,
242     /** \brief Deinterlacing filter. */
243     VAProcFilterDeinterlacing,
244     /** \brief Sharpening filter. */
245     VAProcFilterSharpening,
246     /** \brief Color balance parameters. */
247     VAProcFilterColorBalance,
248     /** \brief Skin Tone Enhancement. */
249     VAProcFilterSkinToneEnhancement,
250     /** \brief Total Color Correction. */
251     VAProcFilterTotalColorCorrection,
252     /** \brief Human Vision System(HVS) Noise reduction filter. */
253     VAProcFilterHVSNoiseReduction,
254     /** \brief Number of video filters. */
255     VAProcFilterCount
256 } VAProcFilterType;
257
258 /** \brief Deinterlacing types. */
259 typedef enum _VAProcDeinterlacingType {
260     VAProcDeinterlacingNone = 0,
261     /** \brief Bob deinterlacing algorithm. */
262     VAProcDeinterlacingBob,
263     /** \brief Weave deinterlacing algorithm. */
264     VAProcDeinterlacingWeave,
265     /** \brief Motion adaptive deinterlacing algorithm. */
266     VAProcDeinterlacingMotionAdaptive,
267     /** \brief Motion compensated deinterlacing algorithm. */
268     VAProcDeinterlacingMotionCompensated,
269     /** \brief Number of deinterlacing algorithms. */
270     VAProcDeinterlacingCount
271 } VAProcDeinterlacingType;
272
273 /** \brief Color balance types. */
274 typedef enum _VAProcColorBalanceType {
275     VAProcColorBalanceNone = 0,
276     /** \brief Hue. */
277     VAProcColorBalanceHue,
278     /** \brief Saturation. */
279     VAProcColorBalanceSaturation,
280     /** \brief Brightness. */
281     VAProcColorBalanceBrightness,
282     /** \brief Contrast. */
283     VAProcColorBalanceContrast,
284     /** \brief Automatically adjusted saturation. */
285     VAProcColorBalanceAutoSaturation,
286     /** \brief Automatically adjusted brightness. */
287     VAProcColorBalanceAutoBrightness,
288     /** \brief Automatically adjusted contrast. */
289     VAProcColorBalanceAutoContrast,
290     /** \brief Number of color balance attributes. */
291     VAProcColorBalanceCount
292 } VAProcColorBalanceType;
293
294 /** \brief Color standard types.
295  *
296  * These define a set of color properties corresponding to particular
297  * video standards.
298  *
299  * Where matrix_coefficients is specified, it applies only to YUV data -
300  * RGB data always use the identity matrix (matrix_coefficients = 0).
301  */
302 typedef enum _VAProcColorStandardType {
303     VAProcColorStandardNone = 0,
304     /** \brief ITU-R BT.601.
305      *
306      * It is unspecified whether this will use 525-line or 625-line values;
307      * specify the colour primaries and matrix coefficients explicitly if
308      * it is known which one is required.
309      *
310      * Equivalent to:
311      *   colour_primaries = 5 or 6
312      *   transfer_characteristics = 6
313      *   matrix_coefficients = 5 or 6
314      */
315     VAProcColorStandardBT601,
316     /** \brief ITU-R BT.709.
317      *
318      * Equivalent to:
319      *   colour_primaries = 1
320      *   transfer_characteristics = 1
321      *   matrix_coefficients = 1
322      */
323     VAProcColorStandardBT709,
324     /** \brief ITU-R BT.470-2 System M.
325      *
326      * Equivalent to:
327      *   colour_primaries = 4
328      *   transfer_characteristics = 4
329      *   matrix_coefficients = 4
330      */
331     VAProcColorStandardBT470M,
332     /** \brief ITU-R BT.470-2 System B, G.
333      *
334      * Equivalent to:
335      *   colour_primaries = 5
336      *   transfer_characteristics = 5
337      *   matrix_coefficients = 5
338      */
339     VAProcColorStandardBT470BG,
340     /** \brief SMPTE-170M.
341      *
342      * Equivalent to:
343      *   colour_primaries = 6
344      *   transfer_characteristics = 6
345      *   matrix_coefficients = 6
346      */
347     VAProcColorStandardSMPTE170M,
348     /** \brief SMPTE-240M.
349      *
350      * Equivalent to:
351      *   colour_primaries = 7
352      *   transfer_characteristics = 7
353      *   matrix_coefficients = 7
354      */
355     VAProcColorStandardSMPTE240M,
356     /** \brief Generic film.
357      *
358      * Equivalent to:
359      *   colour_primaries = 8
360      *   transfer_characteristics = 1
361      *   matrix_coefficients = 1
362      */
363     VAProcColorStandardGenericFilm,
364     /** \brief sRGB.
365      *
366      * Equivalent to:
367      *   colour_primaries = 1
368      *   transfer_characteristics = 13
369      *   matrix_coefficients = 0
370      */
371     VAProcColorStandardSRGB,
372     /** \brief stRGB.
373      *
374      * ???
375      */
376     VAProcColorStandardSTRGB,
377     /** \brief xvYCC601.
378      *
379      * Equivalent to:
380      *   colour_primaries = 1
381      *   transfer_characteristics = 11
382      *   matrix_coefficients = 5
383      */
384     VAProcColorStandardXVYCC601,
385     /** \brief xvYCC709.
386      *
387      * Equivalent to:
388      *   colour_primaries = 1
389      *   transfer_characteristics = 11
390      *   matrix_coefficients = 1
391      */
392     VAProcColorStandardXVYCC709,
393     /** \brief ITU-R BT.2020.
394      *
395      * Equivalent to:
396      *   colour_primaries = 9
397      *   transfer_characteristics = 14
398      *   matrix_coefficients = 9
399      */
400     VAProcColorStandardBT2020,
401     /** \brief Explicitly specified color properties.
402      *
403      * Use corresponding color properties section.
404      */
405     VAProcColorStandardExplicit,
406     /** \brief Number of color standards. */
407     VAProcColorStandardCount
408 } VAProcColorStandardType;
409
410 /** \brief Total color correction types. */
411 typedef enum _VAProcTotalColorCorrectionType {
412     VAProcTotalColorCorrectionNone = 0,
413     /** \brief Red Saturation. */
414     VAProcTotalColorCorrectionRed,
415     /** \brief Green Saturation. */
416     VAProcTotalColorCorrectionGreen,
417     /** \brief Blue Saturation. */
418     VAProcTotalColorCorrectionBlue,
419     /** \brief Cyan Saturation. */
420     VAProcTotalColorCorrectionCyan,
421     /** \brief Magenta Saturation. */
422     VAProcTotalColorCorrectionMagenta,
423     /** \brief Yellow Saturation. */
424     VAProcTotalColorCorrectionYellow,
425     /** \brief Number of color correction attributes. */
426     VAProcTotalColorCorrectionCount
427 } VAProcTotalColorCorrectionType;
428 /** @name Video blending flags */
429 /**@{*/
430 /** \brief Global alpha blending. */
431 #define VA_BLEND_GLOBAL_ALPHA           0x0001
432 /** \brief Premultiplied alpha blending (RGBA surfaces only). */
433 #define VA_BLEND_PREMULTIPLIED_ALPHA    0x0002
434 /** \brief Luma color key (YUV surfaces only). */
435 #define VA_BLEND_LUMA_KEY               0x0010
436 /**@}*/
437
438 /** \brief Video blending state definition. */
439 typedef struct _VABlendState {
440     /** \brief Video blending flags. */
441     unsigned int        flags;
442     /**
443      * \brief Global alpha value.
444      *
445      * Valid if \flags has VA_BLEND_GLOBAL_ALPHA.
446      * Valid range is 0.0 to 1.0 inclusive.
447      */
448     float               global_alpha;
449     /**
450      * \brief Minimum luma value.
451      *
452      * Valid if \flags has VA_BLEND_LUMA_KEY.
453      * Valid range is 0.0 to 1.0 inclusive.
454      * \ref min_luma shall be set to a sensible value lower than \ref max_luma.
455      */
456     float               min_luma;
457     /**
458      * \brief Maximum luma value.
459      *
460      * Valid if \flags has VA_BLEND_LUMA_KEY.
461      * Valid range is 0.0 to 1.0 inclusive.
462      * \ref max_luma shall be set to a sensible value larger than \ref min_luma.
463      */
464     float               max_luma;
465 } VABlendState;
466
467 /** @name Video pipeline flags */
468 /**@{*/
469 /** \brief Specifies whether to apply subpictures when processing a surface. */
470 #define VA_PROC_PIPELINE_SUBPICTURES    0x00000001
471 /**
472  * \brief Specifies whether to apply power or performance
473  * optimizations to a pipeline.
474  *
475  * When processing several surfaces, it may be necessary to prioritize
476  * more certain pipelines than others. This flag is only a hint to the
477  * video processor so that it can omit certain filters to save power
478  * for example. Typically, this flag could be used with video surfaces
479  * decoded from a secondary bitstream.
480  */
481 #define VA_PROC_PIPELINE_FAST           0x00000002
482 /**@}*/
483
484 /** @name Video filter flags */
485 /**@{*/
486 /** \brief Specifies whether the filter shall be present in the pipeline. */
487 #define VA_PROC_FILTER_MANDATORY        0x00000001
488 /**@}*/
489
490 /** @name Pipeline end flags */
491 /**@{*/
492 /** \brief Specifies the pipeline is the last. */
493 #define VA_PIPELINE_FLAG_END            0x00000004
494 /**@}*/
495
496 /** @name Chroma Siting flag */
497 /**@{*/
498 /** vertical chroma sitting take bit 0-1, horizontal chroma sitting take bit 2-3
499  * vertical chromma siting | horizontal chroma sitting to be chroma sitting */
500 #define VA_CHROMA_SITING_UNKNOWN              0x00
501 /** \brief Chroma samples are co-sited vertically on the top with the luma samples. */
502 #define VA_CHROMA_SITING_VERTICAL_TOP         0x01
503 /** \brief Chroma samples are not co-sited vertically with the luma samples. */
504 #define VA_CHROMA_SITING_VERTICAL_CENTER      0x02
505 /** \brief Chroma samples are co-sited vertically on the bottom with the luma samples. */
506 #define VA_CHROMA_SITING_VERTICAL_BOTTOM      0x03
507 /** \brief Chroma samples are co-sited horizontally on the left with the luma samples. */
508 #define VA_CHROMA_SITING_HORIZONTAL_LEFT      0x04
509 /** \brief Chroma samples are not co-sited horizontally with the luma samples. */
510 #define VA_CHROMA_SITING_HORIZONTAL_CENTER    0x08
511 /**@}*/
512
513 /**
514  * This is to indicate that the color-space conversion uses full range or reduced range.
515  * VA_SOURCE_RANGE_FULL(Full range): Y/Cb/Cr is in [0, 255]. It is mainly used
516  *      for JPEG/JFIF formats. The combination with the BT601 flag means that
517  *      JPEG/JFIF color-space conversion matrix is used.
518  * VA_SOURCE_RANGE_REDUCED(Reduced range): Y is in [16, 235] and Cb/Cr is in [16, 240].
519  *      It is mainly used for the YUV->RGB color-space conversion in SDTV/HDTV/UHDTV.
520  */
521 #define VA_SOURCE_RANGE_UNKNOWN         0
522 #define VA_SOURCE_RANGE_REDUCED         1
523 #define VA_SOURCE_RANGE_FULL            2
524
525 /** \brief Video processing pipeline capabilities. */
526 typedef struct _VAProcPipelineCaps {
527     /** \brief Pipeline flags. See VAProcPipelineParameterBuffer::pipeline_flags. */
528     uint32_t        pipeline_flags;
529     /** \brief Extra filter flags. See VAProcPipelineParameterBuffer::filter_flags. */
530     uint32_t        filter_flags;
531     /** \brief Number of forward reference frames that are needed. */
532     uint32_t        num_forward_references;
533     /** \brief Number of backward reference frames that are needed. */
534     uint32_t        num_backward_references;
535     /** \brief List of color standards supported on input. */
536     VAProcColorStandardType *input_color_standards;
537     /** \brief Number of elements in \ref input_color_standards array. */
538     uint32_t        num_input_color_standards;
539     /** \brief List of color standards supported on output. */
540     VAProcColorStandardType *output_color_standards;
541     /** \brief Number of elements in \ref output_color_standards array. */
542     uint32_t        num_output_color_standards;
543
544     /**
545      * \brief Rotation flags.
546      *
547      * For each rotation angle supported by the underlying hardware,
548      * the corresponding bit is set in \ref rotation_flags. See
549      * "Rotation angles" for a description of rotation angles.
550      *
551      * A value of 0 means the underlying hardware does not support any
552      * rotation. Otherwise, a check for a specific rotation angle can be
553      * performed as follows:
554      *
555      * \code
556      * VAProcPipelineCaps pipeline_caps;
557      * ...
558      * vaQueryVideoProcPipelineCaps(va_dpy, vpp_ctx,
559      *     filter_bufs, num_filter_bufs,
560      *     &pipeline_caps
561      * );
562      * ...
563      * if (pipeline_caps.rotation_flags & (1 << VA_ROTATION_xxx)) {
564      *     // Clockwise rotation by xxx degrees is supported
565      *     ...
566      * }
567      * \endcode
568      */
569     uint32_t        rotation_flags;
570     /** \brief Blend flags. See "Video blending flags". */
571     uint32_t        blend_flags;
572     /**
573      * \brief Mirroring flags.
574      *
575      * For each mirroring direction supported by the underlying hardware,
576      * the corresponding bit is set in \ref mirror_flags. See
577      * "Mirroring directions" for a description of mirroring directions.
578      *
579      */
580     uint32_t        mirror_flags;
581     /** \brief Number of additional output surfaces supported by the pipeline  */
582     uint32_t        num_additional_outputs;
583
584     /** \brief Number of elements in \ref input_pixel_format array. */
585     uint32_t        num_input_pixel_formats;
586     /** \brief List of input pixel formats in fourcc. */
587     uint32_t        *input_pixel_format;
588     /** \brief Number of elements in \ref output_pixel_format array. */
589     uint32_t        num_output_pixel_formats;
590     /** \brief List of output pixel formats in fourcc. */
591     uint32_t        *output_pixel_format;
592
593     /** \brief Max supported input width in pixels. */
594     uint32_t        max_input_width;
595     /** \brief Max supported input height in pixels. */
596     uint32_t        max_input_height;
597     /** \brief Min supported input width in pixels. */
598     uint32_t        min_input_width;
599     /** \brief Min supported input height in pixels. */
600     uint32_t        min_input_height;
601
602     /** \brief Max supported output width in pixels. */
603     uint32_t        max_output_width;
604     /** \brief Max supported output height in pixels. */
605     uint32_t        max_output_height;
606     /** \brief Min supported output width in pixels. */
607     uint32_t        min_output_width;
608     /** \brief Min supported output height in pixels. */
609     uint32_t        min_output_height;
610     /** \brief Reserved bytes for future use, must be zero */
611     #if defined(__AMD64__) || defined(__x86_64__) || defined(__amd64__) || defined(__LP64__)
612     uint32_t                va_reserved[VA_PADDING_HIGH - 2];
613     #else
614     uint32_t                va_reserved[VA_PADDING_HIGH];
615     #endif
616 } VAProcPipelineCaps;
617
618 /** \brief Specification of values supported by the filter. */
619 typedef struct _VAProcFilterValueRange {
620     /** \brief Minimum value supported, inclusive. */
621     float               min_value;
622     /** \brief Maximum value supported, inclusive. */
623     float               max_value;
624     /** \brief Default value. */
625     float               default_value;
626     /** \brief Step value that alters the filter behaviour in a sensible way. */
627     float               step;
628
629     /** \brief Reserved bytes for future use, must be zero */
630     uint32_t                va_reserved[VA_PADDING_LOW];
631 } VAProcFilterValueRange;
632
633 typedef struct _VAProcColorProperties {
634     /** Chroma sample location.\c VA_CHROMA_SITING_VERTICAL_XXX | VA_CHROMA_SITING_HORIZONTAL_XXX */
635     uint8_t chroma_sample_location;
636     /** Chroma sample location. \c VA_SOURCE_RANGE_XXX*/
637     uint8_t color_range;
638     /** Colour primaries.
639      *
640      * See ISO/IEC 23001-8 or ITU H.273, section 8.1 and table 2.
641      * Only used if the color standard in use is \c VAColorStandardExplicit.
642      */
643     uint8_t colour_primaries;
644     /** Transfer characteristics.
645      *
646      * See ISO/IEC 23001-8 or ITU H.273, section 8.2 and table 3.
647      * Only used if the color standard in use is \c VAColorStandardExplicit.
648      */
649     uint8_t transfer_characteristics;
650     /** Matrix coefficients.
651      *
652      * See ISO/IEC 23001-8 or ITU H.273, section 8.3 and table 4.
653      * Only used if the color standard in use is \c VAColorStandardExplicit.
654      */
655     uint8_t matrix_coefficients;
656     /** Reserved bytes for future use, must be zero. */
657     uint8_t reserved[3];
658 } VAProcColorProperties;
659
660 /**
661  * \brief Video processing pipeline configuration.
662  *
663  * This buffer defines a video processing pipeline. The actual filters to
664  * be applied are provided in the \c filters field, they can be re-used
665  * in other processing pipelines.
666  *
667  * The target surface is specified by the \c render_target argument of
668  * \c vaBeginPicture(). The general usage model is described as follows:
669  * - \c vaBeginPicture(): specify the target surface that receives the
670  *   processed output;
671  * - \c vaRenderPicture(): specify a surface to be processed and composed
672  *   into the \c render_target. Use as many \c vaRenderPicture() calls as
673  *   necessary surfaces to compose ;
674  * - \c vaEndPicture(): tell the driver to start processing the surfaces
675  *   with the requested filters.
676  *
677  * If a filter (e.g. noise reduction) needs to be applied with different
678  * values for multiple surfaces, the application needs to create as many
679  * filter parameter buffers as necessary. i.e. the filter parameters shall
680  * not change between two calls to \c vaRenderPicture().
681  *
682  * For composition usage models, the first surface to process will generally
683  * use an opaque background color, i.e. \c output_background_color set with
684  * the most significant byte set to \c 0xff. For instance, \c 0xff000000 for
685  * a black background. Then, subsequent surfaces would use a transparent
686  * background color.
687  */
688 typedef struct _VAProcPipelineParameterBuffer {
689     /**
690      * \brief Source surface ID.
691      *
692      * ID of the source surface to process. If subpictures are associated
693      * with the video surfaces then they shall be rendered to the target
694      * surface, if the #VA_PROC_PIPELINE_SUBPICTURES pipeline flag is set.
695      */
696     VASurfaceID         surface;
697     /**
698      * \brief Region within the source surface to be processed.
699      *
700      * Pointer to a #VARectangle defining the region within the source
701      * surface to be processed. If NULL, \c surface_region implies the
702      * whole surface.
703      */
704     const VARectangle  *surface_region;
705     /**
706      * \brief Requested input color standard.
707      *
708      * Color properties are implicitly converted throughout the processing
709      * pipeline. The video processor chooses the best moment to apply
710      * this conversion. The set of supported color standards for input shall
711      * be queried with vaQueryVideoProcPipelineCaps().
712      *
713      * If this is set to VAProcColorStandardExplicit, the color properties
714      * are specified explicitly in surface_color_properties instead.
715      */
716     VAProcColorStandardType surface_color_standard;
717     /**
718      * \brief Region within the output surface.
719      *
720      * Pointer to a #VARectangle defining the region within the output
721      * surface that receives the processed pixels. If NULL, \c output_region
722      * implies the whole surface. 
723      *
724      * Note that any pixels residing outside the specified region will
725      * be filled in with the \ref output_background_color.
726      */
727     const VARectangle  *output_region;
728     /**
729      * \brief Background color.
730      *
731      * Background color used to fill in pixels that reside outside of the
732      * specified \ref output_region. The color is specified in ARGB format:
733      * [31:24] alpha, [23:16] red, [15:8] green, [7:0] blue.
734      *
735      * Unless the alpha value is zero or the \ref output_region represents
736      * the whole target surface size, implementations shall not render the
737      * source surface to the target surface directly. Rather, in order to
738      * maintain the exact semantics of \ref output_background_color, the
739      * driver shall use a temporary surface and fill it in with the
740      * appropriate background color. Next, the driver will blend this
741      * temporary surface into the target surface.
742      */
743     uint32_t        output_background_color;
744     /**
745      * \brief Requested output color standard.
746      *
747      * If this is set to VAProcColorStandardExplicit, the color properties
748      * are specified explicitly in output_color_properties instead.
749      */
750     VAProcColorStandardType output_color_standard;
751     /**
752      * \brief Pipeline filters. See video pipeline flags.
753      *
754      * Flags to control the pipeline, like whether to apply subpictures
755      * or not, notify the driver that it can opt for power optimizations,
756      * should this be needed.
757      */
758     uint32_t        pipeline_flags;
759     /**
760      * \brief Extra filter flags. See vaPutSurface() flags.
761      *
762      * Filter flags are used as a fast path, wherever possible, to use
763      * vaPutSurface() flags instead of explicit filter parameter buffers.
764      *
765      * Allowed filter flags API-wise. Use vaQueryVideoProcPipelineCaps()
766      * to check for implementation details:
767      * - Bob-deinterlacing: \c VA_FRAME_PICTURE, \c VA_TOP_FIELD,
768      *   \c VA_BOTTOM_FIELD. Note that any deinterlacing filter
769      *   (#VAProcFilterDeinterlacing) will override those flags.
770      * - Color space conversion: \c VA_SRC_BT601, \c VA_SRC_BT709,
771      *   \c VA_SRC_SMPTE_240. 
772      * - Scaling: \c VA_FILTER_SCALING_DEFAULT, \c VA_FILTER_SCALING_FAST,
773      *   \c VA_FILTER_SCALING_HQ, \c VA_FILTER_SCALING_NL_ANAMORPHIC.
774      */
775     uint32_t        filter_flags;
776     /**
777      * \brief Array of filters to apply to the surface.
778      *
779      * The list of filters shall be ordered in the same way the driver expects
780      * them. i.e. as was returned from vaQueryVideoProcFilters().
781      * Otherwise, a #VA_STATUS_ERROR_INVALID_FILTER_CHAIN is returned
782      * from vaRenderPicture() with this buffer.
783      *
784      * #VA_STATUS_ERROR_UNSUPPORTED_FILTER is returned if the list
785      * contains an unsupported filter.
786      *
787      */
788     VABufferID         *filters;
789     /** \brief Actual number of filters. */
790     uint32_t        num_filters;
791     /** \brief Array of forward reference frames. */
792     VASurfaceID        *forward_references;
793     /** \brief Number of forward reference frames that were supplied. */
794     uint32_t        num_forward_references;
795     /** \brief Array of backward reference frames. */
796     VASurfaceID        *backward_references;
797     /** \brief Number of backward reference frames that were supplied. */
798     uint32_t        num_backward_references;
799     /**
800      * \brief Rotation state. See rotation angles.
801      *
802      * The rotation angle is clockwise. There is no specific rotation
803      * center for this operation. Rather, The source \ref surface is
804      * first rotated by the specified angle and then scaled to fit the
805      * \ref output_region.
806      *
807      * This means that the top-left hand corner (0,0) of the output
808      * (rotated) surface is expressed as follows:
809      * - \ref VA_ROTATION_NONE: (0,0) is the top left corner of the
810      *   source surface -- no rotation is performed ;
811      * - \ref VA_ROTATION_90: (0,0) is the bottom-left corner of the
812      *   source surface ;
813      * - \ref VA_ROTATION_180: (0,0) is the bottom-right corner of the
814      *   source surface -- the surface is flipped around the X axis ;
815      * - \ref VA_ROTATION_270: (0,0) is the top-right corner of the
816      *   source surface.
817      *
818      * Check VAProcPipelineCaps::rotation_flags first prior to
819      * defining a specific rotation angle. Otherwise, the hardware can
820      * perfectly ignore this variable if it does not support any
821      * rotation.
822      */
823     uint32_t        rotation_state;
824     /**
825      * \brief blending state. See "Video blending state definition".
826      *
827      * If \ref blend_state is NULL, then default operation mode depends
828      * on the source \ref surface format:
829      * - RGB: per-pixel alpha blending ;
830      * - YUV: no blending, i.e override the underlying pixels.
831      *
832      * Otherwise, \ref blend_state is a pointer to a #VABlendState
833      * structure that shall be live until vaEndPicture().
834      *
835      * Implementation note: the driver is responsible for checking the
836      * blend state flags against the actual source \ref surface format.
837      * e.g. premultiplied alpha blending is only applicable to RGB
838      * surfaces, and luma keying is only applicable to YUV surfaces.
839      * If a mismatch occurs, then #VA_STATUS_ERROR_INVALID_BLEND_STATE
840      * is returned.
841      */
842     const VABlendState *blend_state;
843     /**
844      * \bried mirroring state. See "Mirroring directions".
845      *
846      * Mirroring of an image can be performed either along the
847      * horizontal or vertical axis. It is assumed that the rotation
848      * operation is always performed before the mirroring operation.
849      */
850     uint32_t      mirror_state;
851     /** \brief Array of additional output surfaces. */
852     VASurfaceID        *additional_outputs;
853     /** \brief Number of additional output surfaces. */
854     uint32_t        num_additional_outputs;
855     /**
856      * \brief Flag to indicate the input surface flag
857      *
858      * bit0: 0 non-protected 1: protected
859      * bit 1~31 for future
860      */
861     uint32_t        input_surface_flag;
862     /**
863      * \brief Flag to indicate the output surface flag
864      *
865      * bit0: 0 non-protected  1: protected
866      * bit 1~31 for future
867      */
868     uint32_t        output_surface_flag;
869
870     VAProcColorProperties  input_color_properties;
871
872     VAProcColorProperties  output_color_properties;
873
874     /** \brief Reserved bytes for future use, must be zero */
875     #if defined(__AMD64__) || defined(__x86_64__) || defined(__amd64__)|| defined(__LP64__)
876     uint32_t                va_reserved[VA_PADDING_LARGE - 13];
877     #else
878     uint32_t                va_reserved[VA_PADDING_LARGE - 11];
879     #endif
880 } VAProcPipelineParameterBuffer;
881
882 /**
883  * \brief Filter parameter buffer base.
884  *
885  * This is a helper structure used by driver implementations only.
886  * Users are not supposed to allocate filter parameter buffers of this
887  * type.
888  */
889 typedef struct _VAProcFilterParameterBufferBase {
890     /** \brief Filter type. */
891     VAProcFilterType    type;
892 } VAProcFilterParameterBufferBase;
893
894 /**
895  * \brief Default filter parametrization.
896  *
897  * Unless there is a filter-specific parameter buffer,
898  * #VAProcFilterParameterBuffer is the default type to use.
899  */
900 typedef struct _VAProcFilterParameterBuffer {
901     /** \brief Filter type. */
902     VAProcFilterType    type;
903     /** \brief Value. */
904     float               value;
905
906     /** \brief Reserved bytes for future use, must be zero */
907     uint32_t                va_reserved[VA_PADDING_LOW];
908 } VAProcFilterParameterBuffer;
909
910 /** @name De-interlacing flags */
911 /**@{*/
912 /** 
913  * \brief Bottom field first in the input frame. 
914  * if this is not set then assumes top field first.
915  */
916 #define VA_DEINTERLACING_BOTTOM_FIELD_FIRST     0x0001
917 /** 
918  * \brief Bottom field used in deinterlacing. 
919  * if this is not set then assumes top field is used.
920  */
921 #define VA_DEINTERLACING_BOTTOM_FIELD           0x0002
922 /** 
923  * \brief A single field is stored in the input frame. 
924  * if this is not set then assumes the frame contains two interleaved fields.
925  */
926 #define VA_DEINTERLACING_ONE_FIELD              0x0004
927 /**
928  * \brief Film Mode Detection is enabled. If enabled, driver performs inverse
929  * of various pulldowns, such as 3:2 pulldown.
930  * if this is not set then assumes FMD is disabled.
931  */
932 #define VA_DEINTERLACING_FMD_ENABLE             0x0008
933
934 //Scene change parameter for ADI on Linux, if enabled, driver use spatial DI(Bob), instead of ADI. if not, use old behavior for ADI
935 //Input stream is TFF(set flags = 0), SRC0,1,2,3 are interlaced frame (top +bottom fields), DSTs are progressive frames
936 //30i->30p
937 //SRC0 -> BOBDI,  no reference, set flag = 0, output DST0
938 //SRC1 -> ADI, reference frame=SRC0, set flags = 0, call VP, output DST1
939 //SRC2 -> ADI, reference frame=SRC1, set flags = 0x0010(decimal 16), call VP, output DST2(T4)
940 //SRC3 -> ADI, reference frame=SRC2, set flags = 0, call VP, output DST3
941 //30i->60p
942 //SRC0 -> BOBDI, no reference, set flag = 0, output DST0
943 //SRC0 -> BOBDI, no reference, set flag =0x0002, output DST1
944
945 //SRC1 -> ADI, reference frame =SRC0, set flags = 0, call VP, output DST2
946 //SRC1 -> ADI, reference frame =SRC0, set flags = 0x0012(decimal18), call VP, output DST3(B3)
947
948 //SRC2 -> ADI, reference frame =SRC1, set flags =  0x0010(decimal 16), call VP, output DST4(T4)
949 //SRC2 -> ADI, reference frame =SRC1, set flags =  0x0002, call VP, output DST5
950
951 //SRC3 -> ADI, reference frame =SRC2, set flags =  0, call VP, output DST6
952 //SRC3 -> ADI, reference frame =SRC1, set flags = 0x0002, call VP, output DST7
953
954 #define VA_DEINTERLACING_SCD_ENABLE     0x0010
955
956 /**@}*/
957
958 /** \brief Deinterlacing filter parametrization. */
959 typedef struct _VAProcFilterParameterBufferDeinterlacing {
960     /** \brief Filter type. Shall be set to #VAProcFilterDeinterlacing. */
961     VAProcFilterType            type;
962     /** \brief Deinterlacing algorithm. */
963     VAProcDeinterlacingType     algorithm;
964     /** \brief Deinterlacing flags. */
965     uint32_t                    flags;
966
967     /** \brief Reserved bytes for future use, must be zero */
968     uint32_t                va_reserved[VA_PADDING_LOW];
969 } VAProcFilterParameterBufferDeinterlacing;
970
971 /**
972  * \brief Color balance filter parametrization.
973  *
974  * This buffer defines color balance attributes. A VA buffer can hold
975  * several color balance attributes by creating a VA buffer of desired
976  * number of elements. This can be achieved by the following pseudo-code:
977  *
978  * \code
979  * enum { kHue, kSaturation, kBrightness, kContrast };
980  *
981  * // Initial color balance parameters
982  * static const VAProcFilterParameterBufferColorBalance colorBalanceParams[4] =
983  * {
984  *     [kHue] =
985  *         { VAProcFilterColorBalance, VAProcColorBalanceHue, 0.5 },
986  *     [kSaturation] =
987  *         { VAProcFilterColorBalance, VAProcColorBalanceSaturation, 0.5 },
988  *     [kBrightness] =
989  *         { VAProcFilterColorBalance, VAProcColorBalanceBrightness, 0.5 },
990  *     [kSaturation] =
991  *         { VAProcFilterColorBalance, VAProcColorBalanceSaturation, 0.5 }
992  * };
993  *
994  * // Create buffer
995  * VABufferID colorBalanceBuffer;
996  * vaCreateBuffer(va_dpy, vpp_ctx,
997  *     VAProcFilterParameterBufferType, sizeof(*pColorBalanceParam), 4,
998  *     colorBalanceParams,
999  *     &colorBalanceBuffer
1000  * );
1001  *
1002  * VAProcFilterParameterBufferColorBalance *pColorBalanceParam;
1003  * vaMapBuffer(va_dpy, colorBalanceBuffer, &pColorBalanceParam);
1004  * {
1005  *     // Change brightness only
1006  *     pColorBalanceBuffer[kBrightness].value = 0.75;
1007  * }
1008  * vaUnmapBuffer(va_dpy, colorBalanceBuffer);
1009  * \endcode
1010  */
1011 typedef struct _VAProcFilterParameterBufferColorBalance {
1012     /** \brief Filter type. Shall be set to #VAProcFilterColorBalance. */
1013     VAProcFilterType            type;
1014     /** \brief Color balance attribute. */
1015     VAProcColorBalanceType      attrib;
1016     /**
1017      * \brief Color balance value.
1018      *
1019      * Special case for automatically adjusted attributes. e.g. 
1020      * #VAProcColorBalanceAutoSaturation,
1021      * #VAProcColorBalanceAutoBrightness,
1022      * #VAProcColorBalanceAutoContrast.
1023      * - If \ref value is \c 1.0 +/- \c FLT_EPSILON, the attribute is
1024      *   automatically adjusted and overrides any other attribute of
1025      *   the same type that would have been set explicitly;
1026      * - If \ref value is \c 0.0 +/- \c FLT_EPSILON, the attribute is
1027      *   disabled and other attribute of the same type is used instead.
1028      */
1029     float                       value;
1030
1031     /** \brief Reserved bytes for future use, must be zero */
1032     uint32_t                va_reserved[VA_PADDING_LOW];
1033 } VAProcFilterParameterBufferColorBalance;
1034
1035 /** \brief Total color correction filter parametrization. */
1036 typedef struct _VAProcFilterParameterBufferTotalColorCorrection {
1037     /** \brief Filter type. Shall be set to #VAProcFilterTotalColorCorrection. */
1038     VAProcFilterType                  type;
1039     /** \brief Color to correct. */
1040     VAProcTotalColorCorrectionType    attrib;
1041     /** \brief Color correction value. */
1042     float                             value;
1043 } VAProcFilterParameterBufferTotalColorCorrection;
1044
1045 /** \brief Human Vision System(HVS) Noise reduction filter parametrization. */
1046 typedef struct _VAProcFilterParameterBufferHVSNoiseReduction {
1047     /** \brief Filter type. Shall be set to #VAProcFilterHVSNoiseReduction. */
1048     VAProcFilterType    type;
1049     /** \brief QP for encoding, used for HVS Denoise */
1050     uint16_t            qp;
1051     /**
1052      *  \brief QP to Noise Reduction Strength Mode, used for Human Vision System Based Noise Reduction.
1053      *  Controls Noise Reduction strength of conservative and aggressive mode.
1054      *  It is an integer from [0-16].
1055      *  Value 0 means completely turn off Noise Reduction;
1056      *  Value 16 means the most aggressive mode of Noise Reduction;
1057      *  Value 10 is the default value.
1058      */
1059     uint16_t            strength;
1060     /** \brief Reserved bytes for future use, must be zero */
1061     uint16_t            va_reserved[VA_PADDING_HIGH];
1062 } VAProcFilterParameterBufferHVSNoiseReduction;
1063
1064 /**
1065  * \brief Default filter cap specification (single range value).
1066  *
1067  * Unless there is a filter-specific cap structure, #VAProcFilterCap is the
1068  * default type to use for output caps from vaQueryVideoProcFilterCaps().
1069  */
1070 typedef struct _VAProcFilterCap {
1071     /** \brief Range of supported values for the filter. */
1072     VAProcFilterValueRange      range;
1073
1074     /** \brief Reserved bytes for future use, must be zero */
1075     uint32_t                va_reserved[VA_PADDING_LOW];
1076 } VAProcFilterCap;
1077
1078 /** \brief Capabilities specification for the deinterlacing filter. */
1079 typedef struct _VAProcFilterCapDeinterlacing {
1080     /** \brief Deinterlacing algorithm. */
1081     VAProcDeinterlacingType     type;
1082
1083     /** \brief Reserved bytes for future use, must be zero */
1084     uint32_t                va_reserved[VA_PADDING_LOW];
1085 } VAProcFilterCapDeinterlacing;
1086
1087 /** \brief Capabilities specification for the color balance filter. */
1088 typedef struct _VAProcFilterCapColorBalance {
1089     /** \brief Color balance operation. */
1090     VAProcColorBalanceType      type;
1091     /** \brief Range of supported values for the specified operation. */
1092     VAProcFilterValueRange      range;
1093
1094     /** \brief Reserved bytes for future use, must be zero */
1095     uint32_t                va_reserved[VA_PADDING_LOW];
1096 } VAProcFilterCapColorBalance;
1097
1098 /** \brief Capabilities specification for the Total Color Correction filter. */
1099 typedef struct _VAProcFilterCapTotalColorCorrection {
1100     /** \brief Color to correct. */
1101     VAProcTotalColorCorrectionType    type;
1102     /** \brief Range of supported values for the specified color. */
1103     VAProcFilterValueRange            range;
1104 } VAProcFilterCapTotalColorCorrection;
1105
1106 /**
1107  * \brief Queries video processing filters.
1108  *
1109  * This function returns the list of video processing filters supported
1110  * by the driver. The \c filters array is allocated by the user and
1111  * \c num_filters shall be initialized to the number of allocated
1112  * elements in that array. Upon successful return, the actual number
1113  * of filters will be overwritten into \c num_filters. Otherwise,
1114  * \c VA_STATUS_ERROR_MAX_NUM_EXCEEDED is returned and \c num_filters
1115  * is adjusted to the number of elements that would be returned if enough
1116  * space was available.
1117  *
1118  * The list of video processing filters supported by the driver shall
1119  * be ordered in the way they can be iteratively applied. This is needed
1120  * for both correctness, i.e. some filters would not mean anything if
1121  * applied at the beginning of the pipeline; but also for performance
1122  * since some filters can be applied in a single pass (e.g. noise
1123  * reduction + deinterlacing).
1124  *
1125  * @param[in] dpy               the VA display
1126  * @param[in] context           the video processing context
1127  * @param[out] filters          the output array of #VAProcFilterType elements
1128  * @param[in,out] num_filters the number of elements allocated on input,
1129  *      the number of elements actually filled in on output
1130  */
1131 VAStatus
1132 vaQueryVideoProcFilters(
1133     VADisplay           dpy,
1134     VAContextID         context,
1135     VAProcFilterType   *filters,
1136     unsigned int       *num_filters
1137 );
1138
1139 /**
1140  * \brief Queries video filter capabilities.
1141  *
1142  * This function returns the list of capabilities supported by the driver
1143  * for a specific video filter. The \c filter_caps array is allocated by
1144  * the user and \c num_filter_caps shall be initialized to the number
1145  * of allocated elements in that array. Upon successful return, the
1146  * actual number of filters will be overwritten into \c num_filter_caps.
1147  * Otherwise, \c VA_STATUS_ERROR_MAX_NUM_EXCEEDED is returned and
1148  * \c num_filter_caps is adjusted to the number of elements that would be
1149  * returned if enough space was available.
1150  *
1151  * @param[in] dpy               the VA display
1152  * @param[in] context           the video processing context
1153  * @param[in] type              the video filter type
1154  * @param[out] filter_caps      the output array of #VAProcFilterCap elements
1155  * @param[in,out] num_filter_caps the number of elements allocated on input,
1156  *      the number of elements actually filled in output
1157  */
1158 VAStatus
1159 vaQueryVideoProcFilterCaps(
1160     VADisplay           dpy,
1161     VAContextID         context,
1162     VAProcFilterType    type,
1163     void               *filter_caps,
1164     unsigned int       *num_filter_caps
1165 );
1166
1167 /**
1168  * \brief Queries video processing pipeline capabilities.
1169  *
1170  * This function returns the video processing pipeline capabilities. The
1171  * \c filters array defines the video processing pipeline and is an array
1172  * of buffers holding filter parameters.
1173  *
1174  * Note: the #VAProcPipelineCaps structure contains user-provided arrays.
1175  * If non-NULL, the corresponding \c num_* fields shall be filled in on
1176  * input with the number of elements allocated. Upon successful return,
1177  * the actual number of elements will be overwritten into the \c num_*
1178  * fields. Otherwise, \c VA_STATUS_ERROR_MAX_NUM_EXCEEDED is returned
1179  * and \c num_* fields are adjusted to the number of elements that would
1180  * be returned if enough space was available.
1181  *
1182  * @param[in] dpy               the VA display
1183  * @param[in] context           the video processing context
1184  * @param[in] filters           the array of VA buffers defining the video
1185  *      processing pipeline
1186  * @param[in] num_filters       the number of elements in filters
1187  * @param[in,out] pipeline_caps the video processing pipeline capabilities
1188  */
1189 VAStatus
1190 vaQueryVideoProcPipelineCaps(
1191     VADisplay           dpy,
1192     VAContextID         context,
1193     VABufferID         *filters,
1194     unsigned int        num_filters,
1195     VAProcPipelineCaps *pipeline_caps
1196 );
1197
1198 /**@}*/
1199
1200 #ifdef __cplusplus
1201 }
1202 #endif
1203
1204 #endif /* VA_VPP_H */