FFmpeg
Data Structures | Macros
hwconfig.h File Reference
#include "avcodec.h"
#include "hwaccels.h"

Go to the source code of this file.

Data Structures

struct  AVCodecHWConfigInternal
 

Macros

#define HWACCEL_CAP_ASYNC_SAFE   (1 << 0)
 
#define HW_CONFIG_HWACCEL(device, frames, ad_hoc, format, device_type_, name)
 
#define HW_CONFIG_INTERNAL(format)
 
#define HWACCEL_DXVA2(codec)   HW_CONFIG_HWACCEL(1, 1, 1, DXVA2_VLD, DXVA2, ff_ ## codec ## _dxva2_hwaccel)
 
#define HWACCEL_D3D11VA2(codec)   HW_CONFIG_HWACCEL(1, 1, 0, D3D11, D3D11VA, ff_ ## codec ## _d3d11va2_hwaccel)
 
#define HWACCEL_NVDEC(codec)   HW_CONFIG_HWACCEL(1, 1, 0, CUDA, CUDA, ff_ ## codec ## _nvdec_hwaccel)
 
#define HWACCEL_VAAPI(codec)   HW_CONFIG_HWACCEL(1, 1, 1, VAAPI, VAAPI, ff_ ## codec ## _vaapi_hwaccel)
 
#define HWACCEL_VDPAU(codec)   HW_CONFIG_HWACCEL(1, 1, 1, VDPAU, VDPAU, ff_ ## codec ## _vdpau_hwaccel)
 
#define HWACCEL_VIDEOTOOLBOX(codec)   HW_CONFIG_HWACCEL(1, 1, 1, VIDEOTOOLBOX, VIDEOTOOLBOX, ff_ ## codec ## _videotoolbox_hwaccel)
 
#define HWACCEL_D3D11VA(codec)   HW_CONFIG_HWACCEL(0, 0, 1, D3D11VA_VLD, NONE, ff_ ## codec ## _d3d11va_hwaccel)
 
#define HWACCEL_XVMC(codec)   HW_CONFIG_HWACCEL(0, 0, 1, XVMC, NONE, ff_ ## codec ## _xvmc_hwaccel)
 
#define HW_CONFIG_ENCODER(device, frames, ad_hoc, format, device_type_)
 
#define HW_CONFIG_ENCODER_DEVICE(format, device_type_)   HW_CONFIG_ENCODER(1, 0, 0, format, device_type_)
 
#define HW_CONFIG_ENCODER_FRAMES(format, device_type_)   HW_CONFIG_ENCODER(0, 1, 0, format, device_type_)
 

Macro Definition Documentation

◆ HWACCEL_CAP_ASYNC_SAFE

#define HWACCEL_CAP_ASYNC_SAFE   (1 << 0)

Definition at line 26 of file hwconfig.h.

◆ HW_CONFIG_HWACCEL

#define HW_CONFIG_HWACCEL (   device,
  frames,
  ad_hoc,
  format,
  device_type_,
  name 
)
Value:
.public = { \
.pix_fmt = AV_PIX_FMT_ ## format, \
.methods = (device ? AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX : 0) | \
.device_type = AV_HWDEVICE_TYPE_ ## device_type_, \
}, \
.hwaccel = &name, \
}

Definition at line 45 of file hwconfig.h.

◆ HW_CONFIG_INTERNAL

#define HW_CONFIG_INTERNAL (   format)
Value:
.public = { \
.pix_fmt = AV_PIX_FMT_ ## format, \
.device_type = AV_HWDEVICE_TYPE_NONE, \
}, \
.hwaccel = NULL, \
}

Definition at line 57 of file hwconfig.h.

◆ HWACCEL_DXVA2

#define HWACCEL_DXVA2 (   codec)    HW_CONFIG_HWACCEL(1, 1, 1, DXVA2_VLD, DXVA2, ff_ ## codec ## _dxva2_hwaccel)

Definition at line 67 of file hwconfig.h.

◆ HWACCEL_D3D11VA2

#define HWACCEL_D3D11VA2 (   codec)    HW_CONFIG_HWACCEL(1, 1, 0, D3D11, D3D11VA, ff_ ## codec ## _d3d11va2_hwaccel)

Definition at line 69 of file hwconfig.h.

◆ HWACCEL_NVDEC

#define HWACCEL_NVDEC (   codec)    HW_CONFIG_HWACCEL(1, 1, 0, CUDA, CUDA, ff_ ## codec ## _nvdec_hwaccel)

Definition at line 71 of file hwconfig.h.

◆ HWACCEL_VAAPI

#define HWACCEL_VAAPI (   codec)    HW_CONFIG_HWACCEL(1, 1, 1, VAAPI, VAAPI, ff_ ## codec ## _vaapi_hwaccel)

Definition at line 73 of file hwconfig.h.

◆ HWACCEL_VDPAU

#define HWACCEL_VDPAU (   codec)    HW_CONFIG_HWACCEL(1, 1, 1, VDPAU, VDPAU, ff_ ## codec ## _vdpau_hwaccel)

Definition at line 75 of file hwconfig.h.

◆ HWACCEL_VIDEOTOOLBOX

#define HWACCEL_VIDEOTOOLBOX (   codec)    HW_CONFIG_HWACCEL(1, 1, 1, VIDEOTOOLBOX, VIDEOTOOLBOX, ff_ ## codec ## _videotoolbox_hwaccel)

Definition at line 77 of file hwconfig.h.

◆ HWACCEL_D3D11VA

#define HWACCEL_D3D11VA (   codec)    HW_CONFIG_HWACCEL(0, 0, 1, D3D11VA_VLD, NONE, ff_ ## codec ## _d3d11va_hwaccel)

Definition at line 79 of file hwconfig.h.

◆ HWACCEL_XVMC

#define HWACCEL_XVMC (   codec)    HW_CONFIG_HWACCEL(0, 0, 1, XVMC, NONE, ff_ ## codec ## _xvmc_hwaccel)

Definition at line 81 of file hwconfig.h.

◆ HW_CONFIG_ENCODER

#define HW_CONFIG_ENCODER (   device,
  frames,
  ad_hoc,
  format,
  device_type_ 
)
Value:
.public = { \
.pix_fmt = AV_PIX_FMT_ ## format, \
.methods = (device ? AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX : 0) | \
.device_type = AV_HWDEVICE_TYPE_ ## device_type_, \
}, \
.hwaccel = NULL, \
}

Definition at line 84 of file hwconfig.h.

◆ HW_CONFIG_ENCODER_DEVICE

#define HW_CONFIG_ENCODER_DEVICE (   format,
  device_type_ 
)    HW_CONFIG_ENCODER(1, 0, 0, format, device_type_)

Definition at line 96 of file hwconfig.h.

◆ HW_CONFIG_ENCODER_FRAMES

#define HW_CONFIG_ENCODER_FRAMES (   format,
  device_type_ 
)    HW_CONFIG_ENCODER(0, 1, 0, format, device_type_)

Definition at line 99 of file hwconfig.h.

name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
AV_HWDEVICE_TYPE_NONE
@ AV_HWDEVICE_TYPE_NONE
Definition: hwcontext.h:28
frames
if it could not because there are no more frames
Definition: filter_design.txt:266
AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX
@ AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX
The codec supports this format via the hw_frames_ctx interface.
Definition: codec.h:441
NULL
#define NULL
Definition: coverity.c:32
AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX
@ AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX
The codec supports this format via the hw_device_ctx interface.
Definition: codec.h:428
AV_CODEC_HW_CONFIG_METHOD_INTERNAL
@ AV_CODEC_HW_CONFIG_METHOD_INTERNAL
The codec supports this format by some internal method.
Definition: codec.h:448
format
ofilter format
Definition: ffmpeg_filter.c:172
AVCodecHWConfigInternal
Definition: hwconfig.h:29
AV_CODEC_HW_CONFIG_METHOD_AD_HOC
@ AV_CODEC_HW_CONFIG_METHOD_AD_HOC
The codec supports this format by some ad-hoc method.
Definition: codec.h:457