[FFmpeg-cvslog] lavfi: deprecate av_buffersrc_buffer() function
Stefano Sabatini
git at videolan.org
Thu Jun 28 22:28:36 CEST 2012
ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Tue Jun 26 15:52:32 2012 +0200| [b0fdd3489a6f5e63ee494245bb34eccf138b17d3] | committer: Stefano Sabatini
lavfi: deprecate av_buffersrc_buffer() function
Favor av_buffersrc_add_ref() instead, which is more powerful.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b0fdd3489a6f5e63ee494245bb34eccf138b17d3
---
ffplay.c | 2 +-
libavfilter/buffersrc.c | 2 ++
libavfilter/buffersrc.h | 4 ++++
libavfilter/version.h | 3 +++
4 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/ffplay.c b/ffplay.c
index 492ac46..c4b8f8e 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -1722,7 +1722,7 @@ static int video_thread(void *arg)
fb->buf->free = filter_release_buffer;
buf->refcount++;
- av_buffersrc_buffer(filt_in, fb);
+ av_buffersrc_add_ref(filt_in, fb, AV_BUFFERSRC_FLAG_NO_COPY);
} else
av_buffersrc_write_frame(filt_in, frame);
diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
index 3c0d964..dd9eb39 100644
--- a/libavfilter/buffersrc.c
+++ b/libavfilter/buffersrc.c
@@ -196,10 +196,12 @@ int av_buffersrc_add_ref(AVFilterContext *s, AVFilterBufferRef *buf, int flags)
return 0;
}
+#ifdef FF_API_BUFFERSRC_BUFFER
int av_buffersrc_buffer(AVFilterContext *s, AVFilterBufferRef *buf)
{
return av_buffersrc_add_ref(s, buf, AV_BUFFERSRC_FLAG_NO_COPY);
}
+#endif
unsigned av_buffersrc_get_nb_failed_requests(AVFilterContext *buffer_src)
{
diff --git a/libavfilter/buffersrc.h b/libavfilter/buffersrc.h
index adfb330..a23e48f 100644
--- a/libavfilter/buffersrc.h
+++ b/libavfilter/buffersrc.h
@@ -63,14 +63,18 @@ int av_buffersrc_add_ref(AVFilterContext *buffer_src,
*/
unsigned av_buffersrc_get_nb_failed_requests(AVFilterContext *buffer_src);
+#ifdef FF_API_BUFFERSRC_BUFFER
/**
* 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_add_ref(s, picref, AV_BUFFERSRC_FLAG_NO_COPY) instead.
*/
+attribute_deprecated
int av_buffersrc_buffer(AVFilterContext *s, AVFilterBufferRef *buf);
+#endif
/**
* Add a frame to the buffer source.
diff --git a/libavfilter/version.h b/libavfilter/version.h
index 124348d..c2285cb 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -56,5 +56,8 @@
#ifndef FF_API_FILL_FRAME
#define FF_API_FILL_FRAME (LIBAVFILTER_VERSION_MAJOR < 4)
#endif
+#ifndef FF_API_BUFFERSRC_BUFFER
+#define FF_API_BUFFERSRC_BUFFER (LIBAVFILTER_VERSION_MAJOR < 4)
+#endif
#endif // AVFILTER_VERSION_H
More information about the ffmpeg-cvslog
mailing list