]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/buffersrc.h
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavfilter / buffersrc.h
index 2bbbb8f2c4e27e8b3eb0432478d9f3c2c80c79e1..a23e48f677131ab03ad75378853fbdec9e0dbfe4 100644 (file)
@@ -25,6 +25,7 @@
  * Memory buffer source API.
  */
 
+#include "libavcodec/avcodec.h"
 #include "avfilter.h"
 
 enum {
@@ -53,4 +54,37 @@ enum {
 int av_buffersrc_add_ref(AVFilterContext *buffer_src,
                          AVFilterBufferRef *picref, int flags);
 
+/**
+ * Get the number of failed requests.
+ *
+ * A failed request is when the request_frame method is called while no
+ * frame is present in the buffer.
+ * The number is reset when a frame is added.
+ */
+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.
+ *
+ * @param s an instance of the buffersrc filter.
+ * @param frame frame to be added.
+ *
+ * @warning frame data will be memcpy()ed, which may be a big performance
+ *          hit. Use av_buffersrc_buffer() to avoid copying the data.
+ */
+int av_buffersrc_write_frame(AVFilterContext *s, AVFrame *frame);
+
 #endif /* AVFILTER_BUFFERSRC_H */