[FFmpeg-cvslog] avfilter: add missing FF_API_AVFILTERBUFFER guards

Andreas Cadhalpun git at videolan.org
Sun Aug 30 23:47:21 CEST 2015


ffmpeg | branch: master | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Mon Aug 17 00:34:58 2015 +0200| [e6c20e214efd21cac56309c1548cf5dbdf1edf38] | committer: Andreas Cadhalpun

avfilter: add missing FF_API_AVFILTERBUFFER guards

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e6c20e214efd21cac56309c1548cf5dbdf1edf38
---

 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 a49bcf4..e322298 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 36b9e42..8d2e7d7 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)/FIFO_INIT_ELEMENT_SIZE + 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 797c884..7dde2e1 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



More information about the ffmpeg-cvslog mailing list