Unified · Split
| @@ -66,9 +66,11 @@ static int hwupload_init(AVFilterContext *avctx) · 65 unmodified lines | |||
| 66 | return 0; | 66 | return 0; |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 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) | ||
| 70 | { | 72 | { |
| 71 | HWUploadContext *ctx = avctx->priv; | 73 | const HWUploadContext *ctx = avctx->priv; |
| 72 | AVHWFramesConstraints *constraints = NULL; | 74 | AVHWFramesConstraints *constraints = NULL; |
| 73 | const enum AVPixelFormat *input_pix_fmts, *output_pix_fmts; | 75 | const enum AVPixelFormat *input_pix_fmts, *output_pix_fmts; |
| 74 | AVFilterFormats *input_formats = NULL; | 76 | AVFilterFormats *input_formats = NULL; |
| @@ -96,16 +98,15 @@ static int hwupload_query_formats(AVFilterContext *avctx) · 21 unmodified lines | |||
| 96 | } | 98 | } |
| 97 | } | 99 | } |
| 98 | 100 | ||
| 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 || |
| 100 | (err = ff_formats_ref(ff_make_format_list(output_pix_fmts), | 102 | (err = ff_formats_ref(ff_make_format_list(output_pix_fmts), |
| 101 | &avctx->outputs[0]->incfg.formats)) < 0) | 103 | &cfg_out[0]->formats)) < 0) |
| 102 | goto fail; | 104 | goto fail; |
| 103 | 105 | ||
| 104 | av_hwframe_constraints_free(&constraints); | 106 | av_hwframe_constraints_free(&constraints); |
| 105 | return 0; | 107 | return 0; |
| 106 | 108 | ||
| 107 | fail: | 109 | fail: |
| 108 | av_buffer_unref(&ctx->hwdevice_ref); | ||
| 109 | av_hwframe_constraints_free(&constraints); | 110 | av_hwframe_constraints_free(&constraints); |
| 110 | return err; | 111 | return err; |
| 111 | } | 112 | } |
| @@ -265,7 +266,7 @@ const AVFilter ff_vf_hwupload = { · 153 unmodified lines | |||
| 265 | .priv_class = &hwupload_class, | 266 | .priv_class = &hwupload_class, |
| 266 | FILTER_INPUTS(hwupload_inputs), | 267 | FILTER_INPUTS(hwupload_inputs), |
| 267 | FILTER_OUTPUTS(hwupload_outputs), | 268 | FILTER_OUTPUTS(hwupload_outputs), |
| 268 | FILTER_QUERY_FUNC(hwupload_query_formats), | 269 | FILTER_QUERY_FUNC2(hwupload_query_formats), |
| 269 | .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, | 270 | .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, |
| 270 | .flags = AVFILTER_FLAG_HWDEVICE, | 271 | .flags = AVFILTER_FLAG_HWDEVICE, |
| 271 | }; | 272 | }; |