static int query_formats(AVFilterContext *ctx)
{
    AVFilterLink *inlink  = ctx->inputs[0];
    AVFilterLink *outlink = ctx->outputs[0];
    AVFilterFormats        *in_formats      = ff_all_formats(AVMEDIA_TYPE_AUDIO);
    AVFilterFormats        *out_formats     = ff_all_formats(AVMEDIA_TYPE_AUDIO);
    AVFilterFormats        *in_samplerates  = ff_all_samplerates();
    AVFilterFormats        *out_samplerates = ff_all_samplerates();
    AVFilterChannelLayouts *in_layouts      = ff_all_channel_layouts();
    AVFilterChannelLayouts *out_layouts     = ff_all_channel_layouts();
    ff_formats_ref(in_formats,  &inlink->out_formats);
    ff_formats_ref(out_formats, &outlink->in_formats);
    ff_formats_ref(in_samplerates,  &inlink->out_samplerates);
    ff_formats_ref(out_samplerates, &outlink->in_samplerates);
    ff_channel_layouts_ref(in_layouts,  &inlink->out_channel_layouts);
    ff_channel_layouts_ref(out_layouts, &outlink->in_channel_layouts);
    return 0;
}
['static int query_formats(AVFilterContext *ctx)\n{\n    AVFilterLink *inlink  = ctx->inputs[0];\n    AVFilterLink *outlink = ctx->outputs[0];\n    AVFilterFormats        *in_formats      = ff_all_formats(AVMEDIA_TYPE_AUDIO);\n    AVFilterFormats        *out_formats     = ff_all_formats(AVMEDIA_TYPE_AUDIO);\n    AVFilterFormats        *in_samplerates  = ff_all_samplerates();\n    AVFilterFormats        *out_samplerates = ff_all_samplerates();\n    AVFilterChannelLayouts *in_layouts      = ff_all_channel_layouts();\n    AVFilterChannelLayouts *out_layouts     = ff_all_channel_layouts();\n    ff_formats_ref(in_formats,  &inlink->out_formats);\n    ff_formats_ref(out_formats, &outlink->in_formats);\n    ff_formats_ref(in_samplerates,  &inlink->out_samplerates);\n    ff_formats_ref(out_samplerates, &outlink->in_samplerates);\n    ff_channel_layouts_ref(in_layouts,  &inlink->out_channel_layouts);\n    ff_channel_layouts_ref(out_layouts, &outlink->in_channel_layouts);\n    return 0;\n}', 'AVFilterFormats *ff_all_formats(enum AVMediaType type)\n{\n    AVFilterFormats *ret = NULL;\n    if (type == AVMEDIA_TYPE_VIDEO) {\n        const AVPixFmtDescriptor *desc = NULL;\n        while ((desc = av_pix_fmt_desc_next(desc))) {\n            ff_add_format(&ret, av_pix_fmt_desc_get_id(desc));\n        }\n    } else if (type == AVMEDIA_TYPE_AUDIO) {\n        enum AVSampleFormat fmt = 0;\n        while (av_get_sample_fmt_name(fmt)) {\n            ff_add_format(&ret, fmt);\n            fmt++;\n        }\n    }\n    return ret;\n}', 'const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)\n{\n    if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)\n        return NULL;\n    return sample_fmt_info[sample_fmt].name;\n}', 'void ff_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)\n{\n    FORMATS_REF(f, ref);\n}']