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
292292 if (err < 0)
293293 return err;
294294
295− ctx->fs.on_event = overlay_vaapi_blend;
296− ctx->fs.opaque = ctx;
295+ ctx->fs.on_event = overlay_vaapi_blend;
297296 ctx->fs.time_base = outlink->time_base;
298297
299298 return ff_framesync_configure(&ctx->fs);
@@ -321,6 +320,7 @@ static av_cold void overlay_vaapi_uninit(AVFilterContext *avctx) · 21 unmodified lines
321320 OverlayVAAPIContext *ctx = avctx->priv;
322321
323322 ff_framesync_uninit(&ctx->fs);
323+ ff_vaapi_vpp_ctx_uninit(avctx);
324324 }
325325
326326 #define OFFSET(x) offsetof(OverlayVAAPIContext, x)
@@ -331,10 +331,18 @@ static const AVOption overlay_vaapi_options[] = { · 4 unmodified lines
331331 { "w", "Overlay width", OFFSET(overlay_ow), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS },
332332 { "h", "Overlay height", OFFSET(overlay_oh), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS },
333333 { "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 },
334342 { NULL },
335343 };
336344
337−AVFILTER_DEFINE_CLASS(overlay_vaapi);
345+FRAMESYNC_DEFINE_CLASS(overlay_vaapi, OverlayVAAPIContext, fs);
338346
339347 static const AVFilterPad overlay_vaapi_inputs[] = {
340348 {
@@ -364,6 +372,7 @@ const AVFilter ff_vf_overlay_vaapi = { · 23 unmodified lines
364372 .init = &overlay_vaapi_init,
365373 .uninit = &overlay_vaapi_uninit,
366374 .activate = &overlay_vaapi_activate,
375+ .preinit = overlay_vaapi_framesync_preinit,
367376 FILTER_INPUTS(overlay_vaapi_inputs),
368377 FILTER_OUTPUTS(overlay_vaapi_outputs),
369378 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