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

Go to the source code of this file.

Data Structures

struct  ScaleD3D12Context
 

Macros

#define COBJMACROS
 This file is part of FFmpeg. More...
 
#define OFFSET(x)   offsetof(ScaleD3D12Context, x)
 
#define FLAGS   (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
 

Functions

static av_cold int scale_d3d12_init (AVFilterContext *ctx)
 
static void release_d3d12_resources (ScaleD3D12Context *s)
 
static DXGI_COLOR_SPACE_TYPE get_dxgi_colorspace (enum AVColorSpace colorspace, enum AVColorTransferCharacteristic trc, int is_10bit)
 
static AVRational get_input_framerate (AVFilterContext *ctx, AVFilterLink *inlink, AVFrame *in)
 
static int scale_d3d12_configure_processor (ScaleD3D12Context *s, AVFilterContext *ctx)
 
static int scale_d3d12_filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int scale_d3d12_config_props (AVFilterLink *outlink)
 
static av_cold void scale_d3d12_uninit (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS (scale_d3d12)
 

Variables

static const AVFilterPad scale_d3d12_inputs []
 
static const AVFilterPad scale_d3d12_outputs []
 
static const AVOption scale_d3d12_options []
 
const FFFilter ff_vf_scale_d3d12
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

This file is part of FFmpeg.

FFmpeg is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

FFmpeg is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with FFmpeg; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Definition at line 19 of file vf_scale_d3d12.c.

◆ OFFSET

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

Definition at line 744 of file vf_scale_d3d12.c.

◆ FLAGS

Definition at line 745 of file vf_scale_d3d12.c.

Function Documentation

◆ scale_d3d12_init()

static av_cold int scale_d3d12_init ( AVFilterContext ctx)
static

Definition at line 70 of file vf_scale_d3d12.c.

◆ release_d3d12_resources()

static void release_d3d12_resources ( ScaleD3D12Context s)
static

Definition at line 74 of file vf_scale_d3d12.c.

Referenced by scale_d3d12_config_props(), and scale_d3d12_uninit().

◆ get_dxgi_colorspace()

static DXGI_COLOR_SPACE_TYPE get_dxgi_colorspace ( enum AVColorSpace  colorspace,
enum AVColorTransferCharacteristic  trc,
int  is_10bit 
)
static

< HDR10

< HLG

< Rec.709 10-bit

< Default to Rec.709

Definition at line 128 of file vf_scale_d3d12.c.

Referenced by scale_d3d12_filter_frame().

◆ get_input_framerate()

static AVRational get_input_framerate ( AVFilterContext ctx,
AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 156 of file vf_scale_d3d12.c.

Referenced by scale_d3d12_filter_frame().

◆ scale_d3d12_configure_processor()

static int scale_d3d12_configure_processor ( ScaleD3D12Context s,
AVFilterContext ctx 
)
static

Definition at line 182 of file vf_scale_d3d12.c.

Referenced by scale_d3d12_filter_frame().

◆ scale_d3d12_filter_frame()

static int scale_d3d12_filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

< Increment reference count

Definition at line 360 of file vf_scale_d3d12.c.

◆ scale_d3d12_config_props()

static int scale_d3d12_config_props ( AVFilterLink outlink)
static

Definition at line 601 of file vf_scale_d3d12.c.

◆ scale_d3d12_uninit()

static av_cold void scale_d3d12_uninit ( AVFilterContext ctx)
static

Definition at line 716 of file vf_scale_d3d12.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( scale_d3d12  )

Variable Documentation

◆ scale_d3d12_inputs

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

Definition at line 728 of file vf_scale_d3d12.c.

◆ scale_d3d12_outputs

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

Definition at line 736 of file vf_scale_d3d12.c.

◆ scale_d3d12_options

const AVOption scale_d3d12_options[]
static
Initial value:
= {
{ "w", "Output video width", OFFSET(w_expr), AV_OPT_TYPE_STRING, {.str = "iw"}, .flags = FLAGS },
{ "h", "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 747 of file vf_scale_d3d12.c.

◆ ff_vf_scale_d3d12

const FFFilter ff_vf_scale_d3d12
Initial value:
= {
.p.name = "scale_d3d12",
.p.description = NULL_IF_CONFIG_SMALL("Scale video using Direct3D12"),
.priv_size = sizeof(ScaleD3D12Context),
.p.priv_class = &scale_d3d12_class,
.uninit = scale_d3d12_uninit,
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}

Definition at line 756 of file vf_scale_d3d12.c.

scale_d3d12_uninit
static av_cold void scale_d3d12_uninit(AVFilterContext *ctx)
Definition: vf_scale_d3d12.c:716
scale_d3d12_outputs
static const AVFilterPad scale_d3d12_outputs[]
Definition: vf_scale_d3d12.c:736
scale_d3d12_inputs
static const AVFilterPad scale_d3d12_inputs[]
Definition: vf_scale_d3d12.c:728
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:263
scale_d3d12_config_props
static int scale_d3d12_config_props(AVFilterLink *outlink)
Definition: vf_scale_d3d12.c:601
scale_d3d12_filter_frame
static int scale_d3d12_filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_scale_d3d12.c:360
ScaleD3D12Context
Definition: vf_scale_d3d12.c:33
OFFSET
#define OFFSET(x)
Definition: vf_scale_d3d12.c:744
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
AV_PIX_FMT_D3D12
@ AV_PIX_FMT_D3D12
Hardware surfaces for Direct3D 12.
Definition: pixfmt.h:440
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
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:188
FLAGS
#define FLAGS
Definition: vf_scale_d3d12.c:745
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
Windows::Graphics::DirectX::Direct3D11::p
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
Definition: vsrc_gfxcapture_winrt.hpp:53
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
scale_d3d12_init
static av_cold int scale_d3d12_init(AVFilterContext *ctx)
Definition: vf_scale_d3d12.c:70
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