Browse code

avfilter: add missing FF_API_AVFILTERBUFFER guards

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

Andreas Cadhalpun authored on 2015/08/17 07:34:58
Showing 5 changed files
... ...
@@ -28,10 +28,14 @@
28 28
 #include "avfilter.h"
29 29
 #include "internal.h"
30 30
 
31
+#if FF_API_AVFILTERBUFFER
32
+FF_DISABLE_DEPRECATION_WARNINGS
31 33
 int avfilter_ref_get_channels(AVFilterBufferRef *ref)
32 34
 {
33 35
     return ref->audio ? ref->audio->channels : 0;
34 36
 }
37
+FF_ENABLE_DEPRECATION_WARNINGS
38
+#endif
35 39
 
36 40
 AVFrame *ff_null_get_audio_buffer(AVFilterLink *link, int nb_samples)
37 41
 {
... ...
@@ -234,13 +234,13 @@ void avfilter_unref_buffer(AVFilterBufferRef *ref);
234 234
  */
235 235
 attribute_deprecated
236 236
 void avfilter_unref_bufferp(AVFilterBufferRef **ref);
237
-#endif
238 237
 
239 238
 /**
240 239
  * Get the number of channels of a buffer reference.
241 240
  */
242 241
 attribute_deprecated
243 242
 int avfilter_ref_get_channels(AVFilterBufferRef *ref);
243
+#endif
244 244
 
245 245
 #if FF_API_AVFILTERPAD_PUBLIC
246 246
 /**
... ...
@@ -763,7 +763,9 @@ struct AVFilterLink {
763 763
         AVLINK_INIT             ///< complete
764 764
     } init_state;
765 765
 
766
+#if FF_API_AVFILTERBUFFER
766 767
     struct AVFilterPool *pool;
768
+#endif
767 769
 
768 770
     /**
769 771
      * Graph the filter belongs to.
... ...
@@ -819,6 +821,7 @@ struct AVFilterLink {
819 819
      */
820 820
     int max_samples;
821 821
 
822
+#if FF_API_AVFILTERBUFFER
822 823
     /**
823 824
      * The buffer reference currently being received across the link by the
824 825
      * destination filter. This is used internally by the filter system to
... ...
@@ -827,6 +830,7 @@ struct AVFilterLink {
827 827
      * by the filters.
828 828
      */
829 829
     AVFilterBufferRef *cur_buf_copy;
830
+#endif
830 831
 
831 832
     /**
832 833
      * True if the link is closed.
... ...
@@ -363,6 +363,8 @@ AVRational av_buffersink_get_frame_rate(AVFilterContext *ctx)
363 363
     return ctx->inputs[0]->frame_rate;
364 364
 }
365 365
 
366
+#if FF_API_AVFILTERBUFFER
367
+FF_DISABLE_DEPRECATION_WARNINGS
366 368
 int attribute_align_arg av_buffersink_poll_frame(AVFilterContext *ctx)
367 369
 {
368 370
     BufferSinkContext *buf = ctx->priv;
... ...
@@ -375,6 +377,8 @@ int attribute_align_arg av_buffersink_poll_frame(AVFilterContext *ctx)
375 375
 
376 376
     return av_fifo_size(buf->fifo)/FIFO_INIT_ELEMENT_SIZE + ff_poll_frame(inlink);
377 377
 }
378
+FF_ENABLE_DEPRECATION_WARNINGS
379
+#endif
378 380
 
379 381
 static av_cold int vsink_init(AVFilterContext *ctx, void *opaque)
380 382
 {
... ...
@@ -63,6 +63,7 @@ enum {
63 63
 
64 64
 };
65 65
 
66
+#if FF_API_AVFILTERBUFFER
66 67
 /**
67 68
  * Add buffer data in picref to buffer_src.
68 69
  *
... ...
@@ -72,8 +73,10 @@ enum {
72 72
  * @return            >= 0 in case of success, a negative AVERROR code
73 73
  *                    in case of failure
74 74
  */
75
+attribute_deprecated
75 76
 int av_buffersrc_add_ref(AVFilterContext *buffer_src,
76 77
                          AVFilterBufferRef *picref, int flags);
78
+#endif
77 79
 
78 80
 /**
79 81
  * Get the number of failed requests.
... ...
@@ -33,6 +33,7 @@
33 33
 #include "video.h"
34 34
 #include "libavcodec/avcodec.h"
35 35
 
36
+#if FF_API_AVFILTERBUFFER
36 37
 #define POOL_SIZE 32
37 38
 typedef struct AVFilterPool {
38 39
     AVFilterBufferRef *pic[POOL_SIZE];
... ...
@@ -40,6 +41,7 @@ typedef struct AVFilterPool {
40 40
     int refcount;
41 41
     int draining;
42 42
 } AVFilterPool;
43
+#endif
43 44
 
44 45
 typedef struct AVFilterCommand {
45 46
     double time;                ///< time expressed in seconds