[FFmpeg-devel] [PATCH 03/13] avfilter: add missing FF_API_AVFILTERBUFFER guards

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Sat Aug 8 13:32:01 CEST 2015


Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
---
 libavfilter/audio.c      | 4 ++++
 libavfilter/avfilter.h   | 6 +++++-
 libavfilter/buffersink.c | 4 ++++
 libavfilter/buffersrc.h  | 3 +++
 libavfilter/internal.h   | 2 ++
 5 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/libavfilter/audio.c b/libavfilter/audio.c
index 1e1d8e0..8148fda 100644
--- a/libavfilter/audio.c
+++ b/libavfilter/audio.c
@@ -28,10 +28,14 @@
 #include "avfilter.h"
 #include "internal.h"
 
+#if FF_API_AVFILTERBUFFER
+FF_DISABLE_DEPRECATION_WARNINGS
 int avfilter_ref_get_channels(AVFilterBufferRef *ref)
 {
     return ref->audio ? ref->audio->channels : 0;
 }
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
 AVFrame *ff_null_get_audio_buffer(AVFilterLink *link, int nb_samples)
 {
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index 296f2d3..584623f 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -234,13 +234,13 @@ void avfilter_unref_buffer(AVFilterBufferRef *ref);
  */
 attribute_deprecated
 void avfilter_unref_bufferp(AVFilterBufferRef **ref);
-#endif
 
 /**
  * Get the number of channels of a buffer reference.
  */
 attribute_deprecated
 int avfilter_ref_get_channels(AVFilterBufferRef *ref);
+#endif
 
 #if FF_API_AVFILTERPAD_PUBLIC
 /**
@@ -763,7 +763,9 @@ struct AVFilterLink {
         AVLINK_INIT             ///< complete
     } init_state;
 
+#if FF_API_AVFILTERBUFFER
     struct AVFilterPool *pool;
+#endif
 
     /**
      * Graph the filter belongs to.
@@ -819,6 +821,7 @@ struct AVFilterLink {
      */
     int max_samples;
 
+#if FF_API_AVFILTERBUFFER
     /**
      * The buffer reference currently being received across the link by the
      * destination filter. This is used internally by the filter system to
@@ -827,6 +830,7 @@ struct AVFilterLink {
      * by the filters.
      */
     AVFilterBufferRef *cur_buf_copy;
+#endif
 
     /**
      * True if the link is closed.
diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c
index b145e35..a303127 100644
--- a/libavfilter/buffersink.c
+++ b/libavfilter/buffersink.c
@@ -363,6 +363,8 @@ AVRational av_buffersink_get_frame_rate(AVFilterContext *ctx)
     return ctx->inputs[0]->frame_rate;
 }
 
+#if FF_API_AVFILTERBUFFER
+FF_DISABLE_DEPRECATION_WARNINGS
 int attribute_align_arg av_buffersink_poll_frame(AVFilterContext *ctx)
 {
     BufferSinkContext *buf = ctx->priv;
@@ -375,6 +377,8 @@ int attribute_align_arg av_buffersink_poll_frame(AVFilterContext *ctx)
 
     return av_fifo_size(buf->fifo)/sizeof(AVFilterBufferRef *) + ff_poll_frame(inlink);
 }
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
 static av_cold int vsink_init(AVFilterContext *ctx, void *opaque)
 {
diff --git a/libavfilter/buffersrc.h b/libavfilter/buffersrc.h
index ea34c04..4eff77b 100644
--- a/libavfilter/buffersrc.h
+++ b/libavfilter/buffersrc.h
@@ -63,6 +63,7 @@ enum {
 
 };
 
+#if FF_API_AVFILTERBUFFER
 /**
  * Add buffer data in picref to buffer_src.
  *
@@ -72,8 +73,10 @@ enum {
  * @return            >= 0 in case of success, a negative AVERROR code
  *                    in case of failure
  */
+attribute_deprecated
 int av_buffersrc_add_ref(AVFilterContext *buffer_src,
                          AVFilterBufferRef *picref, int flags);
+#endif
 
 /**
  * Get the number of failed requests.
diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index 85348f0..03aa96f 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -33,6 +33,7 @@
 #include "video.h"
 #include "libavcodec/avcodec.h"
 
+#if FF_API_AVFILTERBUFFER
 #define POOL_SIZE 32
 typedef struct AVFilterPool {
     AVFilterBufferRef *pic[POOL_SIZE];
@@ -40,6 +41,7 @@ typedef struct AVFilterPool {
     int refcount;
     int draining;
 } AVFilterPool;
+#endif
 
 typedef struct AVFilterCommand {
     double time;                ///< time expressed in seconds
-- 
2.4.6


More information about the ffmpeg-devel mailing list