Browse code

Disable deprecation warnings for cases where a replacement is available

Diego Biurrun authored on 2013/03/28 02:36:51
Showing 20 changed files
... ...
@@ -23,6 +23,7 @@
23 23
 
24 24
 #include "libavutil/avassert.h"
25 25
 #include "libavutil/common.h"
26
+#include "libavutil/internal.h"
26 27
 #include "libavutil/mem.h"
27 28
 #include "avcodec.h"
28 29
 
... ...
@@ -52,7 +53,9 @@ void av_init_packet(AVPacket *pkt)
52 52
     pkt->flags                = 0;
53 53
     pkt->stream_index         = 0;
54 54
 #if FF_API_DESTRUCT_PACKET
55
+FF_DISABLE_DEPRECATION_WARNINGS
55 56
     pkt->destruct             = NULL;
57
+FF_ENABLE_DEPRECATION_WARNINGS
56 58
 #endif
57 59
     pkt->buf                  = NULL;
58 60
     pkt->side_data            = NULL;
... ...
@@ -77,7 +80,9 @@ int av_new_packet(AVPacket *pkt, int size)
77 77
     pkt->data     = buf->data;
78 78
     pkt->size     = size;
79 79
 #if FF_API_DESTRUCT_PACKET
80
+FF_DISABLE_DEPRECATION_WARNINGS
80 81
     pkt->destruct = dummy_destruct_packet;
82
+FF_ENABLE_DEPRECATION_WARNINGS
81 83
 #endif
82 84
 
83 85
     return 0;
... ...
@@ -112,7 +117,9 @@ int av_grow_packet(AVPacket *pkt, int grow_by)
112 112
             return AVERROR(ENOMEM);
113 113
         memcpy(pkt->buf->data, pkt->data, FFMIN(pkt->size, pkt->size + grow_by));
114 114
 #if FF_API_DESTRUCT_PACKET
115
+FF_DISABLE_DEPRECATION_WARNINGS
115 116
         pkt->destruct = dummy_destruct_packet;
117
+FF_ENABLE_DEPRECATION_WARNINGS
116 118
 #endif
117 119
     }
118 120
     pkt->data  = pkt->buf->data;
... ...
@@ -135,7 +142,9 @@ int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size)
135 135
     pkt->data = data;
136 136
     pkt->size = size;
137 137
 #if FF_API_DESTRUCT_PACKET
138
+FF_DISABLE_DEPRECATION_WARNINGS
138 139
     pkt->destruct = dummy_destruct_packet;
140
+FF_ENABLE_DEPRECATION_WARNINGS
139 141
 #endif
140 142
 
141 143
     return 0;
... ...
@@ -172,18 +181,22 @@ int av_dup_packet(AVPacket *pkt)
172 172
 {
173 173
     AVPacket tmp_pkt;
174 174
 
175
+FF_DISABLE_DEPRECATION_WARNINGS
175 176
     if (!pkt->buf && pkt->data
176 177
 #if FF_API_DESTRUCT_PACKET
177 178
         && !pkt->destruct
178 179
 #endif
179 180
         ) {
181
+FF_ENABLE_DEPRECATION_WARNINGS
180 182
         tmp_pkt = *pkt;
181 183
 
182 184
         pkt->data      = NULL;
183 185
         pkt->side_data = NULL;
184 186
         DUP_DATA(pkt->data, tmp_pkt.data, pkt->size, 1, ALLOC_BUF);
185 187
 #if FF_API_DESTRUCT_PACKET
188
+FF_DISABLE_DEPRECATION_WARNINGS
186 189
         pkt->destruct = dummy_destruct_packet;
190
+FF_ENABLE_DEPRECATION_WARNINGS
187 191
 #endif
188 192
 
189 193
         if (pkt->side_data_elems) {
... ...
@@ -213,6 +226,7 @@ void av_free_packet(AVPacket *pkt)
213 213
     if (pkt) {
214 214
         int i;
215 215
 
216
+FF_DISABLE_DEPRECATION_WARNINGS
216 217
         if (pkt->buf)
217 218
             av_buffer_unref(&pkt->buf);
218 219
 #if FF_API_DESTRUCT_PACKET
... ...
@@ -220,6 +234,7 @@ void av_free_packet(AVPacket *pkt)
220 220
             pkt->destruct(pkt);
221 221
         pkt->destruct = NULL;
222 222
 #endif
223
+FF_ENABLE_DEPRECATION_WARNINGS
223 224
         pkt->data            = NULL;
224 225
         pkt->size            = 0;
225 226
 
... ...
@@ -28,6 +28,7 @@
28 28
 
29 29
 #include "libavutil/channel_layout.h"
30 30
 #include "libavutil/crc.h"
31
+#include "libavutil/internal.h"
31 32
 #include "get_bits.h"
32 33
 #include "parser.h"
33 34
 #include "mlp_parser.h"
... ...
@@ -323,11 +324,13 @@ static int mlp_parse(AVCodecParserContext *s,
323 323
         if (mh.stream_type == 0xbb) {
324 324
             /* MLP stream */
325 325
 #if FF_API_REQUEST_CHANNELS
326
+FF_DISABLE_DEPRECATION_WARNINGS
326 327
             if (avctx->request_channels > 0 && avctx->request_channels <= 2 &&
327 328
                 mh.num_substreams > 1) {
328 329
                 avctx->channels       = 2;
329 330
                 avctx->channel_layout = AV_CH_LAYOUT_STEREO;
330 331
             } else
332
+FF_ENABLE_DEPRECATION_WARNINGS
331 333
 #endif
332 334
             if (avctx->request_channel_layout == AV_CH_LAYOUT_STEREO &&
333 335
                 mh.num_substreams > 1) {
... ...
@@ -340,6 +343,7 @@ static int mlp_parse(AVCodecParserContext *s,
340 340
         } else { /* mh.stream_type == 0xba */
341 341
             /* TrueHD stream */
342 342
 #if FF_API_REQUEST_CHANNELS
343
+FF_DISABLE_DEPRECATION_WARNINGS
343 344
             if (avctx->request_channels > 0 && avctx->request_channels <= 2 &&
344 345
                 mh.num_substreams > 1) {
345 346
                 avctx->channels       = 2;
... ...
@@ -349,6 +353,7 @@ static int mlp_parse(AVCodecParserContext *s,
349 349
                 avctx->channels       = mh.channels_thd_stream1;
350 350
                 avctx->channel_layout = mh.channel_layout_thd_stream1;
351 351
             } else
352
+FF_ENABLE_DEPRECATION_WARNINGS
352 353
 #endif
353 354
             if (avctx->request_channel_layout == AV_CH_LAYOUT_STEREO &&
354 355
                 mh.num_substreams > 1) {
... ...
@@ -27,6 +27,7 @@
27 27
 #include <stdint.h>
28 28
 
29 29
 #include "avcodec.h"
30
+#include "libavutil/internal.h"
30 31
 #include "libavutil/intreadwrite.h"
31 32
 #include "libavutil/channel_layout.h"
32 33
 #include "get_bits.h"
... ...
@@ -449,6 +450,7 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
449 449
     s->max_matrix_channel = max_matrix_channel;
450 450
 
451 451
 #if FF_API_REQUEST_CHANNELS
452
+FF_DISABLE_DEPRECATION_WARNINGS
452 453
     if (m->avctx->request_channels > 0 &&
453 454
         m->avctx->request_channels <= s->max_channel + 1 &&
454 455
         m->max_decoded_substream > substr) {
... ...
@@ -458,6 +460,7 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
458 458
                s->max_channel + 1, substr);
459 459
         m->max_decoded_substream = substr;
460 460
     } else
461
+FF_ENABLE_DEPRECATION_WARNINGS
461 462
 #endif
462 463
     if (m->avctx->request_channel_layout == s->ch_layout &&
463 464
         m->max_decoded_substream > substr) {
... ...
@@ -23,6 +23,7 @@
23 23
 #include <float.h>
24 24
 #include <limits.h>
25 25
 
26
+#include "libavutil/internal.h"
26 27
 #include "libavutil/opt.h"
27 28
 #include "avcodec.h"
28 29
 #include "version.h"
... ...
@@ -39,6 +40,7 @@
39 39
 
40 40
 #define AV_CODEC_DEFAULT_BITRATE 200*1000
41 41
 
42
+FF_DISABLE_DEPRECATION_WARNINGS
42 43
 static const AVOption avcodec_options[] = {
43 44
 {"b", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT, {.i64 = AV_CODEC_DEFAULT_BITRATE }, INT_MIN, INT_MAX, V|A|E},
44 45
 {"bt", "Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate tolerance specifies how far "
... ...
@@ -373,6 +375,7 @@ static const AVOption avcodec_options[] = {
373 373
 {"refcounted_frames", NULL, OFFSET(refcounted_frames), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, A|V|D },
374 374
 {NULL},
375 375
 };
376
+FF_ENABLE_DEPRECATION_WARNINGS
376 377
 
377 378
 #undef A
378 379
 #undef V
... ...
@@ -37,6 +37,7 @@
37 37
 #include "libavutil/avassert.h"
38 38
 #include "libavutil/common.h"
39 39
 #include "libavutil/cpu.h"
40
+#include "libavutil/internal.h"
40 41
 
41 42
 #if HAVE_PTHREADS
42 43
 #include <pthread.h>
... ...
@@ -408,8 +409,10 @@ static int update_context_from_user(AVCodecContext *dst, AVCodecContext *src)
408 408
     dst->draw_horiz_band= src->draw_horiz_band;
409 409
     dst->get_buffer2    = src->get_buffer2;
410 410
 #if FF_API_GET_BUFFER
411
+FF_DISABLE_DEPRECATION_WARNINGS
411 412
     dst->get_buffer     = src->get_buffer;
412 413
     dst->release_buffer = src->release_buffer;
414
+FF_ENABLE_DEPRECATION_WARNINGS
413 415
 #endif
414 416
 
415 417
     dst->opaque   = src->opaque;
... ...
@@ -511,11 +514,13 @@ static int submit_packet(PerThreadContext *p, AVPacket *avpkt)
511 511
      * and it calls back to the client here.
512 512
      */
513 513
 
514
+FF_DISABLE_DEPRECATION_WARNINGS
514 515
     if (!p->avctx->thread_safe_callbacks && (
515 516
 #if FF_API_GET_BUFFER
516 517
          p->avctx->get_buffer ||
517 518
 #endif
518 519
          p->avctx->get_buffer2 != avcodec_default_get_buffer2)) {
520
+FF_ENABLE_DEPRECATION_WARNINGS
519 521
         while (p->state != STATE_SETUP_FINISHED && p->state != STATE_INPUT_READY) {
520 522
             pthread_mutex_lock(&p->progress_mutex);
521 523
             while (p->state == STATE_SETTING_UP)
... ...
@@ -878,11 +883,13 @@ int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
878 878
     }
879 879
 
880 880
     pthread_mutex_lock(&p->parent->buffer_mutex);
881
+FF_DISABLE_DEPRECATION_WARNINGS
881 882
     if (avctx->thread_safe_callbacks || (
882 883
 #if FF_API_GET_BUFFER
883 884
         !avctx->get_buffer &&
884 885
 #endif
885 886
         avctx->get_buffer2 == avcodec_default_get_buffer2)) {
887
+FF_ENABLE_DEPRECATION_WARNINGS
886 888
         err = ff_get_buffer(avctx, f->f, flags);
887 889
     } else {
888 890
         p->requested_frame = f->f;
... ...
@@ -915,6 +922,7 @@ void ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f)
915 915
     PerThreadContext *p = avctx->thread_opaque;
916 916
     FrameThreadContext *fctx;
917 917
     AVFrame *dst, *tmp;
918
+FF_DISABLE_DEPRECATION_WARNINGS
918 919
     int can_direct_free = !(avctx->active_thread_type & FF_THREAD_FRAME) ||
919 920
                           avctx->thread_safe_callbacks                   ||
920 921
                           (
... ...
@@ -922,6 +930,7 @@ void ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f)
922 922
                            !avctx->get_buffer &&
923 923
 #endif
924 924
                            avctx->get_buffer2 == avcodec_default_get_buffer2);
925
+FF_ENABLE_DEPRECATION_WARNINGS
925 926
 
926 927
     if (!f->f->data[0])
927 928
         return;
... ...
@@ -32,6 +32,7 @@
32 32
 #include "libavutil/channel_layout.h"
33 33
 #include "libavutil/crc.h"
34 34
 #include "libavutil/frame.h"
35
+#include "libavutil/internal.h"
35 36
 #include "libavutil/mathematics.h"
36 37
 #include "libavutil/pixdesc.h"
37 38
 #include "libavutil/imgutils.h"
... ...
@@ -511,7 +512,9 @@ int avcodec_default_get_buffer2(AVCodecContext *avctx, AVFrame *frame, int flags
511 511
         return ret;
512 512
 
513 513
 #if FF_API_GET_BUFFER
514
+FF_DISABLE_DEPRECATION_WARNINGS
514 515
     frame->type = FF_BUFFER_TYPE_INTERNAL;
516
+FF_ENABLE_DEPRECATION_WARNINGS
515 517
 #endif
516 518
 
517 519
     switch (avctx->codec_type) {
... ...
@@ -525,6 +528,7 @@ int avcodec_default_get_buffer2(AVCodecContext *avctx, AVFrame *frame, int flags
525 525
 }
526 526
 
527 527
 #if FF_API_GET_BUFFER
528
+FF_DISABLE_DEPRECATION_WARNINGS
528 529
 int avcodec_default_get_buffer(AVCodecContext *avctx, AVFrame *frame)
529 530
 {
530 531
     return avcodec_default_get_buffer2(avctx, frame, 0);
... ...
@@ -548,6 +552,7 @@ static void compat_release_buffer(void *opaque, uint8_t *data)
548 548
     AVBufferRef *buf = opaque;
549 549
     av_buffer_unref(&buf);
550 550
 }
551
+FF_ENABLE_DEPRECATION_WARNINGS
551 552
 #endif
552 553
 
553 554
 int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
... ...
@@ -601,6 +606,7 @@ int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
601 601
     frame->reordered_opaque = avctx->reordered_opaque;
602 602
 
603 603
 #if FF_API_GET_BUFFER
604
+FF_DISABLE_DEPRECATION_WARNINGS
604 605
     /*
605 606
      * Wrap an old get_buffer()-allocated buffer in an bunch of AVBuffers.
606 607
      * We wrap each plane in its own AVBuffer. Each of those has a reference to
... ...
@@ -712,6 +718,7 @@ fail:
712 712
         av_buffer_unref(&dummy_buf);
713 713
         return ret;
714 714
     }
715
+FF_ENABLE_DEPRECATION_WARNINGS
715 716
 #endif
716 717
 
717 718
     ret = avctx->get_buffer2(avctx, frame, flags);
... ...
@@ -1095,7 +1102,9 @@ int ff_alloc_packet(AVPacket *avpkt, int size)
1095 1095
     if (avpkt->data) {
1096 1096
         AVBufferRef *buf = avpkt->buf;
1097 1097
 #if FF_API_DESTRUCT_PACKET
1098
+FF_DISABLE_DEPRECATION_WARNINGS
1098 1099
         void *destruct = avpkt->destruct;
1100
+FF_ENABLE_DEPRECATION_WARNINGS
1099 1101
 #endif
1100 1102
 
1101 1103
         if (avpkt->size < size)
... ...
@@ -1103,7 +1112,9 @@ int ff_alloc_packet(AVPacket *avpkt, int size)
1103 1103
 
1104 1104
         av_init_packet(avpkt);
1105 1105
 #if FF_API_DESTRUCT_PACKET
1106
+FF_DISABLE_DEPRECATION_WARNINGS
1106 1107
         avpkt->destruct = destruct;
1108
+FF_ENABLE_DEPRECATION_WARNINGS
1107 1109
 #endif
1108 1110
         avpkt->buf      = buf;
1109 1111
         avpkt->size     = size;
... ...
@@ -2042,6 +2053,7 @@ int ff_match_2uint16(const uint16_t(*tab)[2], int size, int a, int b)
2042 2042
 }
2043 2043
 
2044 2044
 #if FF_API_MISSING_SAMPLE
2045
+FF_DISABLE_DEPRECATION_WARNINGS
2045 2046
 void av_log_missing_feature(void *avc, const char *feature, int want_sample)
2046 2047
 {
2047 2048
     av_log(avc, AV_LOG_WARNING, "%s is not implemented. Update your Libav "
... ...
@@ -2066,6 +2078,7 @@ void av_log_ask_for_sample(void *avc, const char *msg, ...)
2066 2066
 
2067 2067
     va_end(argument_list);
2068 2068
 }
2069
+FF_ENABLE_DEPRECATION_WARNINGS
2069 2070
 #endif /* FF_API_MISSING_SAMPLE */
2070 2071
 
2071 2072
 static AVHWAccel *first_hwaccel = NULL;
... ...
@@ -45,6 +45,7 @@
45 45
 #include "libavutil/atomic.h"
46 46
 #include "libavutil/avassert.h"
47 47
 #include "libavutil/imgutils.h"
48
+#include "libavutil/internal.h"
48 49
 #include "libavutil/log.h"
49 50
 #include "libavutil/opt.h"
50 51
 #include "libavutil/parseutils.h"
... ...
@@ -506,7 +507,9 @@ static int mmap_read_frame(AVFormatContext *ctx, AVPacket *pkt)
506 506
         pkt->data     = s->buf_start[buf.index];
507 507
         pkt->size     = buf.bytesused;
508 508
 #if FF_API_DESTRUCT_PACKET
509
+FF_DISABLE_DEPRECATION_WARNINGS
509 510
         pkt->destruct = dummy_release_buffer;
511
+FF_ENABLE_DEPRECATION_WARNINGS
510 512
 #endif
511 513
 
512 514
         buf_descriptor = av_malloc(sizeof(struct buff_data));
... ...
@@ -23,6 +23,7 @@
23 23
 #include "libavutil/channel_layout.h"
24 24
 #include "libavutil/common.h"
25 25
 #include "libavutil/imgutils.h"
26
+#include "libavutil/internal.h"
26 27
 #include "libavutil/opt.h"
27 28
 #include "libavutil/pixdesc.h"
28 29
 #include "libavutil/rational.h"
... ...
@@ -436,8 +437,10 @@ AVFilterContext *ff_filter_alloc(const AVFilter *filter, const char *inst_name)
436 436
             goto err;
437 437
     }
438 438
 #if FF_API_FOO_COUNT
439
+FF_DISABLE_DEPRECATION_WARNINGS
439 440
     ret->output_count = ret->nb_outputs;
440 441
     ret->input_count  = ret->nb_inputs;
442
+FF_ENABLE_DEPRECATION_WARNINGS
441 443
 #endif
442 444
 
443 445
     return ret;
... ...
@@ -28,6 +28,7 @@
28 28
 #include "libavutil/avstring.h"
29 29
 #include "libavutil/channel_layout.h"
30 30
 #include "libavutil/common.h"
31
+#include "libavutil/internal.h"
31 32
 #include "libavutil/log.h"
32 33
 #include "libavutil/opt.h"
33 34
 
... ...
@@ -127,7 +128,9 @@ int avfilter_graph_add_filter(AVFilterGraph *graph, AVFilterContext *filter)
127 127
     graph->filters[graph->nb_filters++] = filter;
128 128
 
129 129
 #if FF_API_FOO_COUNT
130
+FF_DISABLE_DEPRECATION_WARNINGS
130 131
     graph->filter_count = graph->nb_filters;
132
+FF_ENABLE_DEPRECATION_WARNINGS
131 133
 #endif
132 134
 
133 135
     filter->graph = graph;
... ...
@@ -187,7 +190,9 @@ AVFilterContext *avfilter_graph_alloc_filter(AVFilterGraph *graph,
187 187
     graph->filters[graph->nb_filters++] = s;
188 188
 
189 189
 #if FF_API_FOO_COUNT
190
+FF_DISABLE_DEPRECATION_WARNINGS
190 191
     graph->filter_count = graph->nb_filters;
192
+FF_ENABLE_DEPRECATION_WARNINGS
191 193
 #endif
192 194
 
193 195
     s->graph = graph;
... ...
@@ -27,6 +27,7 @@
27 27
 #include "libavutil/avassert.h"
28 28
 #include "libavutil/channel_layout.h"
29 29
 #include "libavutil/common.h"
30
+#include "libavutil/internal.h"
30 31
 #include "libavutil/mathematics.h"
31 32
 
32 33
 #include "audio.h"
... ...
@@ -137,6 +138,7 @@ int attribute_align_arg av_buffersink_get_samples(AVFilterContext *ctx,
137 137
 }
138 138
 
139 139
 #if FF_API_AVFILTERBUFFER
140
+FF_DISABLE_DEPRECATION_WARNINGS
140 141
 static void compat_free_buffer(AVFilterBuffer *buf)
141 142
 {
142 143
     AVFrame *frame = buf->priv;
... ...
@@ -206,6 +208,7 @@ int attribute_align_arg av_buffersink_read_samples(AVFilterContext *ctx, AVFilte
206 206
 {
207 207
     return compat_read(ctx, buf, nb_samples);
208 208
 }
209
+FF_ENABLE_DEPRECATION_WARNINGS
209 210
 #endif
210 211
 
211 212
 static const AVFilterPad avfilter_vsink_buffer_inputs[] = {
... ...
@@ -30,6 +30,7 @@
30 30
 #include "libavutil/fifo.h"
31 31
 #include "libavutil/frame.h"
32 32
 #include "libavutil/imgutils.h"
33
+#include "libavutil/internal.h"
33 34
 #include "libavutil/opt.h"
34 35
 #include "libavutil/samplefmt.h"
35 36
 #include "audio.h"
... ...
@@ -133,6 +134,7 @@ int attribute_align_arg av_buffersrc_add_frame(AVFilterContext *ctx,
133 133
 }
134 134
 
135 135
 #if FF_API_AVFILTERBUFFER
136
+FF_DISABLE_DEPRECATION_WARNINGS
136 137
 static void compat_free_buffer(void *opaque, uint8_t *data)
137 138
 {
138 139
     AVFilterBufferRef *buf = opaque;
... ...
@@ -235,6 +237,7 @@ fail:
235 235
 
236 236
     return ret;
237 237
 }
238
+FF_ENABLE_DEPRECATION_WARNINGS
238 239
 #endif
239 240
 
240 241
 static av_cold int init_video(AVFilterContext *ctx)
... ...
@@ -24,6 +24,7 @@
24 24
  * internal API functions
25 25
  */
26 26
 
27
+#include "libavutil/internal.h"
27 28
 #include "avfilter.h"
28 29
 #include "thread.h"
29 30
 #include "version.h"
... ...
@@ -166,7 +167,9 @@ static inline void ff_insert_inpad(AVFilterContext *f, unsigned index,
166 166
     ff_insert_pad(index, &f->nb_inputs, offsetof(AVFilterLink, dstpad),
167 167
                   &f->input_pads, &f->inputs, p);
168 168
 #if FF_API_FOO_COUNT
169
+FF_DISABLE_DEPRECATION_WARNINGS
169 170
     f->input_count = f->nb_inputs;
171
+FF_ENABLE_DEPRECATION_WARNINGS
170 172
 #endif
171 173
 }
172 174
 
... ...
@@ -177,7 +180,9 @@ static inline void ff_insert_outpad(AVFilterContext *f, unsigned index,
177 177
     ff_insert_pad(index, &f->nb_outputs, offsetof(AVFilterLink, srcpad),
178 178
                   &f->output_pads, &f->outputs, p);
179 179
 #if FF_API_FOO_COUNT
180
+FF_DISABLE_DEPRECATION_WARNINGS
180 181
     f->output_count = f->nb_outputs;
182
+FF_ENABLE_DEPRECATION_WARNINGS
181 183
 #endif
182 184
 }
183 185
 
... ...
@@ -25,6 +25,7 @@
25 25
 #include "libavutil/bswap.h"
26 26
 #include "libavutil/common.h"
27 27
 #include "libavutil/dict.h"
28
+#include "libavutil/internal.h"
28 29
 #include "libavutil/mathematics.h"
29 30
 #include "libavutil/opt.h"
30 31
 #include "avformat.h"
... ...
@@ -1252,7 +1253,9 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
1252 1252
             asf_st->frag_offset         = 0;
1253 1253
             *pkt                        = asf_st->pkt;
1254 1254
 #if FF_API_DESTRUCT_PACKET
1255
+FF_DISABLE_DEPRECATION_WARNINGS
1255 1256
             asf_st->pkt.destruct        = NULL;
1257
+FF_ENABLE_DEPRECATION_WARNINGS
1256 1258
 #endif
1257 1259
             asf_st->pkt.buf             = 0;
1258 1260
             asf_st->pkt.size            = 0;
... ...
@@ -22,6 +22,7 @@
22 22
 #include "libavutil/avstring.h"
23 23
 #include "libavutil/bswap.h"
24 24
 #include "libavutil/dict.h"
25
+#include "libavutil/internal.h"
25 26
 #include "libavutil/intreadwrite.h"
26 27
 #include "libavutil/mathematics.h"
27 28
 #include "avformat.h"
... ...
@@ -1165,12 +1166,16 @@ resync:
1165 1165
         if (CONFIG_DV_DEMUXER && avi->dv_demux) {
1166 1166
             AVBufferRef *avbuf = pkt->buf;
1167 1167
 #if FF_API_DESTRUCT_PACKET
1168
+FF_DISABLE_DEPRECATION_WARNINGS
1168 1169
             dstr = pkt->destruct;
1170
+FF_ENABLE_DEPRECATION_WARNINGS
1169 1171
 #endif
1170 1172
             size = avpriv_dv_produce_packet(avi->dv_demux, pkt,
1171 1173
                                             pkt->data, pkt->size);
1172 1174
 #if FF_API_DESTRUCT_PACKET
1175
+FF_DISABLE_DEPRECATION_WARNINGS
1173 1176
             pkt->destruct = dstr;
1177
+FF_ENABLE_DEPRECATION_WARNINGS
1174 1178
 #endif
1175 1179
             pkt->buf    = avbuf;
1176 1180
             pkt->flags |= AV_PKT_FLAG_KEY;
... ...
@@ -31,6 +31,7 @@
31 31
 #include "id3v2.h"
32 32
 #include "libavutil/avassert.h"
33 33
 #include "libavutil/avstring.h"
34
+#include "libavutil/internal.h"
34 35
 #include "libavutil/mathematics.h"
35 36
 #include "libavutil/parseutils.h"
36 37
 #include "libavutil/time.h"
... ...
@@ -452,7 +453,9 @@ void ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
452 452
     this_pktl      = av_mallocz(sizeof(AVPacketList));
453 453
     this_pktl->pkt = *pkt;
454 454
 #if FF_API_DESTRUCT_PACKET
455
+FF_DISABLE_DEPRECATION_WARNINGS
455 456
     pkt->destruct  = NULL;           // do not free original but only the copy
457
+FF_ENABLE_DEPRECATION_WARNINGS
456 458
 #endif
457 459
     pkt->buf       = NULL;
458 460
     av_dup_packet(&this_pktl->pkt);  // duplicate the packet if it uses non-alloced memory
... ...
@@ -20,6 +20,7 @@
20 20
  */
21 21
 
22 22
 #include "libavutil/channel_layout.h"
23
+#include "libavutil/internal.h"
23 24
 #include "libavutil/intreadwrite.h"
24 25
 #include "libavcodec/mjpeg.h"
25 26
 #include "avformat.h"
... ...
@@ -169,7 +170,9 @@ static int mxg_read_packet(AVFormatContext *s, AVPacket *pkt)
169 169
                 pkt->pts = pkt->dts = mxg->dts;
170 170
                 pkt->stream_index = 0;
171 171
 #if FF_API_DESTRUCT_PACKET
172
+FF_DISABLE_DEPRECATION_WARNINGS
172 173
                 pkt->destruct = NULL;
174
+FF_ENABLE_DEPRECATION_WARNINGS
173 175
 #endif
174 176
                 pkt->buf  = NULL;
175 177
                 pkt->size = mxg->buffer_ptr - mxg->soi_ptr;
... ...
@@ -210,7 +213,9 @@ static int mxg_read_packet(AVFormatContext *s, AVPacket *pkt)
210 210
                     pkt->pts = pkt->dts = AV_RL64(startmarker_ptr + 8);
211 211
                     pkt->stream_index = 1;
212 212
 #if FF_API_DESTRUCT_PACKET
213
+FF_DISABLE_DEPRECATION_WARNINGS
213 214
                     pkt->destruct = NULL;
215
+FF_ENABLE_DEPRECATION_WARNINGS
214 216
 #endif
215 217
                     pkt->buf  = NULL;
216 218
                     pkt->size = size - 14;
... ...
@@ -30,6 +30,7 @@
30 30
  */
31 31
 
32 32
 #include "libavutil/channel_layout.h"
33
+#include "libavutil/internal.h"
33 34
 #include "libavutil/intreadwrite.h"
34 35
 #include "avformat.h"
35 36
 #include "internal.h"
... ...
@@ -203,7 +204,9 @@ static int str_read_packet(AVFormatContext *s,
203 203
                     pkt->size= -1;
204 204
                     pkt->buf = NULL;
205 205
 #if FF_API_DESTRUCT_PACKET
206
+FF_DISABLE_DEPRECATION_WARNINGS
206 207
                     pkt->destruct = NULL;
208
+FF_ENABLE_DEPRECATION_WARNINGS
207 209
 #endif
208 210
                     return 0;
209 211
                 }
... ...
@@ -21,6 +21,7 @@
21 21
 
22 22
 #include "libavutil/avstring.h"
23 23
 #include "libavutil/channel_layout.h"
24
+#include "libavutil/internal.h"
24 25
 #include "libavutil/intreadwrite.h"
25 26
 #include "libavutil/dict.h"
26 27
 #include "avformat.h"
... ...
@@ -677,7 +678,9 @@ static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb,
677 677
         vst->pkt.size= 0;
678 678
         vst->pkt.buf = NULL;
679 679
 #if FF_API_DESTRUCT_PACKET
680
+FF_DISABLE_DEPRECATION_WARNINGS
680 681
         vst->pkt.destruct = NULL;
682
+FF_ENABLE_DEPRECATION_WARNINGS
681 683
 #endif
682 684
         if(vst->slices != vst->cur_slice) //FIXME find out how to set slices correct from the begin
683 685
             memmove(pkt->data + 1 + 8*vst->cur_slice, pkt->data + 1 + 8*vst->slices,
... ...
@@ -26,6 +26,7 @@
26 26
 #include "libavcodec/bytestream.h"
27 27
 #include "libavutil/opt.h"
28 28
 #include "libavutil/dict.h"
29
+#include "libavutil/internal.h"
29 30
 #include "libavutil/pixdesc.h"
30 31
 #include "metadata.h"
31 32
 #include "id3v2.h"
... ...
@@ -964,8 +965,10 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index)
964 964
             out_pkt.buf   = pkt->buf;
965 965
             pkt->buf      = NULL;
966 966
 #if FF_API_DESTRUCT_PACKET
967
+FF_DISABLE_DEPRECATION_WARNINGS
967 968
             out_pkt.destruct = pkt->destruct;
968 969
             pkt->destruct = NULL;
970
+FF_ENABLE_DEPRECATION_WARNINGS
969 971
 #endif
970 972
         }
971 973
         if ((ret = av_dup_packet(&out_pkt)) < 0)
... ...
@@ -25,7 +25,7 @@
25 25
 #include "common.h"
26 26
 #include "pixfmt.h"
27 27
 #include "pixdesc.h"
28
-
28
+#include "internal.h"
29 29
 #include "intreadwrite.h"
30 30
 
31 31
 void av_read_image_line(uint16_t *dst,
... ...
@@ -1392,6 +1392,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
1392 1392
     },
1393 1393
 };
1394 1394
 
1395
+FF_DISABLE_DEPRECATION_WARNINGS
1395 1396
 static enum AVPixelFormat get_pix_fmt_internal(const char *name)
1396 1397
 {
1397 1398
     enum AVPixelFormat pix_fmt;
... ...
@@ -1486,6 +1487,7 @@ enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc)
1486 1486
 
1487 1487
     return desc - av_pix_fmt_descriptors;
1488 1488
 }
1489
+FF_ENABLE_DEPRECATION_WARNINGS
1489 1490
 
1490 1491
 int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt,
1491 1492
                                      int *h_shift, int *v_shift)