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
20 #ifndef AVUTIL_HWCONTEXT_DXVA2_H
21 #define AVUTIL_HWCONTEXT_DXVA2_H
25 * An API-specific header for AV_HWDEVICE_TYPE_DXVA2.
27 * Only fixed-size pools are supported.
29 * For user-allocated pools, AVHWFramesContext.pool must return AVBufferRefs
30 * with the data pointer set to a pointer to IDirect3DSurface9.
37 * This struct is allocated as AVHWDeviceContext.hwctx
39 typedef struct AVDXVA2DeviceContext {
40 IDirect3DDeviceManager9 *devmgr;
41 } AVDXVA2DeviceContext;
44 * This struct is allocated as AVHWFramesContext.hwctx
46 typedef struct AVDXVA2FramesContext {
48 * The surface type (e.g. DXVA2_VideoProcessorRenderTarget or
49 * DXVA2_VideoDecoderRenderTarget). Must be set by the caller.
54 * The surface pool. When an external pool is not provided by the caller,
55 * this will be managed (allocated and filled on init, freed on uninit) by
58 IDirect3DSurface9 **surfaces;
62 * Certain drivers require the decoder to be destroyed before the surfaces.
63 * To allow internally managed pools to work properly in such cases, this
66 * If it is non-NULL, libavutil will call IDirectXVideoDecoder_Release() on
67 * it just before the internal surface pool is freed.
69 * This is for convenience only. Some code uses other methods to manage the
72 IDirectXVideoDecoder *decoder_to_release;
73 } AVDXVA2FramesContext;
75 #endif /* AVUTIL_HWCONTEXT_DXVA2_H */