FFmpeg
Loading...
Searching...
No Matches
vf_scale_d3d11.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2025 MulticorewWare, Inc.
3 *
4 * Authors: Dash Santosh <dash.sathanatayanan@multicorewareinc.com>
5 * Sachin <sachin.prakash@multicorewareinc.com>
6 *
7 * This file is part of FFmpeg.
8 *
9 * FFmpeg is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * FFmpeg is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with FFmpeg; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24#include "libavutil/opt.h"
25#include "libavutil/pixdesc.h"
26#include "compat/w32dlfcn.h"
27
28#include <initguid.h>
29#include "libavutil/hwcontext.h"
31
32#include "filters.h"
33#include "scale_eval.h"
34#include "video.h"
35
36typedef struct ScaleD3D11Context {
38 char *w_expr;
39 char *h_expr;
41
42 ///< D3D11 objects
44 ID3D11DeviceContext *context;
45 ID3D11VideoDevice *videoDevice;
46 ID3D11VideoProcessor *processor;
47 ID3D11VideoProcessorEnumerator *enumerator;
48 ID3D11VideoProcessorOutputView *outputView;
49 ID3D11VideoProcessorInputView *inputView;
50
51 ///< Buffer references
54
55 ///< Dimensions and formats
58 DXGI_FORMAT input_format;
59 DXGI_FORMAT output_format;
61
63 ///< all real work is done in config_props and filter_frame
64 return 0;
65}
66
68 if (s->outputView) {
69 s->outputView->lpVtbl->Release(s->outputView);
70 s->outputView = NULL;
71 }
72
73 if (s->processor) {
74 s->processor->lpVtbl->Release(s->processor);
75 s->processor = NULL;
76 }
77
78 if (s->enumerator) {
79 s->enumerator->lpVtbl->Release(s->enumerator);
80 s->enumerator = NULL;
81 }
82
83 if (s->videoDevice) {
84 s->videoDevice->lpVtbl->Release(s->videoDevice);
85 s->videoDevice = NULL;
86 }
87}
88
90 HRESULT hr;
91
92 switch (s->format) {
93 case AV_PIX_FMT_NV12:
94 s->output_format = DXGI_FORMAT_NV12;
95 break;
96 case AV_PIX_FMT_P010:
97 s->output_format = DXGI_FORMAT_P010;
98 break;
99 default:
100 av_log(ctx, AV_LOG_ERROR, "Invalid output format specified\n");
101 return AVERROR(EINVAL);
102 }
103
104 ///< Get D3D11 device and context from hardware device context
105 AVHWDeviceContext *hwctx = (AVHWDeviceContext *)s->hw_device_ctx->data;
106 AVD3D11VADeviceContext *d3d11_hwctx = (AVD3D11VADeviceContext *)hwctx->hwctx;
107 s->device = d3d11_hwctx->device;
108 s->context = d3d11_hwctx->device_context;
109
110 av_log(ctx, AV_LOG_VERBOSE, "Configuring D3D11 video processor: %dx%d -> %dx%d\n",
111 s->inputWidth, s->inputHeight, s->width, s->height);
112
113 ///< Define the video processor content description
114 D3D11_VIDEO_PROCESSOR_CONTENT_DESC contentDesc = {
115 .InputFrameFormat = D3D11_VIDEO_FRAME_FORMAT_PROGRESSIVE,
116 .InputWidth = s->inputWidth,
117 .InputHeight = s->inputHeight,
118 .OutputWidth = s->width,
119 .OutputHeight = s->height,
120 .Usage = D3D11_VIDEO_USAGE_PLAYBACK_NORMAL,
121 };
122
123 ///< Query video device interface
124 hr = s->device->lpVtbl->QueryInterface(s->device, &IID_ID3D11VideoDevice, (void **)&s->videoDevice);
125 if (FAILED(hr)) {
126 av_log(ctx, AV_LOG_ERROR, "Failed to get D3D11 video device interface: HRESULT 0x%lX\n", hr);
127 return AVERROR_EXTERNAL;
128 }
129
130 ///< Create video processor enumerator
131 hr = s->videoDevice->lpVtbl->CreateVideoProcessorEnumerator(s->videoDevice, &contentDesc, &s->enumerator);
132 if (FAILED(hr)) {
133 av_log(ctx, AV_LOG_ERROR, "Failed to create video processor enumerator: HRESULT 0x%lX\n", hr);
134 return AVERROR_EXTERNAL;
135 }
136
137 ///< Create the video processor
138 hr = s->videoDevice->lpVtbl->CreateVideoProcessor(s->videoDevice, s->enumerator, 0, &s->processor);
139 if (FAILED(hr)) {
140 av_log(ctx, AV_LOG_ERROR, "Failed to create video processor: HRESULT 0x%lX\n", hr);
141 return AVERROR_EXTERNAL;
142 }
143
144 av_log(ctx, AV_LOG_VERBOSE, "D3D11 video processor successfully configured\n");
145 return 0;
146}
147
149{
150 AVFilterContext *ctx = inlink->dst;
151 ScaleD3D11Context *s = ctx->priv;
152 AVFilterLink *outlink = ctx->outputs[0];
153 ID3D11VideoProcessorInputView *inputView = NULL;
154 ID3D11VideoContext *videoContext = NULL;
155 AVFrame *out = NULL;
156 int ret = 0;
157 HRESULT hr;
158
159 ///< Validate input frame
160 if (!in) {
161 av_log(ctx, AV_LOG_ERROR, "Null input frame\n");
162 return AVERROR(EINVAL);
163 }
164
165 if (!in->hw_frames_ctx) {
166 av_log(ctx, AV_LOG_ERROR, "No hardware frames context in input frame\n");
167 av_frame_free(&in);
168 return AVERROR(EINVAL);
169 }
170
171 ///< Verify hardware device contexts
173
174 if (!s->hw_device_ctx) {
175 av_log(ctx, AV_LOG_ERROR, "Filter hardware device context is uninitialized\n");
176 av_frame_free(&in);
177 return AVERROR(EINVAL);
178 }
179
180 AVHWDeviceContext *input_device_ctx = (AVHWDeviceContext *)frames_ctx->device_ref->data;
181 AVHWDeviceContext *filter_device_ctx = (AVHWDeviceContext *)s->hw_device_ctx->data;
182
183 if (input_device_ctx->type != filter_device_ctx->type) {
184 av_log(ctx, AV_LOG_ERROR, "Mismatch between input and filter hardware device types\n");
185 av_frame_free(&in);
186 return AVERROR(EINVAL);
187 }
188
189 ///< Allocate output frame
191 if (!out) {
192 av_log(ctx, AV_LOG_ERROR, "Failed to allocate output frame\n");
193 av_frame_free(&in);
194 return AVERROR(ENOMEM);
195 }
196
197 ret = av_hwframe_get_buffer(s->hw_frames_ctx_out, out, 0);
198 if (ret < 0) {
199 av_log(ctx, AV_LOG_ERROR, "Failed to get output frame from pool\n");
200 goto fail;
201 }
202
203 ///< Configure the D3D11 video processor if not already configured
204 if (!s->processor) {
205 ///< Get info from input texture
206 D3D11_TEXTURE2D_DESC textureDesc;
207 ID3D11Texture2D *input_texture = (ID3D11Texture2D *)in->data[0];
208 input_texture->lpVtbl->GetDesc(input_texture, &textureDesc);
209
210 s->inputWidth = textureDesc.Width;
211 s->inputHeight = textureDesc.Height;
212 s->input_format = textureDesc.Format;
213
215 if (ret < 0) {
216 av_log(ctx, AV_LOG_ERROR, "Failed to configure processor\n");
217 goto fail;
218 }
219 }
220
221 ///< Get input texture and prepare input view
222 ID3D11Texture2D *d3d11_texture = (ID3D11Texture2D *)in->data[0];
223 int subIdx = (int)(intptr_t)in->data[1];
224
225 D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC inputViewDesc = {
226 .FourCC = s->input_format,
227 .ViewDimension = D3D11_VPIV_DIMENSION_TEXTURE2D,
228 .Texture2D.ArraySlice = subIdx
229 };
230
231 hr = s->videoDevice->lpVtbl->CreateVideoProcessorInputView(
232 s->videoDevice, (ID3D11Resource *)d3d11_texture, s->enumerator, &inputViewDesc, &inputView);
233 if (FAILED(hr)) {
234 av_log(ctx, AV_LOG_ERROR, "Failed to create input view: HRESULT 0x%lX\n", hr);
235 ret = AVERROR_EXTERNAL;
236 goto fail;
237 }
238
239 ///< Create output view for current texture
240 ID3D11Texture2D *output_texture = (ID3D11Texture2D *)out->data[0];
241 D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC outputViewDesc = {
242 .ViewDimension = D3D11_VPOV_DIMENSION_TEXTURE2D,
243 .Texture2D = { .MipSlice = 0 },
244 };
245
246 hr = s->videoDevice->lpVtbl->CreateVideoProcessorOutputView(
247 s->videoDevice, (ID3D11Resource *)output_texture, s->enumerator, &outputViewDesc, &s->outputView);
248 if (FAILED(hr)) {
249 av_log(ctx, AV_LOG_ERROR, "Failed to create output view: HRESULT 0x%lX\n", hr);
250 ret = AVERROR_EXTERNAL;
251 goto fail;
252 }
253
254 ///< Set up processing stream
255 D3D11_VIDEO_PROCESSOR_STREAM stream = {
256 .Enable = TRUE,
257 .pInputSurface = inputView,
258 .OutputIndex = 0
259 };
260
261 ///< Get video context
262 hr = s->context->lpVtbl->QueryInterface(s->context, &IID_ID3D11VideoContext, (void **)&videoContext);
263 if (FAILED(hr)) {
264 av_log(ctx, AV_LOG_ERROR, "Failed to get video context: HRESULT 0x%lX\n", hr);
265 ret = AVERROR_EXTERNAL;
266 goto fail;
267 }
268
269 ///< Process the frame
270 hr = videoContext->lpVtbl->VideoProcessorBlt(videoContext, s->processor, s->outputView, 0, 1, &stream);
271 if (FAILED(hr)) {
272 av_log(ctx, AV_LOG_ERROR, "VideoProcessorBlt failed: HRESULT 0x%lX\n", hr);
273 ret = AVERROR_EXTERNAL;
274 goto fail;
275 }
276
277 ///< Set up output frame
278 ret = av_frame_copy_props(out, in);
279 if (ret < 0) {
280 av_log(ctx, AV_LOG_ERROR, "Failed to copy frame properties\n");
281 goto fail;
282 }
283
284 out->data[0] = (uint8_t *)output_texture;
285 out->data[1] = (uint8_t *)(intptr_t)0;
286 out->width = s->width;
287 out->height = s->height;
288 out->format = AV_PIX_FMT_D3D11;
289
290 ///< Clean up resources
291 inputView->lpVtbl->Release(inputView);
292 videoContext->lpVtbl->Release(videoContext);
293 if (s->outputView) {
294 s->outputView->lpVtbl->Release(s->outputView);
295 s->outputView = NULL;
296 }
297 av_frame_free(&in);
298
299 ///< Forward the frame
300 return ff_filter_frame(outlink, out);
301
302fail:
303 if (inputView)
304 inputView->lpVtbl->Release(inputView);
305 if (videoContext)
306 videoContext->lpVtbl->Release(videoContext);
307 if (s->outputView) {
308 s->outputView->lpVtbl->Release(s->outputView);
309 s->outputView = NULL;
310 }
311 av_frame_free(&in);
313 return ret;
314}
315
317{
318 AVFilterContext *ctx = outlink->src;
319 ScaleD3D11Context *s = ctx->priv;
320 AVFilterLink *inlink = ctx->inputs[0];
321 FilterLink *inl = ff_filter_link(inlink);
322 FilterLink *outl = ff_filter_link(outlink);
323 int ret;
324
325 ///< Clean up any previous resources
327
328 ///< Evaluate output dimensions
329 ret = ff_scale_eval_dimensions(s, s->w_expr, s->h_expr, inlink, outlink, &s->width, &s->height);
330 if (ret < 0) {
331 av_log(ctx, AV_LOG_ERROR, "Failed to evaluate dimensions\n");
332 return ret;
333 }
334
335 outlink->w = s->width;
336 outlink->h = s->height;
337
338 ///< Validate input hw_frames_ctx
339 if (!inl->hw_frames_ctx) {
340 av_log(ctx, AV_LOG_ERROR, "No hw_frames_ctx available on input link\n");
341 return AVERROR(EINVAL);
342 }
343
344 ///< Initialize filter's hardware device context
345 if (!s->hw_device_ctx) {
346 AVHWFramesContext *in_frames_ctx = (AVHWFramesContext *)inl->hw_frames_ctx->data;
347 s->hw_device_ctx = av_buffer_ref(in_frames_ctx->device_ref);
348 if (!s->hw_device_ctx) {
349 av_log(ctx, AV_LOG_ERROR, "Failed to initialize filter hardware device context\n");
350 return AVERROR(ENOMEM);
351 }
352 }
353
354 ///< Get D3D11 device and context (but don't initialize processor yet - done in filter_frame)
355 AVHWDeviceContext *hwctx = (AVHWDeviceContext *)s->hw_device_ctx->data;
356 AVD3D11VADeviceContext *d3d11_hwctx = (AVD3D11VADeviceContext *)hwctx->hwctx;
357
358 s->device = d3d11_hwctx->device;
359 s->context = d3d11_hwctx->device_context;
360
361 if (!s->device || !s->context) {
362 av_log(ctx, AV_LOG_ERROR, "Failed to get valid D3D11 device or context\n");
363 return AVERROR(EINVAL);
364 }
365
366 ///< Create new hardware frames context for output
367 s->hw_frames_ctx_out = av_hwframe_ctx_alloc(s->hw_device_ctx);
368 if (!s->hw_frames_ctx_out)
369 return AVERROR(ENOMEM);
370
371 AVHWFramesContext *frames_ctx = (AVHWFramesContext *)s->hw_frames_ctx_out->data;
372 frames_ctx->format = AV_PIX_FMT_D3D11;
373 frames_ctx->sw_format = s->format;
374 frames_ctx->width = s->width;
375 frames_ctx->height = s->height;
376 frames_ctx->initial_pool_size = 10;
377
378 if (ctx->extra_hw_frames > 0)
379 frames_ctx->initial_pool_size += ctx->extra_hw_frames;
380
381 AVD3D11VAFramesContext *frames_hwctx = frames_ctx->hwctx;
382 frames_hwctx->MiscFlags = 0;
383 frames_hwctx->BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_VIDEO_ENCODER;
384
385 ret = av_hwframe_ctx_init(s->hw_frames_ctx_out);
386 if (ret < 0) {
387 av_buffer_unref(&s->hw_frames_ctx_out);
388 return ret;
389 }
390
391 ///< Propagate hw_frames_ctx to output
392 outl->hw_frames_ctx = av_buffer_ref(s->hw_frames_ctx_out);
393 if (!outl->hw_frames_ctx)
394 return AVERROR(ENOMEM);
395
396 av_log(ctx, AV_LOG_VERBOSE, "D3D11 scale config: %dx%d -> %dx%d\n",
397 inlink->w, inlink->h, outlink->w, outlink->h);
398 return 0;
399}
400
402 ScaleD3D11Context *s = ctx->priv;
403
404 ///< Release D3D11 resources
406
407 ///< Free the hardware device context reference
408 av_buffer_unref(&s->hw_frames_ctx_out);
409 av_buffer_unref(&s->hw_device_ctx);
410
411 ///< Free option strings
412 av_freep(&s->w_expr);
413 av_freep(&s->h_expr);
414}
415
417 {
418 .name = "default",
419 .type = AVMEDIA_TYPE_VIDEO,
420 .filter_frame = scale_d3d11_filter_frame,
421 },
422};
423
425 {
426 .name = "default",
427 .type = AVMEDIA_TYPE_VIDEO,
428 .config_props = scale_d3d11_config_props,
429 },
430};
431
432#define OFFSET(x) offsetof(ScaleD3D11Context, x)
433#define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
434
436 { "width", "Output video width", OFFSET(w_expr), AV_OPT_TYPE_STRING, {.str = "iw"}, .flags = FLAGS },
437 { "height", "Output video height", OFFSET(h_expr), AV_OPT_TYPE_STRING, {.str = "ih"}, .flags = FLAGS },
438 { "format", "Output video pixel format", OFFSET(format), AV_OPT_TYPE_PIXEL_FMT, { .i64 = AV_PIX_FMT_NONE }, INT_MIN, INT_MAX, .flags=FLAGS },
439 { NULL }
440};
441
443
445 .p.name = "scale_d3d11",
446 .p.description = NULL_IF_CONFIG_SMALL("Scale video using Direct3D11"),
447 .priv_size = sizeof(ScaleD3D11Context),
448 .p.priv_class = &scale_d3d11_class,
449 .init = scale_d3d11_init,
450 .uninit = scale_d3d11_uninit,
454 .p.flags = AVFILTER_FLAG_HWDEVICE,
455 .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
456};
static const char *const format[]
Definition af_aiir.c:444
const FFFilter ff_vf_scale_d3d11
static FILE * out
static AVFormatContext * ctx
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition avfilter.c:1068
#define s(width, name)
Definition cbs_vp9.c:198
#define FLAGS
Definition cmdutils.c:598
#define NULL
Definition coverity.c:32
#define fail
Definition test.h:479
@ 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
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
Definition avfilter.h:187
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
Definition buffer.c:139
AVBufferRef * av_buffer_ref(const AVBufferRef *buf)
Create a new reference to an AVBuffer.
Definition buffer.c:103
#define AVERROR_EXTERNAL
Generic error in an external library.
Definition error.h:59
#define AVERROR(e)
Definition error.h:45
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition frame.c:64
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition frame.c:599
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
Definition frame.c:52
#define AV_LOG_VERBOSE
Detailed information.
Definition log.h:226
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
int av_hwframe_ctx_init(AVBufferRef *ref)
Finalize the context before use.
Definition hwcontext.c:337
AVBufferRef * av_hwframe_ctx_alloc(AVBufferRef *device_ref_in)
Allocate an AVHWFramesContext tied to a given device context.
Definition hwcontext.c:263
int av_hwframe_get_buffer(AVBufferRef *hwframe_ref, AVFrame *frame, int flags)
Allocate a new frame attached to the given AVHWFramesContext.
Definition hwcontext.c:506
An API-specific header for AV_HWDEVICE_TYPE_D3D11VA.
#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
static FilterLink * ff_filter_link(AVFilterLink *link)
Definition filters.h:199
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition filters.h:254
#define AVFILTER_DEFINE_CLASS(fname)
Definition filters.h:478
#define av_cold
Definition attributes.h:117
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
void ID3D11Device
Definition nvenc.h:28
AVOptions.
#define AV_PIX_FMT_P010
Definition pixfmt.h:608
AVPixelFormat
Pixel format.
Definition pixfmt.h:71
@ AV_PIX_FMT_NV12
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
Definition pixfmt.h:96
@ AV_PIX_FMT_NONE
Definition pixfmt.h:72
@ AV_PIX_FMT_D3D11
Hardware surfaces for Direct3D11.
Definition pixfmt.h:336
int ff_scale_eval_dimensions(void *log_ctx, const char *w_expr, const char *h_expr, AVFilterLink *inlink, AVFilterLink *outlink, int *ret_w, int *ret_h)
Parse and evaluate string expressions for width and height.
Definition scale_eval.c:58
A reference to a data buffer.
Definition buffer.h:82
uint8_t * data
The data buffer.
Definition buffer.h:90
Describe the class of an AVClass context structure.
Definition log.h:76
This struct is allocated as AVHWDeviceContext.hwctx.
ID3D11Device * device
Device used for texture creation and access.
ID3D11DeviceContext * device_context
If unset, this will be set from the device field on init.
This struct is allocated as AVHWFramesContext.hwctx.
UINT MiscFlags
D3D11_TEXTURE2D_DESC.MiscFlags used for texture creation.
UINT BindFlags
D3D11_TEXTURE2D_DESC.BindFlags used for texture creation.
An instance of a filter.
Definition avfilter.h:273
A filter pad used for either input or output.
Definition filters.h:40
This structure describes decoded (raw) audio or video data.
Definition frame.h:472
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition frame.h:493
AVBufferRef * hw_frames_ctx
For hwaccel-format frames, this should be a reference to the AVHWFramesContext describing the frame.
Definition frame.h:769
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
Definition hwcontext.h:63
void * hwctx
The format-specific data, allocated and freed by libavutil along with this context.
Definition hwcontext.h:88
enum AVHWDeviceType type
This field identifies the underlying API used for hardware access.
Definition hwcontext.h:75
This struct describes a set or pool of "hardware" frames (i.e.
Definition hwcontext.h:118
enum AVPixelFormat format
The pixel format identifying the underlying HW surface type.
Definition hwcontext.h:200
AVBufferRef * device_ref
A reference to the parent AVHWDeviceContext.
Definition hwcontext.h:129
void * hwctx
The format-specific data, allocated and freed automatically along with this context.
Definition hwcontext.h:153
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
Definition hwcontext.h:213
int initial_pool_size
Initial size of the frame pool.
Definition hwcontext.h:190
int width
The allocated dimensions of the frames in this pool.
Definition hwcontext.h:220
AVOption.
Definition opt.h:428
DXGI_FORMAT input_format
ID3D11VideoProcessor * processor
ID3D11VideoProcessorEnumerator * enumerator
ID3D11VideoProcessorInputView * inputView
Buffer references.
ID3D11VideoDevice * videoDevice
enum AVPixelFormat format
D3D11 objects.
ID3D11VideoProcessorOutputView * outputView
AVBufferRef * hw_device_ctx
AVBufferRef * hw_frames_ctx_out
Dimensions and formats.
ID3D11DeviceContext * context
DXGI_FORMAT output_format
ID3D11Device * device
const AVClass * classCtx
#define av_freep(p)
#define av_log(a,...)
static const AVOption scale_d3d11_options[]
static av_cold void scale_d3d11_uninit(AVFilterContext *ctx)
static void release_d3d11_resources(ScaleD3D11Context *s)
static av_cold int scale_d3d11_init(AVFilterContext *ctx)
static const AVFilterPad scale_d3d11_inputs[]
static const AVFilterPad scale_d3d11_outputs[]
static int scale_d3d11_configure_processor(ScaleD3D11Context *s, AVFilterContext *ctx)
static int scale_d3d11_config_props(AVFilterLink *outlink)
static int scale_d3d11_filter_frame(AVFilterLink *inlink, AVFrame *in)
#define OFFSET(x)