Commit 267290ce authored by Anton Khirnov's avatar Anton Khirnov Committed by Michael Niedermayer

vflip: switch to filter_frame

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 8c1f98d9
......@@ -69,41 +69,28 @@ static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms,
return picref;
}
static int start_frame(AVFilterLink *link, AVFilterBufferRef *inpicref)
static int filter_frame(AVFilterLink *link, AVFilterBufferRef *frame)
{
FlipContext *flip = link->dst->priv;
AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0);
int i;
if (!outpicref)
return AVERROR(ENOMEM);
for (i = 0; i < 4; i ++) {
int vsub = i == 1 || i == 2 ? flip->vsub : 0;
if (outpicref->data[i]) {
outpicref->data[i] += (((link->h + (1<<vsub)-1)>> vsub)-1) * outpicref->linesize[i];
outpicref->linesize[i] = -outpicref->linesize[i];
if (frame->data[i]) {
frame->data[i] += (((link->h + (1<<vsub)-1)>> vsub)-1) * frame->linesize[i];
frame->linesize[i] = -frame->linesize[i];
}
}
return ff_start_frame(link->dst->outputs[0], outpicref);
}
static int draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
{
AVFilterContext *ctx = link->dst;
return ff_draw_slice(ctx->outputs[0], link->h - (y+h), h, -1 * slice_dir);
return ff_filter_frame(link->dst->outputs[0], frame);
}
static const AVFilterPad avfilter_vf_vflip_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.get_video_buffer = get_video_buffer,
.start_frame = start_frame,
.draw_slice = draw_slice,
.filter_frame = filter_frame,
.config_props = config_input,
},
{ NULL }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment