77 "Cannot configure a new D3D12 video processor\n");
81 hr = ID3D12Device_QueryInterface(device, &IID_ID3D12VideoDevice, (
void **)&vpp->
video_device);
98 const D3D12_FEATURE_DATA_VIDEO_PROCESS_SUPPORT *support)
100 D3D12_FEATURE_DATA_VIDEO_PROCESS_SUPPORT
probe;
108 DXGI_COLOR_SPACE_TYPE candidate_space;
116 &candidate_range, &candidate_primaries,
119 &candidate_space) < 0)
123 probe.OutputFormat.Format =
map->dxgi_format;
124 probe.OutputFormat.ColorSpace = candidate_space;
126 hr = ID3D12VideoDevice_CheckFeatureSupport(vpp->
video_device, D3D12_FEATURE_VIDEO_PROCESS_SUPPORT,
131 (SUCCEEDED(hr) && (
probe.SupportFlags & D3D12_VIDEO_PROCESS_SUPPORT_FLAG_SUPPORTED)) ?
132 "supported" :
"unsupported");
137 const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *output_desc,
138 const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *input_desc)
142 hr = ID3D12VideoDevice_CreateVideoProcessor(
148 &IID_ID3D12VideoProcessor,
static int probe(const AVProbeData *p)
static const AVFilterPad inputs[]
static AVFormatContext * ctx
int ff_d3d12_cmd_uninit(AVFilterContext *ctx, D3D12CommandContext *cmd)
Wait for the GPU to finish all submitted work, then release all D3D12 objects and clear cmd->ready.
int ff_d3d12_filter_get_colorspace(AVFilterContext *ctx, int is_rgb, int is_output, enum AVColorSpace *spc, enum AVColorRange *range, enum AVColorPrimaries *primaries, enum AVColorTransferCharacteristic *trc, enum AVChromaLocation chroma_loc, enum AVColorPrimaries input_601_hint, DXGI_COLOR_SPACE_TYPE *out_space)
Map AVFrame color properties to a DXGI color space.
int ff_d3d12_cmd_submit(AVFilterContext *ctx, D3D12CommandContext *cmd, AVFrame *const *inputs, int nb_inputs, AVFrame *output, int *frames_in_use)
Close and execute the command list.
int ff_d3d12_cmd_begin(AVFilterContext *ctx, D3D12CommandContext *cmd)
Get a command allocator the GPU is done with, and reset it together with the command list for recordi...
const D3D12FilterFormat * ff_d3d12_filter_format_iterate(void **opaque)
Iterate over all supported formats.
int ff_d3d12_cmd_init(AVFilterContext *ctx, D3D12CommandContext *cmd, ID3D12Device *device, D3D12_COMMAND_LIST_TYPE type)
Create the command queue, the fence and a closed command list of the given type, after releasing any ...
static void d3d12_vpp_release(D3D12VPPContext *vpp)
int ff_d3d12_vpp_init(AVFilterContext *ctx, D3D12VPPContext *vpp, ID3D12Device *device)
Create the video device and the video process command context on device, after releasing any previous...
int ff_d3d12_vpp_uninit(AVFilterContext *ctx, D3D12VPPContext *vpp)
Wait for the GPU to finish all submitted work, then release all D3D12 objects and clear vpp->configur...
int ff_d3d12_vpp_begin(AVFilterContext *ctx, D3D12VPPContext *vpp)
Start recording into vpp->cmd.list.video_process, see ff_d3d12_cmd_begin().
int ff_d3d12_vpp_submit(AVFilterContext *ctx, D3D12VPPContext *vpp, AVFrame *const *inputs, int nb_inputs, AVFrame *output, int *frames_in_use)
Execute the recorded commands, see ff_d3d12_cmd_submit().
int ff_d3d12_vpp_create_processor(AVFilterContext *ctx, D3D12VPPContext *vpp, const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *output_desc, const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *input_desc)
Create the video processor and mark vpp as configured.
static void d3d12_vpp_check_cmd(D3D12VPPContext *vpp)
void ff_d3d12_vpp_report_output_support(AVFilterContext *ctx, D3D12VPPContext *vpp, const D3D12_FEATURE_DATA_VIDEO_PROCESS_SUPPORT *support)
Log, at debug level, which output formats the video processor supports for the input described in sup...
#define AVERROR_EXTERNAL
Generic error in an external library.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_log_get_level(void)
Get the current log level.
const VDPAUPixFmtMap * map
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
@ AVCHROMA_LOC_UNSPECIFIED
AVColorRange
Visual content value range.
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
@ AVCOL_RANGE_JPEG
Full range content.
AVColorPrimaries
Chromaticity coordinates of the source primaries.
AVColorTransferCharacteristic
Color Transfer Characteristic.
AVColorSpace
YUV colorspace type.
This structure describes decoded (raw) audio or video data.
ID3D12CommandQueue * queue
Video processor state shared by the D3D12 filters.
ID3D12VideoDevice * video_device
ID3D12VideoProcessor * video_processor