FFmpeg
Data Structures | Macros | Functions | Variables
vf_scale_d3d11.c File Reference
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "compat/w32dlfcn.h"
#include "libavutil/hwcontext.h"
#include "libavutil/hwcontext_d3d11va.h"
#include "filters.h"
#include "scale_eval.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  ScaleD3D11Context
 

Macros

#define OFFSET(x)   offsetof(ScaleD3D11Context, x)
 
#define FLAGS   (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
 

Functions

static av_cold int scale_d3d11_init (AVFilterContext *ctx)
 
static void release_d3d11_resources (ScaleD3D11Context *s)
 
static int scale_d3d11_configure_processor (ScaleD3D11Context *s, AVFilterContext *ctx)
 
static int scale_d3d11_filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int scale_d3d11_config_props (AVFilterLink *outlink)
 
static av_cold void scale_d3d11_uninit (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS (scale_d3d11)
 

Variables

static const AVFilterPad scale_d3d11_inputs []
 
static const AVFilterPad scale_d3d11_outputs []
 
static const AVOption scale_d3d11_options []
 
const FFFilter ff_vf_scale_d3d11
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET (   x)    offsetof(ScaleD3D11Context, x)

Definition at line 437 of file vf_scale_d3d11.c.

◆ FLAGS

Definition at line 438 of file vf_scale_d3d11.c.

Function Documentation

◆ scale_d3d11_init()

static av_cold int scale_d3d11_init ( AVFilterContext ctx)
static

< all real work is done in config_props and filter_frame

Definition at line 61 of file vf_scale_d3d11.c.

◆ release_d3d11_resources()

static void release_d3d11_resources ( ScaleD3D11Context s)
static

Definition at line 66 of file vf_scale_d3d11.c.

Referenced by scale_d3d11_config_props(), and scale_d3d11_uninit().

◆ scale_d3d11_configure_processor()

static int scale_d3d11_configure_processor ( ScaleD3D11Context s,
AVFilterContext ctx 
)
static

< Define the video processor content description

< Query video device interface

Definition at line 88 of file vf_scale_d3d11.c.

Referenced by scale_d3d11_filter_frame().

◆ scale_d3d11_filter_frame()

static int scale_d3d11_filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

< Validate input frame

< Get info from input texture

< Get video context

< Clean up resources

< Forward the frame

Definition at line 147 of file vf_scale_d3d11.c.

◆ scale_d3d11_config_props()

static int scale_d3d11_config_props ( AVFilterLink outlink)
static

< Clean up any previous resources

< Evaluate output dimensions

< Validate input hw_frames_ctx

Definition at line 315 of file vf_scale_d3d11.c.

◆ scale_d3d11_uninit()

static av_cold void scale_d3d11_uninit ( AVFilterContext ctx)
static

< Release D3D11 resources

< Free the hardware device context reference

< Free option strings

Definition at line 406 of file vf_scale_d3d11.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( scale_d3d11  )

Variable Documentation

◆ scale_d3d11_inputs

const AVFilterPad scale_d3d11_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = scale_d3d11_filter_frame,
},
}

Definition at line 421 of file vf_scale_d3d11.c.

◆ scale_d3d11_outputs

const AVFilterPad scale_d3d11_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = scale_d3d11_config_props,
},
}

Definition at line 429 of file vf_scale_d3d11.c.

◆ scale_d3d11_options

const AVOption scale_d3d11_options[]
static
Initial value:
= {
{ "width", "Output video width", OFFSET(w_expr), AV_OPT_TYPE_STRING, {.str = "iw"}, .flags = FLAGS },
{ "height", "Output video height", OFFSET(h_expr), AV_OPT_TYPE_STRING, {.str = "ih"}, .flags = FLAGS },
{ "format", "Output video pixel format", OFFSET(format), AV_OPT_TYPE_PIXEL_FMT, { .i64 = AV_PIX_FMT_NONE }, INT_MIN, INT_MAX, .flags=FLAGS },
{ NULL }
}

Definition at line 440 of file vf_scale_d3d11.c.

◆ ff_vf_scale_d3d11

const FFFilter ff_vf_scale_d3d11
Initial value:
= {
.p.name = "scale_d3d11",
.p.description = NULL_IF_CONFIG_SMALL("Scale video using Direct3D11"),
.priv_size = sizeof(ScaleD3D11Context),
.p.priv_class = &scale_d3d11_class,
.uninit = scale_d3d11_uninit,
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}

Definition at line 449 of file vf_scale_d3d11.c.

ScaleD3D11Context
Definition: vf_scale_d3d11.c:35
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:263
scale_d3d11_filter_frame
static int scale_d3d11_filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_scale_d3d11.c:147
scale_d3d11_init
static av_cold int scale_d3d11_init(AVFilterContext *ctx)
Definition: vf_scale_d3d11.c:61
OFFSET
#define OFFSET(x)
Definition: vf_scale_d3d11.c:437
scale_d3d11_outputs
static const AVFilterPad scale_d3d11_outputs[]
Definition: vf_scale_d3d11.c:429
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:264
NULL
#define NULL
Definition: coverity.c:32
format
New swscale design to change SwsGraph is what coordinates multiple passes These can include cascaded scaling error diffusion and so on Or we could have separate passes for the vertical and horizontal scaling In between each SwsPass lies a fully allocated image buffer Graph passes may have different levels of e g we can have a single threaded error diffusion pass following a multi threaded scaling pass SwsGraph is internally recreated whenever the image format
Definition: swscale-v2.txt:14
scale_d3d11_uninit
static av_cold void scale_d3d11_uninit(AVFilterContext *ctx)
Definition: vf_scale_d3d11.c:406
FF_FILTER_FLAG_HWFRAME_AWARE
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
Definition: filters.h:207
scale_d3d11_config_props
static int scale_d3d11_config_props(AVFilterLink *outlink)
Definition: vf_scale_d3d11.c:315
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
AVFILTER_FLAG_HWDEVICE
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
Definition: avfilter.h:183
AV_PIX_FMT_D3D11
@ AV_PIX_FMT_D3D11
Hardware surfaces for Direct3D11.
Definition: pixfmt.h:336
FLAGS
#define FLAGS
Definition: vf_scale_d3d11.c:438
scale_d3d11_inputs
static const AVFilterPad scale_d3d11_inputs[]
Definition: vf_scale_d3d11.c:421
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AV_OPT_TYPE_PIXEL_FMT
@ AV_OPT_TYPE_PIXEL_FMT
Underlying C type is enum AVPixelFormat.
Definition: opt.h:307
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:200
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition: opt.h:276
FILTER_SINGLE_PIXFMT
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition: filters.h:253