FFmpeg
Loading...
Searching...
No Matches
vf_overlay_qsv.c
Go to the documentation of this file.
1/*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19/**
20 * @file
21 * A hardware accelerated overlay filter based on Intel Quick Sync Video VPP
22 */
23
24#include "libavutil/mem.h"
25#include "libavutil/opt.h"
26#include "libavutil/common.h"
27#include "libavutil/pixdesc.h"
28#include "libavutil/eval.h"
29#include "libavutil/hwcontext.h"
31
32#include "filters.h"
33#include "avfilter.h"
34#include "formats.h"
35
36#include "framesync.h"
37#include "qsvvpp.h"
38
39#define MAIN 0
40#define OVERLAY 1
41
42#define OFFSET(x) offsetof(QSVOverlayContext, x)
43#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM)
44
56
69
70static const char *const var_names[] = {
71 "main_w", "W", /* input width of the main layer */
72 "main_h", "H", /* input height of the main layer */
73 "overlay_iw", /* input width of the overlay layer */
74 "overlay_ih", /* input height of the overlay layer */
75 "overlay_x", "x", /* x position of the overlay layer inside of main */
76 "overlay_y", "y", /* y position of the overlay layer inside of main */
77 "overlay_w", "w", /* output width of overlay layer */
78 "overlay_h", "h", /* output height of overlay layer */
79 NULL
80};
81
82static const AVOption overlay_qsv_options[] = {
83 { "x", "Overlay x position", OFFSET(overlay_ox), AV_OPT_TYPE_STRING, { .str="0"}, 0, 255, .flags = FLAGS},
84 { "y", "Overlay y position", OFFSET(overlay_oy), AV_OPT_TYPE_STRING, { .str="0"}, 0, 255, .flags = FLAGS},
85 { "w", "Overlay width", OFFSET(overlay_ow), AV_OPT_TYPE_STRING, { .str="overlay_iw"}, 0, 255, .flags = FLAGS},
86 { "h", "Overlay height", OFFSET(overlay_oh), AV_OPT_TYPE_STRING, { .str="overlay_ih*w/overlay_iw"}, 0, 255, .flags = FLAGS},
87 { "alpha", "Overlay global alpha", OFFSET(overlay_alpha), AV_OPT_TYPE_INT, { .i64 = 255}, 0, 255, .flags = FLAGS},
88 { "eof_action", "Action to take when encountering EOF from secondary input ",
89 OFFSET(fs.opt_eof_action), AV_OPT_TYPE_INT, { .i64 = EOF_ACTION_REPEAT },
90 EOF_ACTION_REPEAT, EOF_ACTION_PASS, .flags = FLAGS, .unit = "eof_action" },
91 { "repeat", "Repeat the previous frame.", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_REPEAT }, .flags = FLAGS, .unit = "eof_action" },
92 { "endall", "End both streams.", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_ENDALL }, .flags = FLAGS, .unit = "eof_action" },
93 { "pass", "Pass through the main input.", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_PASS }, .flags = FLAGS, .unit = "eof_action" },
94 { "shortest", "force termination when the shortest input terminates", OFFSET(fs.opt_shortest), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
95 { "repeatlast", "repeat overlay of the last overlay frame", OFFSET(fs.opt_repeatlast), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
96 { NULL }
97};
98
100
102{
103 QSVOverlayContext *vpp = ctx->priv;
104 double *var_values = vpp->var_values;
105 int ret = 0;
106 AVExpr *ox_expr = NULL, *oy_expr = NULL;
107 AVExpr *ow_expr = NULL, *oh_expr = NULL;
108
109#define PASS_EXPR(e, s) {\
110 ret = av_expr_parse(&e, s, var_names, NULL, NULL, NULL, NULL, 0, ctx); \
111 if (ret < 0) {\
112 av_log(ctx, AV_LOG_ERROR, "Error when passing '%s'.\n", s);\
113 goto release;\
114 }\
115}
116 PASS_EXPR(ox_expr, vpp->overlay_ox);
117 PASS_EXPR(oy_expr, vpp->overlay_oy);
118 PASS_EXPR(ow_expr, vpp->overlay_ow);
119 PASS_EXPR(oh_expr, vpp->overlay_oh);
120#undef PASS_EXPR
121
122 var_values[VAR_OVERLAY_W] =
123 var_values[VAR_OW] = av_expr_eval(ow_expr, var_values, NULL);
124 var_values[VAR_OVERLAY_H] =
125 var_values[VAR_OH] = av_expr_eval(oh_expr, var_values, NULL);
126
127 /* calc again in case ow is relative to oh */
128 var_values[VAR_OVERLAY_W] =
129 var_values[VAR_OW] = av_expr_eval(ow_expr, var_values, NULL);
130
131 var_values[VAR_OVERLAY_X] =
132 var_values[VAR_OX] = av_expr_eval(ox_expr, var_values, NULL);
133 var_values[VAR_OVERLAY_Y] =
134 var_values[VAR_OY] = av_expr_eval(oy_expr, var_values, NULL);
135
136 /* calc again in case ox is relative to oy */
137 var_values[VAR_OVERLAY_X] =
138 var_values[VAR_OX] = av_expr_eval(ox_expr, var_values, NULL);
139
140 /* calc overlay_w and overlay_h again in case relative to ox,oy */
141 var_values[VAR_OVERLAY_W] =
142 var_values[VAR_OW] = av_expr_eval(ow_expr, var_values, NULL);
143 var_values[VAR_OVERLAY_H] =
144 var_values[VAR_OH] = av_expr_eval(oh_expr, var_values, NULL);
145 var_values[VAR_OVERLAY_W] =
146 var_values[VAR_OW] = av_expr_eval(ow_expr, var_values, NULL);
147
148release:
149 av_expr_free(ox_expr);
150 av_expr_free(oy_expr);
151 av_expr_free(ow_expr);
152 av_expr_free(oh_expr);
153
154 return ret;
155}
156
158{
159 FilterLink *l = ff_filter_link(link);
160 enum AVPixelFormat pix_fmt = link->format;
162 AVHWFramesContext *fctx;
163
164 if (link->format == AV_PIX_FMT_QSV) {
166 pix_fmt = fctx->sw_format;
167 }
168
170 if (!desc)
171 return 0;
172
173 return !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA);
174}
175
177{
178 AVFilterContext *ctx = inlink->dst;
179 QSVOverlayContext *vpp = ctx->priv;
180 mfxVPPCompInputStream *st = &vpp->comp_conf.InputStream[0];
181
182 av_log(ctx, AV_LOG_DEBUG, "Input[%d] is of %s.\n", FF_INLINK_IDX(inlink),
183 av_get_pix_fmt_name(inlink->format));
184
185 vpp->var_values[VAR_MAIN_iW] =
186 vpp->var_values[VAR_MW] = inlink->w;
187 vpp->var_values[VAR_MAIN_iH] =
188 vpp->var_values[VAR_MH] = inlink->h;
189
190 st->DstX = 0;
191 st->DstY = 0;
192 st->DstW = inlink->w;
193 st->DstH = inlink->h;
194 st->GlobalAlphaEnable = 0;
195 st->PixelAlphaEnable = 0;
196
197 return 0;
198}
199
201{
202 AVFilterContext *ctx = inlink->dst;
203 QSVOverlayContext *vpp = ctx->priv;
204 mfxVPPCompInputStream *st = &vpp->comp_conf.InputStream[1];
205 int ret = 0;
206
207 av_log(ctx, AV_LOG_DEBUG, "Input[%d] is of %s.\n", FF_INLINK_IDX(inlink),
208 av_get_pix_fmt_name(inlink->format));
209
210 vpp->var_values[VAR_OVERLAY_iW] = inlink->w;
211 vpp->var_values[VAR_OVERLAY_iH] = inlink->h;
212
213 ret = eval_expr(ctx);
214 if (ret < 0)
215 return ret;
216
217 st->DstX = vpp->var_values[VAR_OX];
218 st->DstY = vpp->var_values[VAR_OY];
219 st->DstW = vpp->var_values[VAR_OW];
220 st->DstH = vpp->var_values[VAR_OH];
221 st->GlobalAlpha = vpp->overlay_alpha;
222 st->GlobalAlphaEnable = (st->GlobalAlpha < 255);
223 st->PixelAlphaEnable = have_alpha_planar(inlink);
224
225 return 0;
226}
227
229{
230 AVFilterContext *ctx = fs->parent;
231 QSVVPPContext *qsv = fs->opaque;
232 AVFrame *frame = NULL, *propref = NULL;
233 int ret = 0, i;
234
235 for (i = 0; i < ctx->nb_inputs; i++) {
236 ret = ff_framesync_get_frame(fs, i, &frame, 0);
237 if (ret == 0) {
238 if (i == 0)
239 propref = frame;
240 ret = ff_qsvvpp_filter_frame(qsv, ctx->inputs[i], frame, propref);
241 }
242 if (ret < 0 && ret != AVERROR(EAGAIN))
243 break;
244 }
245
246 return ret;
247}
248
250{
251 QSVOverlayContext *s = ctx->priv;
252 int ret, i;
253
254 s->fs.on_event = process_frame;
255 s->fs.opaque = s;
256 ret = ff_framesync_init(&s->fs, ctx, ctx->nb_inputs);
257 if (ret < 0)
258 return ret;
259
260 for (i = 0; i < ctx->nb_inputs; i++) {
261 FFFrameSyncIn *in = &s->fs.in[i];
262 in->before = EXT_STOP;
263 in->after = EXT_INFINITY;
264 in->sync = i ? 1 : 2;
265 in->time_base = ctx->inputs[i]->time_base;
266 }
267
268 return ff_framesync_configure(&s->fs);
269}
270
271static int config_output(AVFilterLink *outlink)
272{
273 AVFilterContext *ctx = outlink->src;
274 QSVOverlayContext *vpp = ctx->priv;
275 AVFilterLink *in0 = ctx->inputs[0];
276 AVFilterLink *in1 = ctx->inputs[1];
277 FilterLink *l0 = ff_filter_link(in0);
278 FilterLink *l1 = ff_filter_link(in1);
279 FilterLink *ol = ff_filter_link(outlink);
280 int ret;
281
282 av_log(ctx, AV_LOG_DEBUG, "Output is of %s.\n", av_get_pix_fmt_name(outlink->format));
283 vpp->qsv_param.out_sw_format = in0->format;
284 if ((in0->format == AV_PIX_FMT_QSV && in1->format != AV_PIX_FMT_QSV) ||
285 (in0->format != AV_PIX_FMT_QSV && in1->format == AV_PIX_FMT_QSV)) {
286 av_log(ctx, AV_LOG_ERROR, "Mixing hardware and software pixel formats is not supported.\n");
287 return AVERROR(EINVAL);
288 } else if (in0->format == AV_PIX_FMT_QSV) {
291
292 if (hw_frame0->device_ctx != hw_frame1->device_ctx) {
293 av_log(ctx, AV_LOG_ERROR, "Inputs with different underlying QSV devices are forbidden.\n");
294 return AVERROR(EINVAL);
295 }
296 vpp->qsv_param.out_sw_format = hw_frame0->sw_format;
297 }
298
299 outlink->w = vpp->var_values[VAR_MW];
300 outlink->h = vpp->var_values[VAR_MH];
301 ol->frame_rate = l0->frame_rate;
302 outlink->time_base = av_inv_q(ol->frame_rate);
303
304 ret = init_framesync(ctx);
305 if (ret < 0)
306 return ret;
307
308 return ff_qsvvpp_init(ctx, &vpp->qsv_param);
309}
310
311/*
312 * Callback for qsvvpp
313 * @Note: qsvvpp composition does not generate PTS for result frame.
314 * so we assign the PTS from framesync to the output frame.
315 */
316
318{
319 QSVOverlayContext *s = outlink->src->priv;
320 frame->pts = av_rescale_q(s->fs.pts,
321 s->fs.time_base, outlink->time_base);
322 return ff_filter_frame(outlink, frame);
323}
324
325
327{
328 QSVOverlayContext *vpp = ctx->priv;
329
330 /* fill composite config */
331 vpp->comp_conf.Header.BufferId = MFX_EXTBUFF_VPP_COMPOSITE;
332 vpp->comp_conf.Header.BufferSz = sizeof(vpp->comp_conf);
333 vpp->comp_conf.NumInputStream = ctx->nb_inputs;
334 vpp->comp_conf.InputStream = av_calloc(ctx->nb_inputs,
335 sizeof(*vpp->comp_conf.InputStream));
336 if (!vpp->comp_conf.InputStream)
337 return AVERROR(ENOMEM);
338
339 /* initialize QSVVPP params */
341 vpp->qsv_param.ext_buf = av_mallocz(sizeof(*vpp->qsv_param.ext_buf));
342 if (!vpp->qsv_param.ext_buf)
343 return AVERROR(ENOMEM);
344
345 vpp->qsv_param.ext_buf[0] = (mfxExtBuffer *)&vpp->comp_conf;
346 vpp->qsv_param.num_ext_buf = 1;
348 vpp->qsv_param.num_crop = 0;
349
350 return 0;
351}
352
354{
355 QSVOverlayContext *vpp = ctx->priv;
356
358 ff_framesync_uninit(&vpp->fs);
359 av_freep(&vpp->comp_conf.InputStream);
361}
362
364{
365 QSVOverlayContext *s = ctx->priv;
366 return ff_framesync_activate(&s->fs);
367}
368
370 AVFilterFormatsConfig **cfg_in,
371 AVFilterFormatsConfig **cfg_out)
372{
373 int i;
374 int ret;
375
376 static const enum AVPixelFormat main_in_fmts[] = {
383 };
384 static const enum AVPixelFormat out_pix_fmts[] = {
388 };
389
390 for (i = 0; i < ctx->nb_inputs; i++) {
391 ret = ff_formats_ref(ff_make_pixel_format_list(main_in_fmts), &cfg_in[i]->formats);
392 if (ret < 0)
393 return ret;
394 }
395
397 if (ret < 0)
398 return ret;
399
400 return 0;
401}
402
404 {
405 .name = "main",
406 .type = AVMEDIA_TYPE_VIDEO,
407 .config_props = config_main_input,
408 .get_buffer.video = ff_qsvvpp_get_video_buffer,
409 },
410 {
411 .name = "overlay",
412 .type = AVMEDIA_TYPE_VIDEO,
413 .config_props = config_overlay_input,
414 .get_buffer.video = ff_qsvvpp_get_video_buffer,
415 },
416};
417
419 {
420 .name = "default",
421 .type = AVMEDIA_TYPE_VIDEO,
422 .config_props = config_output,
423 },
424};
425
427 .p.name = "overlay_qsv",
428 .p.description = NULL_IF_CONFIG_SMALL("Quick Sync Video overlay."),
429 .p.priv_class = &overlay_qsv_class,
430 .p.flags = AVFILTER_FLAG_HWDEVICE,
431 .priv_size = sizeof(QSVOverlayContext),
432 .preinit = overlay_qsv_framesync_preinit,
439 .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
440};
const FFFilter ff_vf_overlay_qsv
static AVFormatContext * ctx
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition avfilter.c:1068
Main libavfilter public API header.
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define s(width, name)
Definition cbs_vp9.c:198
#define fs(width, name, subs,...)
Definition cbs_vp9.c:200
#define FLAGS
Definition cmdutils.c:598
common internal and external API header
#define NULL
Definition coverity.c:32
static enum AVPixelFormat pix_fmt
static AVFrame * frame
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
void av_expr_free(AVExpr *e)
Free a parsed expression previously created with av_expr_parse().
Definition eval.c:368
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
Evaluate a previously parsed expression.
Definition eval.c:824
simple arithmetic expression evaluator
static av_always_inline int process_frame(AVTextFormatContext *tfc, InputFile *ifile, AVFrame *frame, const AVPacket *pkt, int *packet_new)
Definition ffprobe.c:1596
int ff_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)
Add ref as a new reference to formats.
Definition formats.c:756
av_warn_unused_result AVFilterFormats * ff_make_pixel_format_list(const enum AVPixelFormat *fmts)
Create a list of supported pixel formats.
int ff_framesync_configure(FFFrameSync *fs)
Configure a frame sync structure.
Definition framesync.c:137
int ff_framesync_activate(FFFrameSync *fs)
Examine the frames in the filter's input and try to produce output.
Definition framesync.c:352
int ff_framesync_get_frame(FFFrameSync *fs, unsigned in, AVFrame **rframe, unsigned get)
Get the current frame in an input.
Definition framesync.c:269
void ff_framesync_uninit(FFFrameSync *fs)
Free all memory currently allocated.
Definition framesync.c:301
int ff_framesync_init(FFFrameSync *fs, AVFilterContext *parent, unsigned nb_in)
Initialize a frame sync structure.
Definition framesync.c:86
#define FRAMESYNC_DEFINE_CLASS(name, context, field)
Definition framesync.h:352
@ EOF_ACTION_REPEAT
Definition framesync.h:27
@ EXT_INFINITY
Extend the frame to infinity.
Definition framesync.h:75
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition opt.h:326
@ 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
#define AVERROR(e)
Definition error.h:45
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition log.h:231
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
Definition rational.h:159
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static av_cold void uninit(AVBitStreamFilterContext *ctx)
static int activate(AVBitStreamFilterContext *ctx)
static int config_output(AVBitStreamFilterLink *outlink)
#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 FF_INLINK_IDX(link)
Find the index of a link.
Definition filters.h:215
#define FILTER_QUERY_FUNC2(func)
Definition filters.h:241
#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
const char * desc
Definition libsvtav1.c:83
void * av_calloc(size_t nmemb, size_t size)
Definition mem.c:264
Memory handling functions.
var_name
Definition noise.c:46
@ VAR_VARS_NB
Definition noise.c:59
static const char *const var_names[]
Definition noise.c:30
AVOptions.
@ EOF_ACTION_PASS
Definition packetsync.h:31
@ EOF_ACTION_ENDALL
Definition packetsync.h:30
@ EXT_STOP
Completely stop all streams with this one.
Definition packetsync.h:62
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
Definition pixdesc.c:3380
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition pixdesc.c:3460
#define AV_PIX_FMT_FLAG_ALPHA
The pixel format has an alpha channel.
Definition pixdesc.h:147
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_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition pixfmt.h:73
@ AV_PIX_FMT_YUYV422
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
Definition pixfmt.h:74
@ AV_PIX_FMT_QSV
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
Definition pixfmt.h:247
#define AV_PIX_FMT_RGB32
Definition pixfmt.h:517
AVFrame * ff_qsvvpp_get_video_buffer(AVFilterLink *inlink, int w, int h)
Definition qsvvpp.c:1141
int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picref, AVFrame *propref)
Definition qsvvpp.c:959
int ff_qsvvpp_close(AVFilterContext *avctx)
Definition qsvvpp.c:935
int ff_qsvvpp_init(AVFilterContext *avctx, QSVVPPParam *param)
Definition qsvvpp.c:743
Intel Quick Sync Video VPP base function.
@ VAR_OH
Definition scale_eval.c:47
@ VAR_OW
Definition scale_eval.c:46
formats
Definition signature.h:47
static av_cold int preinit(AVBitStreamFilterContext *ctx)
Definition source.c:137
uint8_t * data
The data buffer.
Definition buffer.h:90
Definition eval.c:171
An instance of a filter.
Definition avfilter.h:273
void * priv
private data for use by the filter
Definition avfilter.h:288
Lists of formats / etc.
Definition avfilter.h:120
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
This struct describes a set or pool of "hardware" frames (i.e.
Definition hwcontext.h:118
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
Definition hwcontext.h:213
AVHWDeviceContext * device_ctx
The parent AVHWDeviceContext.
Definition hwcontext.h:137
AVOption.
Definition opt.h:428
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition pixdesc.h:69
Input stream structure.
Definition framesync.h:102
enum FFFrameSyncExtMode after
Extrapolation mode for timestamps after the last frame.
Definition framesync.h:112
enum FFFrameSyncExtMode before
Extrapolation mode for timestamps before the first frame.
Definition framesync.h:107
AVRational time_base
Time base for the incoming frames.
Definition framesync.h:117
unsigned sync
Synchronization level: frames on input at the highest sync level will generate output frame events.
Definition framesync.h:160
Frame sync structure.
Definition framesync.h:168
uint16_t overlay_pixel_alpha
QSVVPPContext qsv
QSVVPPParam qsv_param
double var_values[VAR_VARS_NB]
mfxExtVPPComposite comp_conf
int num_crop
Definition qsvvpp.h:123
mfxExtBuffer ** ext_buf
Definition qsvvpp.h:117
int(* filter_frame)(AVFilterLink *outlink, AVFrame *frame)
Definition qsvvpp.h:112
enum AVPixelFormat out_sw_format
Definition qsvvpp.h:120
int num_ext_buf
Definition qsvvpp.h:116
#define av_mallocz(s)
#define av_freep(p)
#define av_log(a,...)
static enum AVPixelFormat out_pix_fmts[]
@ VAR_OVERLAY_H
Definition vf_overlay.h:31
@ VAR_MW
Definition vf_overlay.h:28
@ VAR_MH
Definition vf_overlay.h:29
@ VAR_OVERLAY_W
Definition vf_overlay.h:30
@ VAR_MAIN_iW
@ VAR_MAIN_iH
@ VAR_OVERLAY_iW
@ VAR_OVERLAY_Y
@ VAR_VARS_NB
@ VAR_OY
@ VAR_OVERLAY_X
@ VAR_OVERLAY_iH
@ VAR_OX
static int overlay_qsv_init(AVFilterContext *ctx)
static av_cold void overlay_qsv_uninit(AVFilterContext *ctx)
static const AVOption overlay_qsv_options[]
static int init_framesync(AVFilterContext *ctx)
static const AVFilterPad overlay_qsv_outputs[]
static const AVFilterPad overlay_qsv_inputs[]
#define PASS_EXPR(e, s)
static int eval_expr(AVFilterContext *ctx)
static int activate(AVFilterContext *ctx)
#define OFFSET(x)
static int config_output(AVFilterLink *outlink)
static int overlay_qsv_query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static int have_alpha_planar(AVFilterLink *link)
static int filter_callback(AVFilterLink *outlink, AVFrame *frame)
static int config_overlay_input(AVFilterLink *inlink)
static int config_main_input(AVFilterLink *inlink)
static int process_frame(FFFrameSync *fs)