Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsoftworkz <softworkz@hotmail.com>2022-10-31 09:20:03 +0300
committerHaihao Xiang <haihao.xiang@intel.com>2022-11-07 05:56:44 +0300
commit916447bf4cbcbe174cf1b01f2fb9b07275e184ef (patch)
tree475747a9d645d75ee6cacb8653aaca29c883a3f5
parentdb6b376db9750f91f683bdec160c74c7e5618471 (diff)
avfilter/overlay_vaapi: add framesync options
Signed-off-by: softworkz <softworkz@hotmail.com>
-rw-r--r--libavfilter/vf_overlay_vaapi.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
index 71fc90a86b..f4f9cc58ec 100644
--- a/libavfilter/vf_overlay_vaapi.c
+++ b/libavfilter/vf_overlay_vaapi.c
@@ -292,8 +292,7 @@ static int overlay_vaapi_config_output(AVFilterLink *outlink)
if (err < 0)
return err;
- ctx->fs.on_event = overlay_vaapi_blend;
- ctx->fs.opaque = ctx;
+ ctx->fs.on_event = overlay_vaapi_blend;
ctx->fs.time_base = outlink->time_base;
return ff_framesync_configure(&ctx->fs);
@@ -321,6 +320,7 @@ static av_cold void overlay_vaapi_uninit(AVFilterContext *avctx)
OverlayVAAPIContext *ctx = avctx->priv;
ff_framesync_uninit(&ctx->fs);
+ ff_vaapi_vpp_ctx_uninit(avctx);
}
#define OFFSET(x) offsetof(OverlayVAAPIContext, x)
@@ -331,10 +331,18 @@ static const AVOption overlay_vaapi_options[] = {
{ "w", "Overlay width", OFFSET(overlay_ow), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS },
{ "h", "Overlay height", OFFSET(overlay_oh), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS },
{ "alpha", "Overlay global alpha", OFFSET(alpha), AV_OPT_TYPE_FLOAT, { .dbl = 1.0 }, 0.0, 1.0, .flags = FLAGS },
+ { "eof_action", "Action to take when encountering EOF from secondary input ",
+ OFFSET(fs.opt_eof_action), AV_OPT_TYPE_INT, { .i64 = EOF_ACTION_REPEAT },
+ EOF_ACTION_REPEAT, EOF_ACTION_PASS, .flags = FLAGS, "eof_action" },
+ { "repeat", "Repeat the previous frame.", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_REPEAT }, .flags = FLAGS, "eof_action" },
+ { "endall", "End both streams.", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_ENDALL }, .flags = FLAGS, "eof_action" },
+ { "pass", "Pass through the main input.", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_PASS }, .flags = FLAGS, "eof_action" },
+ { "shortest", "force termination when the shortest input terminates", OFFSET(fs.opt_shortest), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
+ { "repeatlast", "repeat overlay of the last overlay frame", OFFSET(fs.opt_repeatlast), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, FLAGS },
{ NULL },
};
-AVFILTER_DEFINE_CLASS(overlay_vaapi);
+FRAMESYNC_DEFINE_CLASS(overlay_vaapi, OverlayVAAPIContext, fs);
static const AVFilterPad overlay_vaapi_inputs[] = {
{
@@ -364,6 +372,7 @@ const AVFilter ff_vf_overlay_vaapi = {
.init = &overlay_vaapi_init,
.uninit = &overlay_vaapi_uninit,
.activate = &overlay_vaapi_activate,
+ .preinit = overlay_vaapi_framesync_preinit,
FILTER_INPUTS(overlay_vaapi_inputs),
FILTER_OUTPUTS(overlay_vaapi_outputs),
FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VAAPI),