AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
{
    AVFilterBufferRef *ret = NULL;
    av_unused char buf[16];
    FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0);
    av_dlog(NULL, " perms:%s w:%d h:%d\n", ff_get_ref_perms_string(buf, sizeof(buf), perms), w, h);
    if (link->dstpad->get_video_buffer)
        ret = link->dstpad->get_video_buffer(link, perms, w, h);
    if (!ret)
        ret = avfilter_default_get_video_buffer(link, perms, w, h);
    if (ret)
        ret->type = AVMEDIA_TYPE_VIDEO;
    FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " returning "); ff_dlog_ref(NULL, ret, 1);
    return ret;
}
['AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)\n{\n    AVFilterBufferRef *ret = NULL;\n    av_unused char buf[16];\n    FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0);\n    av_dlog(NULL, " perms:%s w:%d h:%d\\n", ff_get_ref_perms_string(buf, sizeof(buf), perms), w, h);\n    if (link->dstpad->get_video_buffer)\n        ret = link->dstpad->get_video_buffer(link, perms, w, h);\n    if (!ret)\n        ret = avfilter_default_get_video_buffer(link, perms, w, h);\n    if (ret)\n        ret->type = AVMEDIA_TYPE_VIDEO;\n    FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " returning "); ff_dlog_ref(NULL, ret, 1);\n    return ret;\n}', 'static void ff_dlog_link(void *ctx, AVFilterLink *link, int end)\n{\n    if (link->type == AVMEDIA_TYPE_VIDEO) {\n        av_dlog(ctx,\n                "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s",\n                link, link->w, link->h,\n                av_pix_fmt_descriptors[link->format].name,\n                link->src ? link->src->filter->name : "",\n                link->dst ? link->dst->filter->name : "",\n                end ? "\\n" : "");\n    } else {\n        char buf[128];\n        av_get_channel_layout_string(buf, sizeof(buf), -1, link->channel_layout);\n        av_dlog(ctx,\n                "link[%p r:%"PRId64" cl:%s fmt:%-16s %-16s->%-16s]%s",\n                link, link->sample_rate, buf,\n                av_get_sample_fmt_name(link->format),\n                link->src ? link->src->filter->name : "",\n                link->dst ? link->dst->filter->name : "",\n                end ? "\\n" : "");\n    }\n}', 'static void ff_dlog_ref(void *ctx, AVFilterBufferRef *ref, int end)\n{\n    av_unused char buf[16];\n    av_dlog(ctx,\n            "ref[%p buf:%p refcount:%d perms:%s data:%p linesize[%d, %d, %d, %d] pts:%"PRId64" pos:%"PRId64,\n            ref, ref->buf, ref->buf->refcount, ff_get_ref_perms_string(buf, sizeof(buf), ref->perms), ref->data[0],\n            ref->linesize[0], ref->linesize[1], ref->linesize[2], ref->linesize[3],\n            ref->pts, ref->pos);\n    if (ref->video) {\n        av_dlog(ctx, " a:%d/%d s:%dx%d i:%c iskey:%d type:%c",\n                ref->video->pixel_aspect.num, ref->video->pixel_aspect.den,\n                ref->video->w, ref->video->h,\n                !ref->video->interlaced     ? \'P\' :\n                ref->video->top_field_first ? \'T\' : \'B\',\n                ref->video->key_frame,\n                av_get_picture_type_char(ref->video->pict_type));\n    }\n    if (ref->audio) {\n        av_dlog(ctx, " cl:%"PRId64"d sn:%d s:%d sr:%d p:%d",\n                ref->audio->channel_layout,\n                ref->audio->nb_samples,\n                ref->audio->size,\n                ref->audio->sample_rate,\n                ref->audio->planar);\n    }\n    av_dlog(ctx, "]%s", end ? "\\n" : "");\n}']