summaryrefslogtreecommitdiff
path: root/libavfilter/vf_hflip.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_hflip.c
parent77b2cd7b41d7ec8008b6fac753c04f77824c514c (diff)
lavfi: switch to AVFrame.
Deprecate AVFilterBuffer/AVFilterBufferRef and everything related to it and use AVFrame instead.
Diffstat (limited to 'libavfilter/vf_hflip.c')
-rw-r--r--libavfilter/vf_hflip.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/libavfilter/vf_hflip.c b/libavfilter/vf_hflip.c
index 85a1d92720..c8a1ca252e 100644
--- a/libavfilter/vf_hflip.c
+++ b/libavfilter/vf_hflip.c
@@ -84,21 +84,21 @@ static int config_props(AVFilterLink *inlink)
return 0;
}
-static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *in)
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
{
AVFilterContext *ctx = inlink->dst;
FlipContext *flip = ctx->priv;
AVFilterLink *outlink = ctx->outputs[0];
- AVFilterBufferRef *out;
+ AVFrame *out;
uint8_t *inrow, *outrow;
int i, j, plane, step, hsub, vsub;
- out = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
+ out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
if (!out) {
- avfilter_unref_bufferp(&in);
+ av_frame_free(&in);
return AVERROR(ENOMEM);
}
- avfilter_copy_buffer_ref_props(out, in);
+ av_frame_copy_props(out, in);
for (plane = 0; plane < 4 && in->data[plane]; plane++) {
step = flip->max_step[plane];
@@ -107,7 +107,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *in)
outrow = out->data[plane];
inrow = in ->data[plane] + ((inlink->w >> hsub) - 1) * step;
- for (i = 0; i < in->video->h >> vsub; i++) {
+ for (i = 0; i < in->height >> vsub; i++) {
switch (step) {
case 1:
for (j = 0; j < (inlink->w >> hsub); j++)
@@ -153,7 +153,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *in)
}
}
- avfilter_unref_bufferp(&in);
+ av_frame_free(&in);
return ff_filter_frame(outlink, out);
}
@@ -163,7 +163,6 @@ static const AVFilterPad avfilter_vf_hflip_inputs[] = {
.type = AVMEDIA_TYPE_VIDEO,
.filter_frame = filter_frame,
.config_props = config_props,
- .min_perms = AV_PERM_READ,
},
{ NULL }
};