summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2013-03-27 18:36:51 +0100
committerDiego Biurrun <diego@biurrun.de>2013-08-02 19:19:02 +0200
commit7950e519bb094897f957b9a9531cc60ba46cbc91 (patch)
treeb8bcd2acc2a699c2c219e690d439a3f3eb0a6a44 /libavcodec
parent3a7050ffed5ce061b114a11e4de4b77aba8efa0b (diff)
Disable deprecation warnings for cases where a replacement is available
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/avpacket.c15
-rw-r--r--libavcodec/mlp_parser.c5
-rw-r--r--libavcodec/mlpdec.c3
-rw-r--r--libavcodec/options_table.h3
-rw-r--r--libavcodec/pthread.c9
-rw-r--r--libavcodec/utils.c13
6 files changed, 48 insertions, 0 deletions
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index df88f3f186..2fc8bc00d1 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -23,6 +23,7 @@
#include "libavutil/avassert.h"
#include "libavutil/common.h"
+#include "libavutil/internal.h"
#include "libavutil/mem.h"
#include "avcodec.h"
@@ -52,7 +53,9 @@ void av_init_packet(AVPacket *pkt)
pkt->flags = 0;
pkt->stream_index = 0;
#if FF_API_DESTRUCT_PACKET
+FF_DISABLE_DEPRECATION_WARNINGS
pkt->destruct = NULL;
+FF_ENABLE_DEPRECATION_WARNINGS
#endif
pkt->buf = NULL;
pkt->side_data = NULL;
@@ -77,7 +80,9 @@ int av_new_packet(AVPacket *pkt, int size)
pkt->data = buf->data;
pkt->size = size;
#if FF_API_DESTRUCT_PACKET
+FF_DISABLE_DEPRECATION_WARNINGS
pkt->destruct = dummy_destruct_packet;
+FF_ENABLE_DEPRECATION_WARNINGS
#endif
return 0;
@@ -112,7 +117,9 @@ int av_grow_packet(AVPacket *pkt, int grow_by)
return AVERROR(ENOMEM);
memcpy(pkt->buf->data, pkt->data, FFMIN(pkt->size, pkt->size + grow_by));
#if FF_API_DESTRUCT_PACKET
+FF_DISABLE_DEPRECATION_WARNINGS
pkt->destruct = dummy_destruct_packet;
+FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
pkt->data = pkt->buf->data;
@@ -135,7 +142,9 @@ int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size)
pkt->data = data;
pkt->size = size;
#if FF_API_DESTRUCT_PACKET
+FF_DISABLE_DEPRECATION_WARNINGS
pkt->destruct = dummy_destruct_packet;
+FF_ENABLE_DEPRECATION_WARNINGS
#endif
return 0;
@@ -172,18 +181,22 @@ int av_dup_packet(AVPacket *pkt)
{
AVPacket tmp_pkt;
+FF_DISABLE_DEPRECATION_WARNINGS
if (!pkt->buf && pkt->data
#if FF_API_DESTRUCT_PACKET
&& !pkt->destruct
#endif
) {
+FF_ENABLE_DEPRECATION_WARNINGS
tmp_pkt = *pkt;
pkt->data = NULL;
pkt->side_data = NULL;
DUP_DATA(pkt->data, tmp_pkt.data, pkt->size, 1, ALLOC_BUF);
#if FF_API_DESTRUCT_PACKET
+FF_DISABLE_DEPRECATION_WARNINGS
pkt->destruct = dummy_destruct_packet;
+FF_ENABLE_DEPRECATION_WARNINGS
#endif
if (pkt->side_data_elems) {
@@ -213,6 +226,7 @@ void av_free_packet(AVPacket *pkt)
if (pkt) {
int i;
+FF_DISABLE_DEPRECATION_WARNINGS
if (pkt->buf)
av_buffer_unref(&pkt->buf);
#if FF_API_DESTRUCT_PACKET
@@ -220,6 +234,7 @@ void av_free_packet(AVPacket *pkt)
pkt->destruct(pkt);
pkt->destruct = NULL;
#endif
+FF_ENABLE_DEPRECATION_WARNINGS
pkt->data = NULL;
pkt->size = 0;
diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c
index 7f6739fabf..1a68014b32 100644
--- a/libavcodec/mlp_parser.c
+++ b/libavcodec/mlp_parser.c
@@ -28,6 +28,7 @@
#include "libavutil/channel_layout.h"
#include "libavutil/crc.h"
+#include "libavutil/internal.h"
#include "get_bits.h"
#include "parser.h"
#include "mlp_parser.h"
@@ -323,11 +324,13 @@ static int mlp_parse(AVCodecParserContext *s,
if (mh.stream_type == 0xbb) {
/* MLP stream */
#if FF_API_REQUEST_CHANNELS
+FF_DISABLE_DEPRECATION_WARNINGS
if (avctx->request_channels > 0 && avctx->request_channels <= 2 &&
mh.num_substreams > 1) {
avctx->channels = 2;
avctx->channel_layout = AV_CH_LAYOUT_STEREO;
} else
+FF_ENABLE_DEPRECATION_WARNINGS
#endif
if (avctx->request_channel_layout == AV_CH_LAYOUT_STEREO &&
mh.num_substreams > 1) {
@@ -340,6 +343,7 @@ static int mlp_parse(AVCodecParserContext *s,
} else { /* mh.stream_type == 0xba */
/* TrueHD stream */
#if FF_API_REQUEST_CHANNELS
+FF_DISABLE_DEPRECATION_WARNINGS
if (avctx->request_channels > 0 && avctx->request_channels <= 2 &&
mh.num_substreams > 1) {
avctx->channels = 2;
@@ -349,6 +353,7 @@ static int mlp_parse(AVCodecParserContext *s,
avctx->channels = mh.channels_thd_stream1;
avctx->channel_layout = mh.channel_layout_thd_stream1;
} else
+FF_ENABLE_DEPRECATION_WARNINGS
#endif
if (avctx->request_channel_layout == AV_CH_LAYOUT_STEREO &&
mh.num_substreams > 1) {
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index 73f51c5e40..3224cfb17d 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -27,6 +27,7 @@
#include <stdint.h>
#include "avcodec.h"
+#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/channel_layout.h"
#include "get_bits.h"
@@ -449,6 +450,7 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
s->max_matrix_channel = max_matrix_channel;
#if FF_API_REQUEST_CHANNELS
+FF_DISABLE_DEPRECATION_WARNINGS
if (m->avctx->request_channels > 0 &&
m->avctx->request_channels <= s->max_channel + 1 &&
m->max_decoded_substream > substr) {
@@ -458,6 +460,7 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
s->max_channel + 1, substr);
m->max_decoded_substream = substr;
} else
+FF_ENABLE_DEPRECATION_WARNINGS
#endif
if (m->avctx->request_channel_layout == s->ch_layout &&
m->max_decoded_substream > substr) {
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 5e9d484b28..851560384a 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -23,6 +23,7 @@
#include <float.h>
#include <limits.h>
+#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "version.h"
@@ -39,6 +40,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 }, INT_MIN, INT_MAX, V|A|E},
{"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[] = {
{"refcounted_frames", NULL, OFFSET(refcounted_frames), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, A|V|D },
{NULL},
};
+FF_ENABLE_DEPRECATION_WARNINGS
#undef A
#undef V
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index a4e48d329d..f4795f3444 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -37,6 +37,7 @@
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/cpu.h"
+#include "libavutil/internal.h"
#if HAVE_PTHREADS
#include <pthread.h>
@@ -408,8 +409,10 @@ static int update_context_from_user(AVCodecContext *dst, AVCodecContext *src)
dst->draw_horiz_band= src->draw_horiz_band;
dst->get_buffer2 = src->get_buffer2;
#if FF_API_GET_BUFFER
+FF_DISABLE_DEPRECATION_WARNINGS
dst->get_buffer = src->get_buffer;
dst->release_buffer = src->release_buffer;
+FF_ENABLE_DEPRECATION_WARNINGS
#endif
dst->opaque = src->opaque;
@@ -511,11 +514,13 @@ static int submit_packet(PerThreadContext *p, AVPacket *avpkt)
* and it calls back to the client here.
*/
+FF_DISABLE_DEPRECATION_WARNINGS
if (!p->avctx->thread_safe_callbacks && (
#if FF_API_GET_BUFFER
p->avctx->get_buffer ||
#endif
p->avctx->get_buffer2 != avcodec_default_get_buffer2)) {
+FF_ENABLE_DEPRECATION_WARNINGS
while (p->state != STATE_SETUP_FINISHED && p->state != STATE_INPUT_READY) {
pthread_mutex_lock(&p->progress_mutex);
while (p->state == STATE_SETTING_UP)
@@ -878,11 +883,13 @@ int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
}
pthread_mutex_lock(&p->parent->buffer_mutex);
+FF_DISABLE_DEPRECATION_WARNINGS
if (avctx->thread_safe_callbacks || (
#if FF_API_GET_BUFFER
!avctx->get_buffer &&
#endif
avctx->get_buffer2 == avcodec_default_get_buffer2)) {
+FF_ENABLE_DEPRECATION_WARNINGS
err = ff_get_buffer(avctx, f->f, flags);
} else {
p->requested_frame = f->f;
@@ -915,6 +922,7 @@ void ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f)
PerThreadContext *p = avctx->thread_opaque;
FrameThreadContext *fctx;
AVFrame *dst, *tmp;
+FF_DISABLE_DEPRECATION_WARNINGS
int can_direct_free = !(avctx->active_thread_type & FF_THREAD_FRAME) ||
avctx->thread_safe_callbacks ||
(
@@ -922,6 +930,7 @@ void ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f)
!avctx->get_buffer &&
#endif
avctx->get_buffer2 == avcodec_default_get_buffer2);
+FF_ENABLE_DEPRECATION_WARNINGS
if (!f->f->data[0])
return;
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index ee0b571f45..13419c7936 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -32,6 +32,7 @@
#include "libavutil/channel_layout.h"
#include "libavutil/crc.h"
#include "libavutil/frame.h"
+#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"
@@ -511,7 +512,9 @@ int avcodec_default_get_buffer2(AVCodecContext *avctx, AVFrame *frame, int flags
return ret;
#if FF_API_GET_BUFFER
+FF_DISABLE_DEPRECATION_WARNINGS
frame->type = FF_BUFFER_TYPE_INTERNAL;
+FF_ENABLE_DEPRECATION_WARNINGS
#endif
switch (avctx->codec_type) {
@@ -525,6 +528,7 @@ int avcodec_default_get_buffer2(AVCodecContext *avctx, AVFrame *frame, int flags
}
#if FF_API_GET_BUFFER
+FF_DISABLE_DEPRECATION_WARNINGS
int avcodec_default_get_buffer(AVCodecContext *avctx, AVFrame *frame)
{
return avcodec_default_get_buffer2(avctx, frame, 0);
@@ -548,6 +552,7 @@ static void compat_release_buffer(void *opaque, uint8_t *data)
AVBufferRef *buf = opaque;
av_buffer_unref(&buf);
}
+FF_ENABLE_DEPRECATION_WARNINGS
#endif
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
@@ -601,6 +606,7 @@ int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
frame->reordered_opaque = avctx->reordered_opaque;
#if FF_API_GET_BUFFER
+FF_DISABLE_DEPRECATION_WARNINGS
/*
* Wrap an old get_buffer()-allocated buffer in an bunch of AVBuffers.
* We wrap each plane in its own AVBuffer. Each of those has a reference to
@@ -712,6 +718,7 @@ fail:
av_buffer_unref(&dummy_buf);
return ret;
}
+FF_ENABLE_DEPRECATION_WARNINGS
#endif
ret = avctx->get_buffer2(avctx, frame, flags);
@@ -1095,7 +1102,9 @@ int ff_alloc_packet(AVPacket *avpkt, int size)
if (avpkt->data) {
AVBufferRef *buf = avpkt->buf;
#if FF_API_DESTRUCT_PACKET
+FF_DISABLE_DEPRECATION_WARNINGS
void *destruct = avpkt->destruct;
+FF_ENABLE_DEPRECATION_WARNINGS
#endif
if (avpkt->size < size)
@@ -1103,7 +1112,9 @@ int ff_alloc_packet(AVPacket *avpkt, int size)
av_init_packet(avpkt);
#if FF_API_DESTRUCT_PACKET
+FF_DISABLE_DEPRECATION_WARNINGS
avpkt->destruct = destruct;
+FF_ENABLE_DEPRECATION_WARNINGS
#endif
avpkt->buf = buf;
avpkt->size = size;
@@ -2042,6 +2053,7 @@ int ff_match_2uint16(const uint16_t(*tab)[2], int size, int a, int b)
}
#if FF_API_MISSING_SAMPLE
+FF_DISABLE_DEPRECATION_WARNINGS
void av_log_missing_feature(void *avc, const char *feature, int want_sample)
{
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, ...)
va_end(argument_list);
}
+FF_ENABLE_DEPRECATION_WARNINGS
#endif /* FF_API_MISSING_SAMPLE */
static AVHWAccel *first_hwaccel = NULL;