FFmpeg
Loading...
Searching...
No Matches
d3d12_vpp.h File Reference
#include "libavutil/frame.h"
#include "libavutil/hwcontext_d3d12va.h"
#include "avfilter.h"
#include "d3d12_filter.h"

Go to the source code of this file.

Data Structures

struct  D3D12VPPContext
 Video processor state shared by the D3D12 filters. More...
 

Functions

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 configuration.
 
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 support.
 
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.
 
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_uninit (AVFilterContext *ctx, D3D12VPPContext *vpp)
 Wait for the GPU to finish all submitted work, then release all D3D12 objects and clear vpp->configured.
 

Function Documentation

◆ ff_d3d12_vpp_init()

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 configuration.

Definition at line 70 of file d3d12_vpp.c.

Referenced by scale_d3d12_configure_processor().

◆ ff_d3d12_vpp_report_output_support()

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 support.

Definition at line 97 of file d3d12_vpp.c.

Referenced by scale_d3d12_configure_processor().

◆ ff_d3d12_vpp_create_processor()

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.

Must be called after ff_d3d12_vpp_init(). Releases everything on failure.

Definition at line 136 of file d3d12_vpp.c.

Referenced by scale_d3d12_configure_processor().

◆ ff_d3d12_vpp_begin()

int ff_d3d12_vpp_begin ( AVFilterContext * ctx,
D3D12VPPContext * vpp )

Start recording into vpp->cmd.list.video_process, see ff_d3d12_cmd_begin().

Clears vpp->configured if the command context was torn down.

Definition at line 163 of file d3d12_vpp.c.

Referenced by scale_d3d12_filter_frame().

◆ ff_d3d12_vpp_submit()

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().

Clears vpp->configured if the command context was torn down.

Definition at line 172 of file d3d12_vpp.c.

Referenced by scale_d3d12_filter_frame().

◆ ff_d3d12_vpp_uninit()

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->configured.

Returns
0 on success, AVERROR_EXTERNAL if the GPU could not be confirmed idle, in which case nothing is released

Definition at line 55 of file d3d12_vpp.c.

Referenced by ff_d3d12_vpp_create_processor(), ff_d3d12_vpp_init(), scale_d3d12_config_props(), scale_d3d12_configure_processor(), and scale_d3d12_uninit().