[FFmpeg-devel] [PATCH 08/10] src_buffer: update get_nb_failed_requests name.

Nicolas George nicolas.george at normalesup.org
Sat May 5 10:22:36 CEST 2012


Implement av_buffersrc_get_nb_failed_requests.
Deprecate av_vsrc_buffer_get_nb_failed_requests.

Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 libavfilter/buffersrc.h   |    9 +++++++++
 libavfilter/src_buffer.c  |    5 +++++
 libavfilter/vsrc_buffer.h |    3 +++
 3 files changed, 17 insertions(+)

diff --git a/libavfilter/buffersrc.h b/libavfilter/buffersrc.h
index 154c29a..f7f8d17 100644
--- a/libavfilter/buffersrc.h
+++ b/libavfilter/buffersrc.h
@@ -53,4 +53,13 @@ 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);
+
 #endif /* AVFILTER_BUFFERSRC_H */
diff --git a/libavfilter/src_buffer.c b/libavfilter/src_buffer.c
index f247f2c..a64a6e2 100644
--- a/libavfilter/src_buffer.c
+++ b/libavfilter/src_buffer.c
@@ -331,6 +331,11 @@ int av_vsrc_buffer_add_frame(AVFilterContext *buffer_src,
 }
 #endif
 
+unsigned av_buffersrc_get_nb_failed_requests(AVFilterContext *buffer_src)
+{
+    return ((BufferSourceContext *)buffer_src->priv)->nb_failed_requests;
+}
+
 unsigned av_vsrc_buffer_get_nb_failed_requests(AVFilterContext *buffer_src)
 {
     return ((BufferSourceContext *)buffer_src->priv)->nb_failed_requests;
diff --git a/libavfilter/vsrc_buffer.h b/libavfilter/vsrc_buffer.h
index 7f25c98..17c4498 100644
--- a/libavfilter/vsrc_buffer.h
+++ b/libavfilter/vsrc_buffer.h
@@ -52,7 +52,10 @@ int av_vsrc_buffer_add_video_buffer_ref(AVFilterContext *buffer_src,
  * 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.
+ *
+ * @deprecated use av_buffersrc_get_nb_failed_requests() instead.
  */
+attribute_deprecated
 unsigned av_vsrc_buffer_get_nb_failed_requests(AVFilterContext *buffer_src);
 
 #endif /* AVFILTER_VSRC_BUFFER_H */
-- 
1.7.10



More information about the ffmpeg-devel mailing list