diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-28 16:39:04 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-28 16:43:34 +0100 |
commit | 3ed483cdfa5bc9800702a4a505b7164e70b1bcd6 (patch) | |
tree | 199776884982bc63a621a18035e45ebcb60953fa /libavfilter/video.c | |
parent | a0b8eec719323bc242e47ab891af47cfd8f06aec (diff) | |
download | ffmpeg-3ed483cdfa5bc9800702a4a505b7164e70b1bcd6.tar.gz |
libavfilter: Support using filter_frame for video
With this we can mix filters using filter_frame OR start/draw_slice/end
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/video.c')
-rw-r--r-- | libavfilter/video.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libavfilter/video.c b/libavfilter/video.c index 4d8804ba10..5eb37e6b5a 100644 --- a/libavfilter/video.c +++ b/libavfilter/video.c @@ -210,7 +210,7 @@ static int default_start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) if (inlink->dst->nb_outputs) outlink = inlink->dst->outputs[0]; - if (outlink) { + if (outlink && !inlink->dstpad->filter_frame) { AVFilterBufferRef *buf_out; outlink->out_buf = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); if (!outlink->out_buf) @@ -328,7 +328,13 @@ static int default_end_frame(AVFilterLink *inlink) outlink = inlink->dst->outputs[0]; if (outlink) { - return ff_end_frame(outlink); + if (inlink->dstpad->filter_frame) { + int ret = inlink->dstpad->filter_frame(inlink, inlink->cur_buf); + inlink->cur_buf = NULL; + return ret; + } else { + return ff_end_frame(outlink); + } } return 0; } @@ -360,7 +366,7 @@ static int default_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) if (inlink->dst->nb_outputs) outlink = inlink->dst->outputs[0]; - if (outlink) + if (outlink && !inlink->dstpad->filter_frame) return ff_draw_slice(outlink, y, h, slice_dir); return 0; } |