19 #ifndef AVCODEC_HWACCEL_H
20 #define AVCODEC_HWACCEL_H
26 #define HWACCEL_CAP_ASYNC_SAFE (1 << 0)
45 #define HW_CONFIG_HWACCEL(device, frames, ad_hoc, format, device_type_, name) \
46 &(const AVCodecHWConfigInternal) { \
48 .pix_fmt = AV_PIX_FMT_ ## format, \
49 .methods = (device ? AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX : 0) | \
50 (frames ? AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX : 0) | \
51 (ad_hoc ? AV_CODEC_HW_CONFIG_METHOD_AD_HOC : 0), \
52 .device_type = AV_HWDEVICE_TYPE_ ## device_type_, \
57 #define HW_CONFIG_INTERNAL(format) \
58 &(const AVCodecHWConfigInternal) { \
60 .pix_fmt = AV_PIX_FMT_ ## format, \
61 .methods = AV_CODEC_HW_CONFIG_METHOD_INTERNAL, \
62 .device_type = AV_HWDEVICE_TYPE_NONE, \
67 #define HWACCEL_DXVA2(codec) \
68 HW_CONFIG_HWACCEL(1, 1, 1, DXVA2_VLD, DXVA2, ff_ ## codec ## _dxva2_hwaccel)
69 #define HWACCEL_D3D11VA2(codec) \
70 HW_CONFIG_HWACCEL(1, 1, 0, D3D11, D3D11VA, ff_ ## codec ## _d3d11va2_hwaccel)
71 #define HWACCEL_NVDEC(codec) \
72 HW_CONFIG_HWACCEL(1, 1, 0, CUDA, CUDA, ff_ ## codec ## _nvdec_hwaccel)
73 #define HWACCEL_VAAPI(codec) \
74 HW_CONFIG_HWACCEL(1, 1, 1, VAAPI, VAAPI, ff_ ## codec ## _vaapi_hwaccel)
75 #define HWACCEL_VDPAU(codec) \
76 HW_CONFIG_HWACCEL(1, 1, 1, VDPAU, VDPAU, ff_ ## codec ## _vdpau_hwaccel)
77 #define HWACCEL_VIDEOTOOLBOX(codec) \
78 HW_CONFIG_HWACCEL(1, 1, 1, VIDEOTOOLBOX, VIDEOTOOLBOX, ff_ ## codec ## _videotoolbox_hwaccel)
79 #define HWACCEL_D3D11VA(codec) \
80 HW_CONFIG_HWACCEL(0, 0, 1, D3D11VA_VLD, NONE, ff_ ## codec ## _d3d11va_hwaccel)
81 #define HWACCEL_XVMC(codec) \
82 HW_CONFIG_HWACCEL(0, 0, 1, XVMC, NONE, ff_ ## codec ## _xvmc_hwaccel)
const AVHWAccel * hwaccel
If this configuration uses a hwaccel, a pointer to it.
Libavcodec external API header.