diff options
author | Haihao Xiang <haihao.xiang@intel.com> | 2023-01-09 15:12:10 +0800 |
---|---|---|
committer | Haihao Xiang <haihao.xiang@intel.com> | 2023-01-17 10:10:52 +0800 |
commit | 749154532008e5062ea58c74dff9a94a8e2f020c (patch) | |
tree | 31a7e1a697a17749d0de351850808365f1303c8f /libavfilter/vf_overlay_qsv.c | |
parent | 3763635ef40c59ce02e79efc0f117e1298a775d9 (diff) | |
download | ffmpeg-749154532008e5062ea58c74dff9a94a8e2f020c.tar.gz |
lavfi/qsv: use QSVVPPContext as base context in vf_vpp_qsv/vf_overlay_qsv
The same members between QSVVPPContext and VPPContext are removed from
VPPContext, and async_depth is moved from QSVVPPParam to QSVVPPContext
so that all QSV filters using QSVVPPContext may support async depth.
In addition, we may use QSVVPPContext as base context in other QSV
filters in the future so that we may re-use functions defined in
qsvvpp.c for other QSV filters.
This commit shouldn't change the functionality of vpp_qsv / overlay_qsv.
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Diffstat (limited to 'libavfilter/vf_overlay_qsv.c')
-rw-r--r-- | libavfilter/vf_overlay_qsv.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libavfilter/vf_overlay_qsv.c b/libavfilter/vf_overlay_qsv.c index 1a2c1b1e96..5bec7dd414 100644 --- a/libavfilter/vf_overlay_qsv.c +++ b/libavfilter/vf_overlay_qsv.c @@ -57,10 +57,9 @@ enum var_name { }; typedef struct QSVOverlayContext { - const AVClass *class; + QSVVPPContext qsv; FFFrameSync fs; - QSVVPPContext *qsv; QSVVPPParam qsv_param; mfxExtVPPComposite comp_conf; double var_values[VAR_VARS_NB]; @@ -230,14 +229,14 @@ static int config_overlay_input(AVFilterLink *inlink) static int process_frame(FFFrameSync *fs) { AVFilterContext *ctx = fs->parent; - QSVOverlayContext *s = fs->opaque; + QSVVPPContext *qsv = fs->opaque; AVFrame *frame = NULL; int ret = 0, i; for (i = 0; i < ctx->nb_inputs; i++) { ret = ff_framesync_get_frame(fs, i, &frame, 0); if (ret == 0) - ret = ff_qsvvpp_filter_frame(s->qsv, ctx->inputs[i], frame); + ret = ff_qsvvpp_filter_frame(qsv, ctx->inputs[i], frame); if (ret < 0 && ret != AVERROR(EAGAIN)) break; } @@ -301,7 +300,7 @@ static int config_output(AVFilterLink *outlink) if (ret < 0) return ret; - return ff_qsvvpp_create(ctx, &vpp->qsv, &vpp->qsv_param); + return ff_qsvvpp_init(ctx, &vpp->qsv_param); } /* @@ -350,7 +349,7 @@ static av_cold void overlay_qsv_uninit(AVFilterContext *ctx) { QSVOverlayContext *vpp = ctx->priv; - ff_qsvvpp_free(&vpp->qsv); + ff_qsvvpp_close(ctx); ff_framesync_uninit(&vpp->fs); av_freep(&vpp->comp_conf.InputStream); av_freep(&vpp->qsv_param.ext_buf); |