1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

disable deprecation warnings in deprecated code

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit is contained in:
Andreas Cadhalpun 2015-08-08 10:41:33 +02:00
parent 805f38b4d6
commit 095347ffe4
7 changed files with 23 additions and 2 deletions

View File

@ -1276,7 +1276,9 @@ static void setup_hwaccel_for_pixfmt(AVCodecContext *avctx)
s->pack_pblocks = 1;
#if FF_API_XVMC
FF_DISABLE_DEPRECATION_WARNINGS
avctx->xvmc_acceleration = 2;
FF_ENABLE_DEPRECATION_WARNINGS
#endif /* FF_API_XVMC */
}
}
@ -2919,6 +2921,7 @@ AVCodec ff_mpegvideo_decoder = {
#if FF_API_XVMC
#if CONFIG_MPEG_XVMC_DECODER
FF_DISABLE_DEPRECATION_WARNINGS
static av_cold int mpeg_mc_decode_init(AVCodecContext *avctx)
{
if (avctx->active_thread_type & FF_THREAD_SLICE)
@ -2950,7 +2953,7 @@ AVCodec ff_mpeg_xvmc_decoder = {
AV_CODEC_CAP_DELAY,
.flush = flush,
};
FF_ENABLE_DEPRECATION_WARNINGS
#endif
#endif /* FF_API_XVMC */

View File

@ -26,6 +26,7 @@
#include <limits.h>
#include <stdint.h>
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "version.h"
@ -41,6 +42,7 @@
#define AV_CODEC_DEFAULT_BITRATE 200*1000
FF_DISABLE_DEPRECATION_WARNINGS
static const AVOption avcodec_options[] = {
{"b", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT, {.i64 = AV_CODEC_DEFAULT_BITRATE }, 0, INT_MAX, A|V|E},
{"ab", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT, {.i64 = 128*1000 }, 0, INT_MAX, A|E},
@ -504,6 +506,7 @@ static const AVOption avcodec_options[] = {
{"video_size", "set video size", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, {.str=NULL}, 0, INT_MAX, 0 },
{NULL},
};
FF_ENABLE_DEPRECATION_WARNINGS
#undef A
#undef V

View File

@ -151,8 +151,10 @@ static attribute_align_arg void *frame_worker_thread(void *arg)
if (fctx->die) break;
FF_DISABLE_DEPRECATION_WARNINGS
if (!codec->update_thread_context && THREAD_SAFE_CALLBACKS(avctx))
ff_thread_finish_setup(avctx);
FF_ENABLE_DEPRECATION_WARNINGS
av_frame_unref(p->frame);
p->got_frame = 0;
@ -771,8 +773,10 @@ void ff_thread_flush(AVCodecContext *avctx)
int ff_thread_can_start_frame(AVCodecContext *avctx)
{
PerThreadContext *p = avctx->internal->thread_ctx;
FF_DISABLE_DEPRECATION_WARNINGS
if ((avctx->active_thread_type&FF_THREAD_FRAME) && p->state != STATE_SETTING_UP &&
(avctx->codec->update_thread_context || !THREAD_SAFE_CALLBACKS(avctx))) {
FF_ENABLE_DEPRECATION_WARNINGS
return 0;
}
return 1;
@ -790,8 +794,10 @@ static int thread_get_buffer_internal(AVCodecContext *avctx, ThreadFrame *f, int
if (!(avctx->active_thread_type & FF_THREAD_FRAME))
return ff_get_buffer(avctx, f->f, flags);
FF_DISABLE_DEPRECATION_WARNINGS
if (p->state != STATE_SETTING_UP &&
(avctx->codec->update_thread_context || !THREAD_SAFE_CALLBACKS(avctx))) {
FF_ENABLE_DEPRECATION_WARNINGS
av_log(avctx, AV_LOG_ERROR, "get_buffer() cannot be called after ff_thread_finish_setup()\n");
return -1;
}
@ -831,9 +837,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
pthread_mutex_unlock(&p->progress_mutex);
}
FF_DISABLE_DEPRECATION_WARNINGS
if (!THREAD_SAFE_CALLBACKS(avctx) && !avctx->codec->update_thread_context)
ff_thread_finish_setup(avctx);
FF_ENABLE_DEPRECATION_WARNINGS
if (err)
av_buffer_unref(&f->progress);

View File

@ -33,6 +33,7 @@
#include "libavutil/samplefmt.h"
#if FF_API_AVCODEC_RESAMPLE
FF_DISABLE_DEPRECATION_WARNINGS
#define MAX_CHANNELS 8
@ -440,4 +441,5 @@ void audio_resample_close(ReSampleContext *s)
av_free(s);
}
FF_ENABLE_DEPRECATION_WARNINGS
#endif

View File

@ -81,6 +81,7 @@ AVFrame *ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
}
#if FF_API_AVFILTERBUFFER
FF_DISABLE_DEPRECATION_WARNINGS
AVFilterBufferRef* avfilter_get_audio_buffer_ref_from_arrays_channels(uint8_t **data,
int linesize,int perms,
int nb_samples,
@ -167,4 +168,5 @@ AVFilterBufferRef* avfilter_get_audio_buffer_ref_from_arrays(uint8_t **data,
nb_samples, sample_fmt,
channels, channel_layout);
}
FF_ENABLE_DEPRECATION_WARNINGS
#endif

View File

@ -29,6 +29,7 @@
#include "libavutil/opt.h"
#if FF_API_AVFILTERBUFFER
FF_DISABLE_DEPRECATION_WARNINGS
AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame,
int perms)
{
@ -134,4 +135,5 @@ int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src)
return 0;
}
FF_ENABLE_DEPRECATION_WARNINGS
#endif

View File

@ -290,7 +290,9 @@ static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy)
dst->sample_rate = src->sample_rate;
dst->opaque = src->opaque;
#if FF_API_AVFRAME_LAVC
FF_DISABLE_DEPRECATION_WARNINGS
dst->type = src->type;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
dst->pkt_pts = src->pkt_pts;
dst->pkt_dts = src->pkt_dts;