History

lavfi/vf_hwupload: switch to query_func2()

Anton Khirnov committed 2 years ago

Commit 84825661 parent 03633621 file · +7 −6Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_hwupload.c+7−6
@@ -66,9 +66,11 @@ static int hwupload_init(AVFilterContext *avctx) · 65 unmodified lines
6666 return 0;
6767 }
6868
69−static int hwupload_query_formats(AVFilterContext *avctx)
69+static int hwupload_query_formats(const AVFilterContext *avctx,
70+ AVFilterFormatsConfig **cfg_in,
71+ AVFilterFormatsConfig **cfg_out)
7072 {
71− HWUploadContext *ctx = avctx->priv;
73+ const HWUploadContext *ctx = avctx->priv;
7274 AVHWFramesConstraints *constraints = NULL;
7375 const enum AVPixelFormat *input_pix_fmts, *output_pix_fmts;
7476 AVFilterFormats *input_formats = NULL;
@@ -96,16 +98,15 @@ static int hwupload_query_formats(AVFilterContext *avctx) · 21 unmodified lines
9698 }
9799 }
98100
99− if ((err = ff_formats_ref(input_formats, &avctx->inputs[0]->outcfg.formats)) < 0 ||
101+ if ((err = ff_formats_ref(input_formats, &cfg_in[0]->formats)) < 0 ||
100102 (err = ff_formats_ref(ff_make_format_list(output_pix_fmts),
101− &avctx->outputs[0]->incfg.formats)) < 0)
103+ &cfg_out[0]->formats)) < 0)
102104 goto fail;
103105
104106 av_hwframe_constraints_free(&constraints);
105107 return 0;
106108
107109 fail:
108− av_buffer_unref(&ctx->hwdevice_ref);
109110 av_hwframe_constraints_free(&constraints);
110111 return err;
111112 }
@@ -265,7 +266,7 @@ const AVFilter ff_vf_hwupload = { · 153 unmodified lines
265266 .priv_class = &hwupload_class,
266267 FILTER_INPUTS(hwupload_inputs),
267268 FILTER_OUTPUTS(hwupload_outputs),
268− FILTER_QUERY_FUNC(hwupload_query_formats),
269+ FILTER_QUERY_FUNC2(hwupload_query_formats),
269270 .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
270271 .flags = AVFILTER_FLAG_HWDEVICE,
271272 };

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