From 7e350379f87e7f74420b4813170fe808e2313911 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 28 Nov 2012 08:41:07 +0100 Subject: lavfi: switch to AVFrame. Deprecate AVFilterBuffer/AVFilterBufferRef and everything related to it and use AVFrame instead. --- libavfilter/buffersrc.h | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'libavfilter/buffersrc.h') diff --git a/libavfilter/buffersrc.h b/libavfilter/buffersrc.h index 452c691b09..c6f7ff964b 100644 --- a/libavfilter/buffersrc.h +++ b/libavfilter/buffersrc.h @@ -27,24 +27,47 @@ #include "avfilter.h" +#if FF_API_AVFILTERBUFFER /** * Add a buffer to the filtergraph s. * * @param buf buffer containing frame data to be passed down the filtergraph. * This function will take ownership of buf, the user must not free it. * A NULL buf signals EOF -- i.e. no more frames will be sent to this filter. + * + * @deprecated use av_buffersrc_write_frame() or av_buffersrc_add_frame() */ +attribute_deprecated int av_buffersrc_buffer(AVFilterContext *s, AVFilterBufferRef *buf); +#endif /** * Add a frame to the buffer source. * * @param s an instance of the buffersrc filter. - * @param frame frame to be added. + * @param frame frame to be added. If the frame is reference counted, this + * function will make a new reference to it. Otherwise the frame data will be + * copied. * - * @warning frame data will be memcpy()ed, which may be a big performance - * hit. Use av_buffersrc_buffer() to avoid copying the data. + * @return 0 on success, a negative AVERROR on error */ int av_buffersrc_write_frame(AVFilterContext *s, const AVFrame *frame); +/** + * Add a frame to the buffer source. + * + * @param s an instance of the buffersrc filter. + * @param frame frame to be added. If the frame is reference counted, this + * function will take ownership of the reference(s) and reset the frame. + * Otherwise the frame data will be copied. If this function returns an error, + * the input frame is not touched. + * + * @return 0 on success, a negative AVERROR on error. + * + * @note the difference between this function and av_buffersrc_write_frame() is + * that av_buffersrc_write_frame() creates a new reference to the input frame, + * while this function takes ownership of the reference passed to it. + */ +int av_buffersrc_add_frame(AVFilterContext *ctx, AVFrame *frame); + #endif /* AVFILTER_BUFFERSRC_H */ -- cgit v1.2.3