History

avfilter/overlay_vaapi: add framesync options

softworkz committed 4 years ago

Commit 916447b1 parent db6b3761 file · +12 −3Browse files

Unified · Split

libavfilter/vf_overlay_vaapi.c+12−3
@@ -292,8 +292,7 @@ static int overlay_vaapi_config_output(AVFilterLink *outlink) · 291 unmodified lines
292 if (err < 0)292 if (err < 0)
293 return err;293 return err;
294 294
295 ctx->fs.on_event = overlay_vaapi_blend;295 ctx->fs.on_event = overlay_vaapi_blend;
296 ctx->fs.opaque = ctx;
297 ctx->fs.time_base = outlink->time_base;296 ctx->fs.time_base = outlink->time_base;
298 297
299 return ff_framesync_configure(&ctx->fs);298 return ff_framesync_configure(&ctx->fs);
@@ -321,6 +320,7 @@ static av_cold void overlay_vaapi_uninit(AVFilterContext *avctx) · 21 unmodified lines
321 OverlayVAAPIContext *ctx = avctx->priv;320 OverlayVAAPIContext *ctx = avctx->priv;
322 321
323 ff_framesync_uninit(&ctx->fs);322 ff_framesync_uninit(&ctx->fs);
323 ff_vaapi_vpp_ctx_uninit(avctx);
324}324}
325 325
326#define OFFSET(x) offsetof(OverlayVAAPIContext, x)326#define OFFSET(x) offsetof(OverlayVAAPIContext, x)
@@ -331,10 +331,18 @@ static const AVOption overlay_vaapi_options[] = { · 4 unmodified lines
331 { "w", "Overlay width", OFFSET(overlay_ow), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS },331 { "w", "Overlay width", OFFSET(overlay_ow), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS },
332 { "h", "Overlay height", OFFSET(overlay_oh), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS },332 { "h", "Overlay height", OFFSET(overlay_oh), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS },
333 { "alpha", "Overlay global alpha", OFFSET(alpha), AV_OPT_TYPE_FLOAT, { .dbl = 1.0 }, 0.0, 1.0, .flags = FLAGS },333 { "alpha", "Overlay global alpha", OFFSET(alpha), AV_OPT_TYPE_FLOAT, { .dbl = 1.0 }, 0.0, 1.0, .flags = FLAGS },
334 { "eof_action", "Action to take when encountering EOF from secondary input ",
335 OFFSET(fs.opt_eof_action), AV_OPT_TYPE_INT, { .i64 = EOF_ACTION_REPEAT },
336 EOF_ACTION_REPEAT, EOF_ACTION_PASS, .flags = FLAGS, "eof_action" },
337 { "repeat", "Repeat the previous frame.", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_REPEAT }, .flags = FLAGS, "eof_action" },
338 { "endall", "End both streams.", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_ENDALL }, .flags = FLAGS, "eof_action" },
339 { "pass", "Pass through the main input.", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_PASS }, .flags = FLAGS, "eof_action" },
340 { "shortest", "force termination when the shortest input terminates", OFFSET(fs.opt_shortest), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
341 { "repeatlast", "repeat overlay of the last overlay frame", OFFSET(fs.opt_repeatlast), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, FLAGS },
334 { NULL },342 { NULL },
335};343};
336 344
337AVFILTER_DEFINE_CLASS(overlay_vaapi);345FRAMESYNC_DEFINE_CLASS(overlay_vaapi, OverlayVAAPIContext, fs);
338 346
339static const AVFilterPad overlay_vaapi_inputs[] = {347static const AVFilterPad overlay_vaapi_inputs[] = {
340 {348 {
@@ -364,6 +372,7 @@ const AVFilter ff_vf_overlay_vaapi = { · 23 unmodified lines
364 .init = &overlay_vaapi_init,372 .init = &overlay_vaapi_init,
365 .uninit = &overlay_vaapi_uninit,373 .uninit = &overlay_vaapi_uninit,
366 .activate = &overlay_vaapi_activate,374 .activate = &overlay_vaapi_activate,
375 .preinit = overlay_vaapi_framesync_preinit,
367 FILTER_INPUTS(overlay_vaapi_inputs),376 FILTER_INPUTS(overlay_vaapi_inputs),
368 FILTER_OUTPUTS(overlay_vaapi_outputs),377 FILTER_OUTPUTS(overlay_vaapi_outputs),
369 FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VAAPI),378 FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VAAPI),

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t