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/avfilter.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/avfilter.c')
-rw-r--r-- | libavfilter/avfilter.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index d1b6d05a38..6779777b7d 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -343,7 +343,7 @@ int ff_request_frame(AVFilterLink *link) if (ret == AVERROR_EOF && link->partial_buf) { AVFilterBufferRef *pbuf = link->partial_buf; link->partial_buf = NULL; - ff_filter_frame_framed(link, pbuf); + ff_filter_samples_framed(link, pbuf); return 0; } if (ret == AVERROR_EOF) @@ -631,3 +631,23 @@ enum AVMediaType avfilter_pad_get_type(AVFilterPad *pads, int pad_idx) { return pads[pad_idx].type; } + +int ff_filter_frame(AVFilterLink *link, AVFilterBufferRef *frame) +{ + int ret; + FF_TPRINTF_START(NULL, filter_frame); ff_tlog_link(NULL, link, 1); ff_tlog(NULL, " "); ff_tlog_ref(NULL, frame, 1); + + switch (link->type) { + case AVMEDIA_TYPE_VIDEO: + if((ret = ff_start_frame(link, frame)) < 0) + return ret; + if((ret = ff_draw_slice(link, 0, frame->video->h, 1)) < 0) + return ret; + if((ret = ff_end_frame(link)) < 0) + return ret; + return ret; + case AVMEDIA_TYPE_AUDIO: + return ff_filter_samples(link, frame); + default: return AVERROR(EINVAL); + } +} |