summaryrefslogtreecommitdiff
path: root/libavfilter/vsrc_buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavfilter/vsrc_buffer.c')
-rw-r--r--libavfilter/vsrc_buffer.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libavfilter/vsrc_buffer.c b/libavfilter/vsrc_buffer.c
index 3c0936a68c..6f44368a32 100644
--- a/libavfilter/vsrc_buffer.c
+++ b/libavfilter/vsrc_buffer.c
@@ -26,6 +26,7 @@
#include "avfilter.h"
#include "internal.h"
#include "avcodec.h"
+#include "buffersrc.h"
#include "vsrc_buffer.h"
#include "libavutil/imgutils.h"
@@ -112,6 +113,23 @@ int av_vsrc_buffer_add_video_buffer_ref(AVFilterContext *buffer_filter,
return 0;
}
+int av_buffersrc_buffer(AVFilterContext *s, AVFilterBufferRef *buf)
+{
+ BufferSourceContext *c = s->priv;
+
+ if (c->picref) {
+ av_log(s, AV_LOG_ERROR,
+ "Buffering several frames is not supported. "
+ "Please consume all available frames before adding a new one.\n"
+ );
+ return AVERROR(EINVAL);
+ }
+
+ c->picref = buf;
+
+ return 0;
+}
+
#if CONFIG_AVCODEC
#include "avcodec.h"