2 * This file is part of FFmpeg.
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef AVUTIL_HWCONTEXT_VAAPI_H
20 #define AVUTIL_HWCONTEXT_VAAPI_H
26 * API-specific header for AV_HWDEVICE_TYPE_VAAPI.
28 * Dynamic frame pools are supported, but note that any pool used as a render
29 * target is required to be of fixed size in order to be be usable as an
30 * argument to vaCreateContext().
32 * For user-allocated pools, AVHWFramesContext.pool must return AVBufferRefs
33 * with the data pointer set to a VASurfaceID.
38 * The quirks field has been set by the user and should not be detected
39 * automatically by av_hwdevice_ctx_init().
41 AV_VAAPI_DRIVER_QUIRK_USER_SET = (1 << 0),
43 * The driver does not destroy parameter buffers when they are used by
44 * vaRenderPicture(). Additional code will be required to destroy them
45 * separately afterwards.
47 AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS = (1 << 1),
50 * The driver does not support the VASurfaceAttribMemoryType attribute,
51 * so the surface allocation code will not try to use it.
53 AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE = (1 << 2),
57 * VAAPI connection details.
59 * Allocated as AVHWDeviceContext.hwctx
61 typedef struct AVVAAPIDeviceContext {
63 * The VADisplay handle, to be filled by the user.
67 * Driver quirks to apply - this is filled by av_hwdevice_ctx_init(),
68 * with reference to a table of known drivers, unless the
69 * AV_VAAPI_DRIVER_QUIRK_USER_SET bit is already present. The user
70 * may need to refer to this field when performing any later
71 * operations using VAAPI with the same VADisplay.
73 unsigned int driver_quirks;
74 } AVVAAPIDeviceContext;
77 * VAAPI-specific data associated with a frame pool.
79 * Allocated as AVHWFramesContext.hwctx.
81 typedef struct AVVAAPIFramesContext {
83 * Set by the user to apply surface attributes to all surfaces in
84 * the frame pool. If null, default settings are used.
86 VASurfaceAttrib *attributes;
89 * The surfaces IDs of all surfaces in the pool after creation.
90 * Only valid if AVHWFramesContext.initial_pool_size was positive.
91 * These are intended to be used as the render_targets arguments to
94 VASurfaceID *surface_ids;
96 } AVVAAPIFramesContext;
99 * VAAPI hardware pipeline configuration details.
101 * Allocated with av_hwdevice_hwconfig_alloc().
103 typedef struct AVVAAPIHWConfig {
105 * ID of a VAAPI pipeline configuration.
107 VAConfigID config_id;
110 #endif /* AVUTIL_HWCONTEXT_VAAPI_H */