For now, hard-coded to 1 element.
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -136,7 +136,8 @@ typedef struct LibplaceboContext { · 135 unmodified lines | ||
| 136 | 136 | pl_tex tex[4]; |
| 137 | 137 | |
| 138 | 138 | /* input state */ |
| 139 | − LibplaceboInput input; | |
| 139 | + LibplaceboInput *inputs; | |
| 140 | + int nb_inputs; | |
| 140 | 141 | |
| 141 | 142 | /* settings */ |
| 142 | 143 | char *out_format_string; |
| @@ -660,7 +661,12 @@ static int init_vulkan(AVFilterContext *avctx, const AVVulkanDeviceContext *hwct · 517 unmodified lines | ||
| 660 | 661 | } |
| 661 | 662 | |
| 662 | 663 | /* Initialize inputs */ |
| 663 | − RET(input_init(avctx, avctx->inputs[0], &s->input)); | |
| 664 | + s->nb_inputs = 1; | |
| 665 | + s->inputs = av_calloc(s->nb_inputs, sizeof(*s->inputs)); | |
| 666 | + if (!s->inputs) | |
| 667 | + return AVERROR(ENOMEM); | |
| 668 | + for (int i = 0; i < s->nb_inputs; i++) | |
| 669 | + RET(input_init(avctx, avctx->inputs[i], &s->inputs[i])); | |
| 664 | 670 | |
| 665 | 671 | /* fall through */ |
| 666 | 672 | fail: |
| @@ -677,7 +683,11 @@ static void libplacebo_uninit(AVFilterContext *avctx) · 10 unmodified lines | ||
| 677 | 683 | pl_tex_destroy(s->gpu, &s->tex[i]); |
| 678 | 684 | for (int i = 0; i < s->num_hooks; i++) |
| 679 | 685 | pl_mpv_user_shader_destroy(&s->hooks[i]); |
| 680 | − input_uninit(&s->input); | |
| 686 | + if (s->inputs) { | |
| 687 | + for (int i = 0; i < s->nb_inputs; i++) | |
| 688 | + input_uninit(&s->inputs[i]); | |
| 689 | + av_freep(&s->inputs); | |
| 690 | + } | |
| 681 | 691 | pl_vulkan_destroy(&s->vulkan); |
| 682 | 692 | pl_log_destroy(&s->log); |
| 683 | 693 | ff_vk_uninit(&s->vkctx); |
| @@ -774,7 +784,7 @@ static int output_frame(AVFilterContext *ctx, int64_t pts) · 90 unmodified lines | ||
| 774 | 784 | { |
| 775 | 785 | int err = 0, ok, changed_csp; |
| 776 | 786 | LibplaceboContext *s = ctx->priv; |
| 777 | − LibplaceboInput *in = &s->input; | |
| 787 | + LibplaceboInput *in = &s->inputs[0]; | |
| 778 | 788 | AVFilterLink *outlink = ctx->outputs[0]; |
| 779 | 789 | const AVPixFmtDescriptor *outdesc = av_pix_fmt_desc_get(outlink->format); |
| 780 | 790 | const AVFrame *ref = ref_frame(&in->mix); |
| @@ -942,7 +952,7 @@ static int libplacebo_activate(AVFilterContext *ctx) · 161 unmodified lines | ||
| 942 | 952 | { |
| 943 | 953 | int ret; |
| 944 | 954 | LibplaceboContext *s = ctx->priv; |
| 945 | − LibplaceboInput *in = &s->input; | |
| 955 | + LibplaceboInput *in = &s->inputs[0]; | |
| 946 | 956 | AVFilterLink *outlink = ctx->outputs[0]; |
| 947 | 957 | int64_t pts; |
| 948 | 958 | |