diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-11-28 11:41:07 +0400 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-03-08 10:37:18 +0400 |
commit | 7e350379f87e7f74420b4813170fe808e2313911 (patch) | |
tree | 031201839361d40af8b4c829f9c9f179e7d9f58d /libavfilter/vf_drawbox.c | |
parent | 77b2cd7b41d7ec8008b6fac753c04f77824c514c (diff) |
lavfi: switch to AVFrame.
Deprecate AVFilterBuffer/AVFilterBufferRef and everything related to it
and use AVFrame instead.
Diffstat (limited to 'libavfilter/vf_drawbox.c')
-rw-r--r-- | libavfilter/vf_drawbox.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libavfilter/vf_drawbox.c b/libavfilter/vf_drawbox.c index c47422ef1b..cd523c0cf2 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 } }; |