Commit fbc339ff authored by Stefano Sabatini's avatar Stefano Sabatini

lavfi/super2xsai: switch to ff_filter_frame() API

parent adfd9ca3
......@@ -30,6 +30,7 @@
#include "libavutil/intreadwrite.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
typedef struct {
......@@ -302,20 +303,22 @@ static int config_output(AVFilterLink *outlink)
return 0;
}
static int null_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) { return 0; }
static int end_frame(AVFilterLink *inlink)
static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
{
AVFilterLink *outlink = inlink->dst->outputs[0];
AVFilterBufferRef *inpicref = inlink->cur_buf;
AVFilterBufferRef *outpicref = outlink->out_buf;
AVFilterBufferRef *outpicref = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
if (!outpicref) {
avfilter_unref_bufferp(&inpicref);
return AVERROR(ENOMEM);
}
avfilter_copy_buffer_ref_props(outpicref, inpicref);
super2xsai(inlink->dst, inpicref->data[0], inpicref->linesize[0],
outpicref->data[0], outpicref->linesize[0],
inlink->w, inlink->h);
ff_draw_slice(outlink, 0, outlink->h, 1);
return ff_end_frame(outlink);
avfilter_unref_bufferp(&inpicref);
return ff_filter_frame(outlink, outpicref);
}
static const AVFilterPad super2xsai_inputs[] = {
......@@ -323,8 +326,7 @@ static const AVFilterPad super2xsai_inputs[] = {
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.config_props = config_input,
.draw_slice = null_draw_slice,
.end_frame = end_frame,
.filter_frame = filter_frame,
.min_perms = AV_PERM_READ,
},
{ 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