FFmpeg
Loading...
Searching...
No Matches
vf_scale_d3d11.c File Reference
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "compat/w32dlfcn.h"
#include <initguid.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)
 
#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)
Value:

Definition at line 432 of file vf_scale_d3d11.c.

◆ FLAGS

Definition at line 433 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 62 of file vf_scale_d3d11.c.

◆ release_d3d11_resources()

static void release_d3d11_resources ( ScaleD3D11Context * s)
static

Definition at line 67 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 89 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 148 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 316 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 401 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,
},
}
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static int scale_d3d11_filter_frame(AVFilterLink *inlink, AVFrame *in)

Definition at line 416 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,
},
}
static int scale_d3d11_config_props(AVFilterLink *outlink)

Definition at line 424 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 }
}
static const char *const format[]
Definition af_aiir.c:444
#define FLAGS
Definition cmdutils.c:598
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ AV_OPT_TYPE_PIXEL_FMT
Underlying C type is enum AVPixelFormat.
Definition opt.h:306
@ 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:275
@ AV_PIX_FMT_NONE
Definition pixfmt.h:72

Definition at line 435 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,
}
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
Definition avfilter.h:187
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#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:208
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition filters.h:254
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
@ AV_PIX_FMT_D3D11
Hardware surfaces for Direct3D11.
Definition pixfmt.h:336
static av_cold void scale_d3d11_uninit(AVFilterContext *ctx)
static av_cold int scale_d3d11_init(AVFilterContext *ctx)
static const AVFilterPad scale_d3d11_inputs[]
static const AVFilterPad scale_d3d11_outputs[]

Definition at line 444 of file vf_scale_d3d11.c.