[FFmpeg-cvslog] lavfi/vf_hwupload: switch to query_func2()
Anton Khirnov
git at videolan.org
Tue Oct 15 11:44:31 EEST 2024
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Mon Oct 7 16:02:15 2024 +0200| [848256677d5cc7bdf67f466e871df6c76ef46209] | committer: Anton Khirnov
lavfi/vf_hwupload: switch to query_func2()
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=848256677d5cc7bdf67f466e871df6c76ef46209
---
libavfilter/vf_hwupload.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/libavfilter/vf_hwupload.c b/libavfilter/vf_hwupload.c
index 70ee262c09..97d50d7877 100644
--- a/libavfilter/vf_hwupload.c
+++ b/libavfilter/vf_hwupload.c
@@ -66,9 +66,11 @@ static int hwupload_init(AVFilterContext *avctx)
return 0;
}
-static int hwupload_query_formats(AVFilterContext *avctx)
+static int hwupload_query_formats(const AVFilterContext *avctx,
+ AVFilterFormatsConfig **cfg_in,
+ AVFilterFormatsConfig **cfg_out)
{
- HWUploadContext *ctx = avctx->priv;
+ const HWUploadContext *ctx = avctx->priv;
AVHWFramesConstraints *constraints = NULL;
const enum AVPixelFormat *input_pix_fmts, *output_pix_fmts;
AVFilterFormats *input_formats = NULL;
@@ -96,16 +98,15 @@ static int hwupload_query_formats(AVFilterContext *avctx)
}
}
- if ((err = ff_formats_ref(input_formats, &avctx->inputs[0]->outcfg.formats)) < 0 ||
+ if ((err = ff_formats_ref(input_formats, &cfg_in[0]->formats)) < 0 ||
(err = ff_formats_ref(ff_make_format_list(output_pix_fmts),
- &avctx->outputs[0]->incfg.formats)) < 0)
+ &cfg_out[0]->formats)) < 0)
goto fail;
av_hwframe_constraints_free(&constraints);
return 0;
fail:
- av_buffer_unref(&ctx->hwdevice_ref);
av_hwframe_constraints_free(&constraints);
return err;
}
@@ -265,7 +266,7 @@ const AVFilter ff_vf_hwupload = {
.priv_class = &hwupload_class,
FILTER_INPUTS(hwupload_inputs),
FILTER_OUTPUTS(hwupload_outputs),
- FILTER_QUERY_FUNC(hwupload_query_formats),
+ FILTER_QUERY_FUNC2(hwupload_query_formats),
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
.flags = AVFILTER_FLAG_HWDEVICE,
};
More information about the ffmpeg-cvslog
mailing list