aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_fps.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-11-28 19:28:41 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-28 19:28:41 +0100
commit92b57e8dac76ee633a59c4e8d256f1247f13c095 (patch)
tree0a4ebc8775cfb4353bfe145c370721047b83f609 /libavfilter/vf_fps.c
parente67fdbffe588e6b5bc787457da9d5941657a0029 (diff)
downloadffmpeg-92b57e8dac76ee633a59c4e8d256f1247f13c095.tar.gz
vf_fps: switch to filter_frame
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/vf_fps.c')
-rw-r--r--libavfilter/vf_fps.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
index d9eedc8b31..8e7880cfe9 100644
--- a/libavfilter/vf_fps.c
+++ b/libavfilter/vf_fps.c
@@ -152,9 +152,7 @@ static int request_frame(AVFilterLink *outlink)
buf->pts = av_rescale_q(s->first_pts, ctx->inputs[0]->time_base,
outlink->time_base) + s->frames_out;
- if ((ret = ff_start_frame(outlink, buf)) < 0 ||
- (ret = ff_draw_slice(outlink, 0, outlink->h, 1)) < 0 ||
- (ret = ff_end_frame(outlink)) < 0)
+ if ((ret = ff_filter_frame(outlink, buf)) < 0)
return ret;
s->frames_out++;
@@ -179,16 +177,14 @@ static int write_to_fifo(AVFifoBuffer *fifo, AVFilterBufferRef *buf)
return 0;
}
-static int end_frame(AVFilterLink *inlink)
+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf)
{
AVFilterContext *ctx = inlink->dst;
FPSContext *s = ctx->priv;
AVFilterLink *outlink = ctx->outputs[0];
- AVFilterBufferRef *buf = inlink->cur_buf;
int64_t delta;
int i, ret;
- inlink->cur_buf = NULL;
s->frames_in++;
/* discard frames until we get the first timestamp */
if (s->pts == AV_NOPTS_VALUE) {
@@ -259,9 +255,7 @@ static int end_frame(AVFilterLink *inlink)
buf_out->pts = av_rescale_q(s->first_pts, inlink->time_base,
outlink->time_base) + s->frames_out;
- if ((ret = ff_start_frame(outlink, buf_out)) < 0 ||
- (ret = ff_draw_slice(outlink, 0, outlink->h, 1)) < 0 ||
- (ret = ff_end_frame(outlink)) < 0) {
+ if ((ret = ff_filter_frame(outlink, buf_out)) < 0) {
avfilter_unref_bufferp(&buf);
return ret;
}
@@ -276,24 +270,12 @@ static int end_frame(AVFilterLink *inlink)
return ret;
}
-static int null_start_frame(AVFilterLink *link, AVFilterBufferRef *buf)
-{
- return 0;
-}
-
-static int null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
-{
- return 0;
-}
-
static const AVFilterPad avfilter_vf_fps_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.min_perms = AV_PERM_READ | AV_PERM_PRESERVE,
- .start_frame = null_start_frame,
- .draw_slice = null_draw_slice,
- .end_frame = end_frame,
+ .filter_frame = filter_frame,
},
{ NULL }
};