summaryrefslogtreecommitdiff
path: root/libavfilter/vsrc_buffer.h
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2011-06-02 15:43:21 +0200
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2011-06-06 01:35:27 +0200
commit27bcf55f459e038e81f09c17e72e6d44898b9015 (patch)
tree34ba7668ad2c828fc1ff087901e5b59fbee3d030 /libavfilter/vsrc_buffer.h
parent612d0782fc885aaa0bbb8f8966d425ea91a606cf (diff)
vsrc_buffer: add flags param to av_vsrc_buffer_add_video_buffer_ref
The new flags parameter allows to specify if the video ref to add should overwrite the cache, if the flag is not set vsrc_buffer will complain and abort; otherwise it will clean the already cached video ref before to overwrite it, thus avoiding a leak.
Diffstat (limited to 'libavfilter/vsrc_buffer.h')
-rw-r--r--libavfilter/vsrc_buffer.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/libavfilter/vsrc_buffer.h b/libavfilter/vsrc_buffer.h
index c717f3dae4..b661d414ea 100644
--- a/libavfilter/vsrc_buffer.h
+++ b/libavfilter/vsrc_buffer.h
@@ -29,12 +29,21 @@
#include "avfilter.h"
/**
+ * Tell av_vsrc_buffer_add_video_buffer_ref() to overwrite the already
+ * cached video buffer with the new added one, otherwise the function
+ * will complain and exit.
+ */
+#define AV_VSRC_BUF_FLAG_OVERWRITE 1
+
+/**
* Add video buffer data in picref to buffer_src.
*
* @param buffer_src pointer to a buffer source context
+ * @param flags a combination of AV_VSRC_BUF_FLAG_* flags
* @return >= 0 in case of success, a negative AVERROR code in case of
* failure
*/
-int av_vsrc_buffer_add_video_buffer_ref(AVFilterContext *buffer_src, AVFilterBufferRef *picref);
+int av_vsrc_buffer_add_video_buffer_ref(AVFilterContext *buffer_src,
+ AVFilterBufferRef *picref, int flags);
#endif /* AVFILTER_VSRC_BUFFER_H */