summaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_drawbox.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-11-28 08:41:07 +0100
committerAnton Khirnov <anton@khirnov.net>2013-03-08 07:37:18 +0100
commit7e350379f87e7f74420b4813170fe808e2313911 (patch)
tree031201839361d40af8b4c829f9c9f179e7d9f58d /libavfilter/vf_drawbox.c
parent77b2cd7b41d7ec8008b6fac753c04f77824c514c (diff)
downloadffmpeg-streaming-7e350379f87e7f74420b4813170fe808e2313911.zip
ffmpeg-streaming-7e350379f87e7f74420b4813170fe808e2313911.tar.gz
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.c9
1 files changed, 4 insertions, 5 deletions
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 }
};
OpenPOWER on IntegriCloud