From 7e350379f87e7f74420b4813170fe808e2313911 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 28 Nov 2012 08:41:07 +0100 Subject: lavfi: switch to AVFrame. Deprecate AVFilterBuffer/AVFilterBufferRef and everything related to it and use AVFrame instead. --- libavfilter/vf_drawbox.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'libavfilter/vf_drawbox.c') diff --git a/libavfilter/vf_drawbox.c b/libavfilter/vf_drawbox.c index c47422e..cd523c0 100644 --- a/libavfilter/vf_drawbox.c +++ b/libavfilter/vf_drawbox.c @@ -96,20 +96,20 @@ static int config_input(AVFilterLink *inlink) return 0; } -static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *frame) +static int filter_frame(AVFilterLink *inlink, AVFrame *frame) { DrawBoxContext *drawbox = inlink->dst->priv; int plane, x, y, xb = drawbox->x, yb = drawbox->y; unsigned char *row[4]; - for (y = FFMAX(yb, 0); y < frame->video->h && y < (yb + drawbox->h); y++) { + for (y = FFMAX(yb, 0); y < frame->height && y < (yb + drawbox->h); y++) { row[0] = frame->data[0] + y * frame->linesize[0]; for (plane = 1; plane < 3; plane++) row[plane] = frame->data[plane] + frame->linesize[plane] * (y >> drawbox->vsub); - for (x = FFMAX(xb, 0); x < (xb + drawbox->w) && x < frame->video->w; x++) { + for (x = FFMAX(xb, 0); x < (xb + drawbox->w) && x < frame->width; x++) { double alpha = (double)drawbox->yuv_color[A] / 255; if ((y - yb < 3) || (yb + drawbox->h - y < 4) || @@ -131,8 +131,7 @@ static const AVFilterPad avfilter_vf_drawbox_inputs[] = { .config_props = config_input, .get_video_buffer = ff_null_get_video_buffer, .filter_frame = filter_frame, - .min_perms = AV_PERM_WRITE | AV_PERM_READ, - .rej_perms = AV_PERM_PRESERVE + .needs_writable = 1, }, { NULL } }; -- cgit v1.1