aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-12-02 01:53:02 +0100
committerStefano Sabatini <stefasab@gmail.com>2012-12-02 15:01:56 +0100
commitfbc339ff41fa8e806796a2a8bf31dd770ac6a934 (patch)
treeb734a7178a4ee7b896ab9c131e943c5e58639293
parentadfd9ca3fabd398bc9fd448f09569698fe74478d (diff)
downloadffmpeg-fbc339ff41fa8e806796a2a8bf31dd770ac6a934.tar.gz
lavfi/super2xsai: switch to ff_filter_frame() API
-rw-r--r--libavfilter/vf_super2xsai.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/libavfilter/vf_super2xsai.c b/libavfilter/vf_super2xsai.c
index af4adffa8a..380cd3215e 100644
--- a/libavfilter/vf_super2xsai.c
+++ b/libavfilter/vf_super2xsai.c
@@ -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 }