static int vsink_query_formats(AVFilterContext *ctx)

{

    BufferSinkContext *buf = ctx->priv;

    AVFilterFormats *formats = NULL;

    unsigned i;

    int ret;



    if (buf->pixel_fmts_size % sizeof(*buf->pixel_fmts)) {

        av_log(ctx, AV_LOG_ERROR, "Invalid size for format list\n");

        return AVERROR(EINVAL);

    }



    if (buf->pixel_fmts_size) {

        for (i = 0; i < NB_ITEMS(buf->pixel_fmts); i++)

            if ((ret = ff_add_format(&formats, buf->pixel_fmts[i])) < 0)

                return ret;

        ff_set_common_formats(ctx, formats);

    } else {

        ff_default_query_formats(ctx);

    }



    return 0;

}

static int vsink_query_formats(AVFilterContext *ctx)

{

    BufferSinkContext *buf = ctx->priv;

    AVFilterFormats *formats = NULL;

    unsigned i;

    int ret;



    if (buf->pixel_fmts_size % sizeof(*buf->pixel_fmts)) {

        av_log(ctx, AV_LOG_ERROR, "Invalid size for format list\n");

        return AVERROR(EINVAL);

    }



    if (buf->pixel_fmts_size) {

        for (i = 0; i < NB_ITEMS(buf->pixel_fmts); i++)

            if ((ret = ff_add_format(&formats, buf->pixel_fmts[i])) < 0)

                return ret;

        ff_set_common_formats(ctx, formats);

    } else {

        ff_default_query_formats(ctx);

    }



    return 0;

}

static int FUNC_0(AVFilterContext *VAR_0)

{

    BufferSinkContext *buf = VAR_0->priv;

    AVFilterFormats *formats = NULL;

    unsigned VAR_1;

    int VAR_2;



    if (buf->pixel_fmts_size % sizeof(*buf->pixel_fmts)) {

        av_log(VAR_0, AV_LOG_ERROR, "Invalid size for format list\n");

        return AVERROR(EINVAL);

    }



    if (buf->pixel_fmts_size) {

        for (VAR_1 = 0; VAR_1 < NB_ITEMS(buf->pixel_fmts); VAR_1++)

            if ((VAR_2 = ff_add_format(&formats, buf->pixel_fmts[VAR_1])) < 0)

                return VAR_2;

        ff_set_common_formats(VAR_0, formats);

    } else {

        ff_default_query_formats(VAR_0);

    }



    return 0;

}

static int FUNC_0(AVFilterContext *VAR_0)
{ BufferSinkContext *buf = VAR_0->priv; AVFilterFormats *formats = NULL; unsigned VAR_1; int VAR_2; if (buf->pixel_fmts_size % sizeof(*buf->pixel_fmts)) { av_log(VAR_0, AV_LOG_ERROR, "Invalid size for format list\n"); return AVERROR(EINVAL); } if (buf->pixel_fmts_size) { for (VAR_1 = 0; VAR_1 < NB_ITEMS(buf->pixel_fmts); VAR_1++) if ((VAR_2 = ff_add_format(&formats, buf->pixel_fmts[VAR_1])) < 0)
return VAR_2; ff_set_common_formats(VAR_0, formats); } else { ff_default_query_formats(VAR_0); } return 0; }