| @@ -23,6 +23,7 @@ | |||||
| #include "libavutil/avassert.h" | #include "libavutil/avassert.h" | ||||
| #include "libavutil/common.h" | #include "libavutil/common.h" | ||||
| #include "libavutil/internal.h" | |||||
| #include "libavutil/mem.h" | #include "libavutil/mem.h" | ||||
| #include "avcodec.h" | #include "avcodec.h" | ||||
| @@ -52,7 +53,9 @@ void av_init_packet(AVPacket *pkt) | |||||
| pkt->flags = 0; | pkt->flags = 0; | ||||
| pkt->stream_index = 0; | pkt->stream_index = 0; | ||||
| #if FF_API_DESTRUCT_PACKET | #if FF_API_DESTRUCT_PACKET | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| pkt->destruct = NULL; | pkt->destruct = NULL; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| pkt->buf = NULL; | pkt->buf = NULL; | ||||
| pkt->side_data = NULL; | pkt->side_data = NULL; | ||||
| @@ -77,7 +80,9 @@ int av_new_packet(AVPacket *pkt, int size) | |||||
| pkt->data = buf->data; | pkt->data = buf->data; | ||||
| pkt->size = size; | pkt->size = size; | ||||
| #if FF_API_DESTRUCT_PACKET | #if FF_API_DESTRUCT_PACKET | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| pkt->destruct = dummy_destruct_packet; | pkt->destruct = dummy_destruct_packet; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| return 0; | return 0; | ||||
| @@ -112,7 +117,9 @@ int av_grow_packet(AVPacket *pkt, int grow_by) | |||||
| return AVERROR(ENOMEM); | return AVERROR(ENOMEM); | ||||
| memcpy(pkt->buf->data, pkt->data, FFMIN(pkt->size, pkt->size + grow_by)); | memcpy(pkt->buf->data, pkt->data, FFMIN(pkt->size, pkt->size + grow_by)); | ||||
| #if FF_API_DESTRUCT_PACKET | #if FF_API_DESTRUCT_PACKET | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| pkt->destruct = dummy_destruct_packet; | pkt->destruct = dummy_destruct_packet; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| } | } | ||||
| pkt->data = pkt->buf->data; | 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->data = data; | ||||
| pkt->size = size; | pkt->size = size; | ||||
| #if FF_API_DESTRUCT_PACKET | #if FF_API_DESTRUCT_PACKET | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| pkt->destruct = dummy_destruct_packet; | pkt->destruct = dummy_destruct_packet; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| return 0; | return 0; | ||||
| @@ -172,18 +181,22 @@ int av_dup_packet(AVPacket *pkt) | |||||
| { | { | ||||
| AVPacket tmp_pkt; | AVPacket tmp_pkt; | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| if (!pkt->buf && pkt->data | if (!pkt->buf && pkt->data | ||||
| #if FF_API_DESTRUCT_PACKET | #if FF_API_DESTRUCT_PACKET | ||||
| && !pkt->destruct | && !pkt->destruct | ||||
| #endif | #endif | ||||
| ) { | ) { | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| tmp_pkt = *pkt; | tmp_pkt = *pkt; | ||||
| pkt->data = NULL; | pkt->data = NULL; | ||||
| pkt->side_data = NULL; | pkt->side_data = NULL; | ||||
| DUP_DATA(pkt->data, tmp_pkt.data, pkt->size, 1, ALLOC_BUF); | DUP_DATA(pkt->data, tmp_pkt.data, pkt->size, 1, ALLOC_BUF); | ||||
| #if FF_API_DESTRUCT_PACKET | #if FF_API_DESTRUCT_PACKET | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| pkt->destruct = dummy_destruct_packet; | pkt->destruct = dummy_destruct_packet; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| if (pkt->side_data_elems) { | if (pkt->side_data_elems) { | ||||
| @@ -213,6 +226,7 @@ void av_free_packet(AVPacket *pkt) | |||||
| if (pkt) { | if (pkt) { | ||||
| int i; | int i; | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| if (pkt->buf) | if (pkt->buf) | ||||
| av_buffer_unref(&pkt->buf); | av_buffer_unref(&pkt->buf); | ||||
| #if FF_API_DESTRUCT_PACKET | #if FF_API_DESTRUCT_PACKET | ||||
| @@ -220,6 +234,7 @@ void av_free_packet(AVPacket *pkt) | |||||
| pkt->destruct(pkt); | pkt->destruct(pkt); | ||||
| pkt->destruct = NULL; | pkt->destruct = NULL; | ||||
| #endif | #endif | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| pkt->data = NULL; | pkt->data = NULL; | ||||
| pkt->size = 0; | pkt->size = 0; | ||||
| @@ -28,6 +28,7 @@ | |||||
| #include "libavutil/channel_layout.h" | #include "libavutil/channel_layout.h" | ||||
| #include "libavutil/crc.h" | #include "libavutil/crc.h" | ||||
| #include "libavutil/internal.h" | |||||
| #include "get_bits.h" | #include "get_bits.h" | ||||
| #include "parser.h" | #include "parser.h" | ||||
| #include "mlp_parser.h" | #include "mlp_parser.h" | ||||
| @@ -323,11 +324,13 @@ static int mlp_parse(AVCodecParserContext *s, | |||||
| if (mh.stream_type == 0xbb) { | if (mh.stream_type == 0xbb) { | ||||
| /* MLP stream */ | /* MLP stream */ | ||||
| #if FF_API_REQUEST_CHANNELS | #if FF_API_REQUEST_CHANNELS | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| if (avctx->request_channels > 0 && avctx->request_channels <= 2 && | if (avctx->request_channels > 0 && avctx->request_channels <= 2 && | ||||
| mh.num_substreams > 1) { | mh.num_substreams > 1) { | ||||
| avctx->channels = 2; | avctx->channels = 2; | ||||
| avctx->channel_layout = AV_CH_LAYOUT_STEREO; | avctx->channel_layout = AV_CH_LAYOUT_STEREO; | ||||
| } else | } else | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| if (avctx->request_channel_layout == AV_CH_LAYOUT_STEREO && | if (avctx->request_channel_layout == AV_CH_LAYOUT_STEREO && | ||||
| mh.num_substreams > 1) { | mh.num_substreams > 1) { | ||||
| @@ -340,6 +343,7 @@ static int mlp_parse(AVCodecParserContext *s, | |||||
| } else { /* mh.stream_type == 0xba */ | } else { /* mh.stream_type == 0xba */ | ||||
| /* TrueHD stream */ | /* TrueHD stream */ | ||||
| #if FF_API_REQUEST_CHANNELS | #if FF_API_REQUEST_CHANNELS | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| if (avctx->request_channels > 0 && avctx->request_channels <= 2 && | if (avctx->request_channels > 0 && avctx->request_channels <= 2 && | ||||
| mh.num_substreams > 1) { | mh.num_substreams > 1) { | ||||
| avctx->channels = 2; | avctx->channels = 2; | ||||
| @@ -349,6 +353,7 @@ static int mlp_parse(AVCodecParserContext *s, | |||||
| avctx->channels = mh.channels_thd_stream1; | avctx->channels = mh.channels_thd_stream1; | ||||
| avctx->channel_layout = mh.channel_layout_thd_stream1; | avctx->channel_layout = mh.channel_layout_thd_stream1; | ||||
| } else | } else | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| if (avctx->request_channel_layout == AV_CH_LAYOUT_STEREO && | if (avctx->request_channel_layout == AV_CH_LAYOUT_STEREO && | ||||
| mh.num_substreams > 1) { | mh.num_substreams > 1) { | ||||
| @@ -27,6 +27,7 @@ | |||||
| #include <stdint.h> | #include <stdint.h> | ||||
| #include "avcodec.h" | #include "avcodec.h" | ||||
| #include "libavutil/internal.h" | |||||
| #include "libavutil/intreadwrite.h" | #include "libavutil/intreadwrite.h" | ||||
| #include "libavutil/channel_layout.h" | #include "libavutil/channel_layout.h" | ||||
| #include "get_bits.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; | s->max_matrix_channel = max_matrix_channel; | ||||
| #if FF_API_REQUEST_CHANNELS | #if FF_API_REQUEST_CHANNELS | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| if (m->avctx->request_channels > 0 && | if (m->avctx->request_channels > 0 && | ||||
| m->avctx->request_channels <= s->max_channel + 1 && | m->avctx->request_channels <= s->max_channel + 1 && | ||||
| m->max_decoded_substream > substr) { | m->max_decoded_substream > substr) { | ||||
| @@ -458,6 +460,7 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp, | |||||
| s->max_channel + 1, substr); | s->max_channel + 1, substr); | ||||
| m->max_decoded_substream = substr; | m->max_decoded_substream = substr; | ||||
| } else | } else | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| if (m->avctx->request_channel_layout == s->ch_layout && | if (m->avctx->request_channel_layout == s->ch_layout && | ||||
| m->max_decoded_substream > substr) { | m->max_decoded_substream > substr) { | ||||
| @@ -23,6 +23,7 @@ | |||||
| #include <float.h> | #include <float.h> | ||||
| #include <limits.h> | #include <limits.h> | ||||
| #include "libavutil/internal.h" | |||||
| #include "libavutil/opt.h" | #include "libavutil/opt.h" | ||||
| #include "avcodec.h" | #include "avcodec.h" | ||||
| #include "version.h" | #include "version.h" | ||||
| @@ -39,6 +40,7 @@ | |||||
| #define AV_CODEC_DEFAULT_BITRATE 200*1000 | #define AV_CODEC_DEFAULT_BITRATE 200*1000 | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| static const AVOption avcodec_options[] = { | 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}, | {"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 " | {"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 }, | {"refcounted_frames", NULL, OFFSET(refcounted_frames), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, A|V|D }, | ||||
| {NULL}, | {NULL}, | ||||
| }; | }; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #undef A | #undef A | ||||
| #undef V | #undef V | ||||
| @@ -37,6 +37,7 @@ | |||||
| #include "libavutil/avassert.h" | #include "libavutil/avassert.h" | ||||
| #include "libavutil/common.h" | #include "libavutil/common.h" | ||||
| #include "libavutil/cpu.h" | #include "libavutil/cpu.h" | ||||
| #include "libavutil/internal.h" | |||||
| #if HAVE_PTHREADS | #if HAVE_PTHREADS | ||||
| #include <pthread.h> | #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->draw_horiz_band= src->draw_horiz_band; | ||||
| dst->get_buffer2 = src->get_buffer2; | dst->get_buffer2 = src->get_buffer2; | ||||
| #if FF_API_GET_BUFFER | #if FF_API_GET_BUFFER | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| dst->get_buffer = src->get_buffer; | dst->get_buffer = src->get_buffer; | ||||
| dst->release_buffer = src->release_buffer; | dst->release_buffer = src->release_buffer; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| dst->opaque = src->opaque; | dst->opaque = src->opaque; | ||||
| @@ -511,11 +514,13 @@ static int submit_packet(PerThreadContext *p, AVPacket *avpkt) | |||||
| * and it calls back to the client here. | * and it calls back to the client here. | ||||
| */ | */ | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| if (!p->avctx->thread_safe_callbacks && ( | if (!p->avctx->thread_safe_callbacks && ( | ||||
| #if FF_API_GET_BUFFER | #if FF_API_GET_BUFFER | ||||
| p->avctx->get_buffer || | p->avctx->get_buffer || | ||||
| #endif | #endif | ||||
| p->avctx->get_buffer2 != avcodec_default_get_buffer2)) { | p->avctx->get_buffer2 != avcodec_default_get_buffer2)) { | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| while (p->state != STATE_SETUP_FINISHED && p->state != STATE_INPUT_READY) { | while (p->state != STATE_SETUP_FINISHED && p->state != STATE_INPUT_READY) { | ||||
| pthread_mutex_lock(&p->progress_mutex); | pthread_mutex_lock(&p->progress_mutex); | ||||
| while (p->state == STATE_SETTING_UP) | 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); | pthread_mutex_lock(&p->parent->buffer_mutex); | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| if (avctx->thread_safe_callbacks || ( | if (avctx->thread_safe_callbacks || ( | ||||
| #if FF_API_GET_BUFFER | #if FF_API_GET_BUFFER | ||||
| !avctx->get_buffer && | !avctx->get_buffer && | ||||
| #endif | #endif | ||||
| avctx->get_buffer2 == avcodec_default_get_buffer2)) { | avctx->get_buffer2 == avcodec_default_get_buffer2)) { | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| err = ff_get_buffer(avctx, f->f, flags); | err = ff_get_buffer(avctx, f->f, flags); | ||||
| } else { | } else { | ||||
| p->requested_frame = f->f; | p->requested_frame = f->f; | ||||
| @@ -915,6 +922,7 @@ void ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f) | |||||
| PerThreadContext *p = avctx->thread_opaque; | PerThreadContext *p = avctx->thread_opaque; | ||||
| FrameThreadContext *fctx; | FrameThreadContext *fctx; | ||||
| AVFrame *dst, *tmp; | AVFrame *dst, *tmp; | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| int can_direct_free = !(avctx->active_thread_type & FF_THREAD_FRAME) || | int can_direct_free = !(avctx->active_thread_type & FF_THREAD_FRAME) || | ||||
| avctx->thread_safe_callbacks || | avctx->thread_safe_callbacks || | ||||
| ( | ( | ||||
| @@ -922,6 +930,7 @@ void ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f) | |||||
| !avctx->get_buffer && | !avctx->get_buffer && | ||||
| #endif | #endif | ||||
| avctx->get_buffer2 == avcodec_default_get_buffer2); | avctx->get_buffer2 == avcodec_default_get_buffer2); | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| if (!f->f->data[0]) | if (!f->f->data[0]) | ||||
| return; | return; | ||||
| @@ -32,6 +32,7 @@ | |||||
| #include "libavutil/channel_layout.h" | #include "libavutil/channel_layout.h" | ||||
| #include "libavutil/crc.h" | #include "libavutil/crc.h" | ||||
| #include "libavutil/frame.h" | #include "libavutil/frame.h" | ||||
| #include "libavutil/internal.h" | |||||
| #include "libavutil/mathematics.h" | #include "libavutil/mathematics.h" | ||||
| #include "libavutil/pixdesc.h" | #include "libavutil/pixdesc.h" | ||||
| #include "libavutil/imgutils.h" | #include "libavutil/imgutils.h" | ||||
| @@ -511,7 +512,9 @@ int avcodec_default_get_buffer2(AVCodecContext *avctx, AVFrame *frame, int flags | |||||
| return ret; | return ret; | ||||
| #if FF_API_GET_BUFFER | #if FF_API_GET_BUFFER | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| frame->type = FF_BUFFER_TYPE_INTERNAL; | frame->type = FF_BUFFER_TYPE_INTERNAL; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| switch (avctx->codec_type) { | switch (avctx->codec_type) { | ||||
| @@ -525,6 +528,7 @@ int avcodec_default_get_buffer2(AVCodecContext *avctx, AVFrame *frame, int flags | |||||
| } | } | ||||
| #if FF_API_GET_BUFFER | #if FF_API_GET_BUFFER | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| int avcodec_default_get_buffer(AVCodecContext *avctx, AVFrame *frame) | int avcodec_default_get_buffer(AVCodecContext *avctx, AVFrame *frame) | ||||
| { | { | ||||
| return avcodec_default_get_buffer2(avctx, frame, 0); | 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; | AVBufferRef *buf = opaque; | ||||
| av_buffer_unref(&buf); | av_buffer_unref(&buf); | ||||
| } | } | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags) | 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; | frame->reordered_opaque = avctx->reordered_opaque; | ||||
| #if FF_API_GET_BUFFER | #if FF_API_GET_BUFFER | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| /* | /* | ||||
| * Wrap an old get_buffer()-allocated buffer in an bunch of AVBuffers. | * 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 | * 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); | av_buffer_unref(&dummy_buf); | ||||
| return ret; | return ret; | ||||
| } | } | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| ret = avctx->get_buffer2(avctx, frame, flags); | ret = avctx->get_buffer2(avctx, frame, flags); | ||||
| @@ -1095,7 +1102,9 @@ int ff_alloc_packet(AVPacket *avpkt, int size) | |||||
| if (avpkt->data) { | if (avpkt->data) { | ||||
| AVBufferRef *buf = avpkt->buf; | AVBufferRef *buf = avpkt->buf; | ||||
| #if FF_API_DESTRUCT_PACKET | #if FF_API_DESTRUCT_PACKET | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| void *destruct = avpkt->destruct; | void *destruct = avpkt->destruct; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| if (avpkt->size < size) | if (avpkt->size < size) | ||||
| @@ -1103,7 +1112,9 @@ int ff_alloc_packet(AVPacket *avpkt, int size) | |||||
| av_init_packet(avpkt); | av_init_packet(avpkt); | ||||
| #if FF_API_DESTRUCT_PACKET | #if FF_API_DESTRUCT_PACKET | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| avpkt->destruct = destruct; | avpkt->destruct = destruct; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| avpkt->buf = buf; | avpkt->buf = buf; | ||||
| avpkt->size = size; | 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 | #if FF_API_MISSING_SAMPLE | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| void av_log_missing_feature(void *avc, const char *feature, int want_sample) | 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 " | 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); | va_end(argument_list); | ||||
| } | } | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif /* FF_API_MISSING_SAMPLE */ | #endif /* FF_API_MISSING_SAMPLE */ | ||||
| static AVHWAccel *first_hwaccel = NULL; | static AVHWAccel *first_hwaccel = NULL; | ||||
| @@ -45,6 +45,7 @@ | |||||
| #include "libavutil/atomic.h" | #include "libavutil/atomic.h" | ||||
| #include "libavutil/avassert.h" | #include "libavutil/avassert.h" | ||||
| #include "libavutil/imgutils.h" | #include "libavutil/imgutils.h" | ||||
| #include "libavutil/internal.h" | |||||
| #include "libavutil/log.h" | #include "libavutil/log.h" | ||||
| #include "libavutil/opt.h" | #include "libavutil/opt.h" | ||||
| #include "libavutil/parseutils.h" | #include "libavutil/parseutils.h" | ||||
| @@ -506,7 +507,9 @@ static int mmap_read_frame(AVFormatContext *ctx, AVPacket *pkt) | |||||
| pkt->data = s->buf_start[buf.index]; | pkt->data = s->buf_start[buf.index]; | ||||
| pkt->size = buf.bytesused; | pkt->size = buf.bytesused; | ||||
| #if FF_API_DESTRUCT_PACKET | #if FF_API_DESTRUCT_PACKET | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| pkt->destruct = dummy_release_buffer; | pkt->destruct = dummy_release_buffer; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| buf_descriptor = av_malloc(sizeof(struct buff_data)); | buf_descriptor = av_malloc(sizeof(struct buff_data)); | ||||
| @@ -23,6 +23,7 @@ | |||||
| #include "libavutil/channel_layout.h" | #include "libavutil/channel_layout.h" | ||||
| #include "libavutil/common.h" | #include "libavutil/common.h" | ||||
| #include "libavutil/imgutils.h" | #include "libavutil/imgutils.h" | ||||
| #include "libavutil/internal.h" | |||||
| #include "libavutil/opt.h" | #include "libavutil/opt.h" | ||||
| #include "libavutil/pixdesc.h" | #include "libavutil/pixdesc.h" | ||||
| #include "libavutil/rational.h" | #include "libavutil/rational.h" | ||||
| @@ -436,8 +437,10 @@ AVFilterContext *ff_filter_alloc(const AVFilter *filter, const char *inst_name) | |||||
| goto err; | goto err; | ||||
| } | } | ||||
| #if FF_API_FOO_COUNT | #if FF_API_FOO_COUNT | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| ret->output_count = ret->nb_outputs; | ret->output_count = ret->nb_outputs; | ||||
| ret->input_count = ret->nb_inputs; | ret->input_count = ret->nb_inputs; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| return ret; | return ret; | ||||
| @@ -28,6 +28,7 @@ | |||||
| #include "libavutil/avstring.h" | #include "libavutil/avstring.h" | ||||
| #include "libavutil/channel_layout.h" | #include "libavutil/channel_layout.h" | ||||
| #include "libavutil/common.h" | #include "libavutil/common.h" | ||||
| #include "libavutil/internal.h" | |||||
| #include "libavutil/log.h" | #include "libavutil/log.h" | ||||
| #include "libavutil/opt.h" | #include "libavutil/opt.h" | ||||
| @@ -127,7 +128,9 @@ int avfilter_graph_add_filter(AVFilterGraph *graph, AVFilterContext *filter) | |||||
| graph->filters[graph->nb_filters++] = filter; | graph->filters[graph->nb_filters++] = filter; | ||||
| #if FF_API_FOO_COUNT | #if FF_API_FOO_COUNT | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| graph->filter_count = graph->nb_filters; | graph->filter_count = graph->nb_filters; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| filter->graph = graph; | filter->graph = graph; | ||||
| @@ -187,7 +190,9 @@ AVFilterContext *avfilter_graph_alloc_filter(AVFilterGraph *graph, | |||||
| graph->filters[graph->nb_filters++] = s; | graph->filters[graph->nb_filters++] = s; | ||||
| #if FF_API_FOO_COUNT | #if FF_API_FOO_COUNT | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| graph->filter_count = graph->nb_filters; | graph->filter_count = graph->nb_filters; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| s->graph = graph; | s->graph = graph; | ||||
| @@ -27,6 +27,7 @@ | |||||
| #include "libavutil/avassert.h" | #include "libavutil/avassert.h" | ||||
| #include "libavutil/channel_layout.h" | #include "libavutil/channel_layout.h" | ||||
| #include "libavutil/common.h" | #include "libavutil/common.h" | ||||
| #include "libavutil/internal.h" | |||||
| #include "libavutil/mathematics.h" | #include "libavutil/mathematics.h" | ||||
| #include "audio.h" | #include "audio.h" | ||||
| @@ -137,6 +138,7 @@ int attribute_align_arg av_buffersink_get_samples(AVFilterContext *ctx, | |||||
| } | } | ||||
| #if FF_API_AVFILTERBUFFER | #if FF_API_AVFILTERBUFFER | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| static void compat_free_buffer(AVFilterBuffer *buf) | static void compat_free_buffer(AVFilterBuffer *buf) | ||||
| { | { | ||||
| AVFrame *frame = buf->priv; | AVFrame *frame = buf->priv; | ||||
| @@ -206,6 +208,7 @@ int attribute_align_arg av_buffersink_read_samples(AVFilterContext *ctx, AVFilte | |||||
| { | { | ||||
| return compat_read(ctx, buf, nb_samples); | return compat_read(ctx, buf, nb_samples); | ||||
| } | } | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| static const AVFilterPad avfilter_vsink_buffer_inputs[] = { | static const AVFilterPad avfilter_vsink_buffer_inputs[] = { | ||||
| @@ -30,6 +30,7 @@ | |||||
| #include "libavutil/fifo.h" | #include "libavutil/fifo.h" | ||||
| #include "libavutil/frame.h" | #include "libavutil/frame.h" | ||||
| #include "libavutil/imgutils.h" | #include "libavutil/imgutils.h" | ||||
| #include "libavutil/internal.h" | |||||
| #include "libavutil/opt.h" | #include "libavutil/opt.h" | ||||
| #include "libavutil/samplefmt.h" | #include "libavutil/samplefmt.h" | ||||
| #include "audio.h" | #include "audio.h" | ||||
| @@ -133,6 +134,7 @@ int attribute_align_arg av_buffersrc_add_frame(AVFilterContext *ctx, | |||||
| } | } | ||||
| #if FF_API_AVFILTERBUFFER | #if FF_API_AVFILTERBUFFER | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| static void compat_free_buffer(void *opaque, uint8_t *data) | static void compat_free_buffer(void *opaque, uint8_t *data) | ||||
| { | { | ||||
| AVFilterBufferRef *buf = opaque; | AVFilterBufferRef *buf = opaque; | ||||
| @@ -235,6 +237,7 @@ fail: | |||||
| return ret; | return ret; | ||||
| } | } | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| static av_cold int init_video(AVFilterContext *ctx) | static av_cold int init_video(AVFilterContext *ctx) | ||||
| @@ -24,6 +24,7 @@ | |||||
| * internal API functions | * internal API functions | ||||
| */ | */ | ||||
| #include "libavutil/internal.h" | |||||
| #include "avfilter.h" | #include "avfilter.h" | ||||
| #include "thread.h" | #include "thread.h" | ||||
| #include "version.h" | #include "version.h" | ||||
| @@ -166,7 +167,9 @@ static inline void ff_insert_inpad(AVFilterContext *f, unsigned index, | |||||
| ff_insert_pad(index, &f->nb_inputs, offsetof(AVFilterLink, dstpad), | ff_insert_pad(index, &f->nb_inputs, offsetof(AVFilterLink, dstpad), | ||||
| &f->input_pads, &f->inputs, p); | &f->input_pads, &f->inputs, p); | ||||
| #if FF_API_FOO_COUNT | #if FF_API_FOO_COUNT | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| f->input_count = f->nb_inputs; | f->input_count = f->nb_inputs; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| } | } | ||||
| @@ -177,7 +180,9 @@ static inline void ff_insert_outpad(AVFilterContext *f, unsigned index, | |||||
| ff_insert_pad(index, &f->nb_outputs, offsetof(AVFilterLink, srcpad), | ff_insert_pad(index, &f->nb_outputs, offsetof(AVFilterLink, srcpad), | ||||
| &f->output_pads, &f->outputs, p); | &f->output_pads, &f->outputs, p); | ||||
| #if FF_API_FOO_COUNT | #if FF_API_FOO_COUNT | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| f->output_count = f->nb_outputs; | f->output_count = f->nb_outputs; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| } | } | ||||
| @@ -25,6 +25,7 @@ | |||||
| #include "libavutil/bswap.h" | #include "libavutil/bswap.h" | ||||
| #include "libavutil/common.h" | #include "libavutil/common.h" | ||||
| #include "libavutil/dict.h" | #include "libavutil/dict.h" | ||||
| #include "libavutil/internal.h" | |||||
| #include "libavutil/mathematics.h" | #include "libavutil/mathematics.h" | ||||
| #include "libavutil/opt.h" | #include "libavutil/opt.h" | ||||
| #include "avformat.h" | #include "avformat.h" | ||||
| @@ -1252,7 +1253,9 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt) | |||||
| asf_st->frag_offset = 0; | asf_st->frag_offset = 0; | ||||
| *pkt = asf_st->pkt; | *pkt = asf_st->pkt; | ||||
| #if FF_API_DESTRUCT_PACKET | #if FF_API_DESTRUCT_PACKET | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| asf_st->pkt.destruct = NULL; | asf_st->pkt.destruct = NULL; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| asf_st->pkt.buf = 0; | asf_st->pkt.buf = 0; | ||||
| asf_st->pkt.size = 0; | asf_st->pkt.size = 0; | ||||
| @@ -22,6 +22,7 @@ | |||||
| #include "libavutil/avstring.h" | #include "libavutil/avstring.h" | ||||
| #include "libavutil/bswap.h" | #include "libavutil/bswap.h" | ||||
| #include "libavutil/dict.h" | #include "libavutil/dict.h" | ||||
| #include "libavutil/internal.h" | |||||
| #include "libavutil/intreadwrite.h" | #include "libavutil/intreadwrite.h" | ||||
| #include "libavutil/mathematics.h" | #include "libavutil/mathematics.h" | ||||
| #include "avformat.h" | #include "avformat.h" | ||||
| @@ -1165,12 +1166,16 @@ resync: | |||||
| if (CONFIG_DV_DEMUXER && avi->dv_demux) { | if (CONFIG_DV_DEMUXER && avi->dv_demux) { | ||||
| AVBufferRef *avbuf = pkt->buf; | AVBufferRef *avbuf = pkt->buf; | ||||
| #if FF_API_DESTRUCT_PACKET | #if FF_API_DESTRUCT_PACKET | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| dstr = pkt->destruct; | dstr = pkt->destruct; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| size = avpriv_dv_produce_packet(avi->dv_demux, pkt, | size = avpriv_dv_produce_packet(avi->dv_demux, pkt, | ||||
| pkt->data, pkt->size); | pkt->data, pkt->size); | ||||
| #if FF_API_DESTRUCT_PACKET | #if FF_API_DESTRUCT_PACKET | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| pkt->destruct = dstr; | pkt->destruct = dstr; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| pkt->buf = avbuf; | pkt->buf = avbuf; | ||||
| pkt->flags |= AV_PKT_FLAG_KEY; | pkt->flags |= AV_PKT_FLAG_KEY; | ||||
| @@ -31,6 +31,7 @@ | |||||
| #include "id3v2.h" | #include "id3v2.h" | ||||
| #include "libavutil/avassert.h" | #include "libavutil/avassert.h" | ||||
| #include "libavutil/avstring.h" | #include "libavutil/avstring.h" | ||||
| #include "libavutil/internal.h" | |||||
| #include "libavutil/mathematics.h" | #include "libavutil/mathematics.h" | ||||
| #include "libavutil/parseutils.h" | #include "libavutil/parseutils.h" | ||||
| #include "libavutil/time.h" | #include "libavutil/time.h" | ||||
| @@ -452,7 +453,9 @@ void ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt, | |||||
| this_pktl = av_mallocz(sizeof(AVPacketList)); | this_pktl = av_mallocz(sizeof(AVPacketList)); | ||||
| this_pktl->pkt = *pkt; | this_pktl->pkt = *pkt; | ||||
| #if FF_API_DESTRUCT_PACKET | #if FF_API_DESTRUCT_PACKET | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| pkt->destruct = NULL; // do not free original but only the copy | pkt->destruct = NULL; // do not free original but only the copy | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| pkt->buf = NULL; | pkt->buf = NULL; | ||||
| av_dup_packet(&this_pktl->pkt); // duplicate the packet if it uses non-alloced memory | av_dup_packet(&this_pktl->pkt); // duplicate the packet if it uses non-alloced memory | ||||
| @@ -20,6 +20,7 @@ | |||||
| */ | */ | ||||
| #include "libavutil/channel_layout.h" | #include "libavutil/channel_layout.h" | ||||
| #include "libavutil/internal.h" | |||||
| #include "libavutil/intreadwrite.h" | #include "libavutil/intreadwrite.h" | ||||
| #include "libavcodec/mjpeg.h" | #include "libavcodec/mjpeg.h" | ||||
| #include "avformat.h" | #include "avformat.h" | ||||
| @@ -169,7 +170,9 @@ static int mxg_read_packet(AVFormatContext *s, AVPacket *pkt) | |||||
| pkt->pts = pkt->dts = mxg->dts; | pkt->pts = pkt->dts = mxg->dts; | ||||
| pkt->stream_index = 0; | pkt->stream_index = 0; | ||||
| #if FF_API_DESTRUCT_PACKET | #if FF_API_DESTRUCT_PACKET | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| pkt->destruct = NULL; | pkt->destruct = NULL; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| pkt->buf = NULL; | pkt->buf = NULL; | ||||
| pkt->size = mxg->buffer_ptr - mxg->soi_ptr; | pkt->size = mxg->buffer_ptr - mxg->soi_ptr; | ||||
| @@ -210,7 +213,9 @@ static int mxg_read_packet(AVFormatContext *s, AVPacket *pkt) | |||||
| pkt->pts = pkt->dts = AV_RL64(startmarker_ptr + 8); | pkt->pts = pkt->dts = AV_RL64(startmarker_ptr + 8); | ||||
| pkt->stream_index = 1; | pkt->stream_index = 1; | ||||
| #if FF_API_DESTRUCT_PACKET | #if FF_API_DESTRUCT_PACKET | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| pkt->destruct = NULL; | pkt->destruct = NULL; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| pkt->buf = NULL; | pkt->buf = NULL; | ||||
| pkt->size = size - 14; | pkt->size = size - 14; | ||||
| @@ -30,6 +30,7 @@ | |||||
| */ | */ | ||||
| #include "libavutil/channel_layout.h" | #include "libavutil/channel_layout.h" | ||||
| #include "libavutil/internal.h" | |||||
| #include "libavutil/intreadwrite.h" | #include "libavutil/intreadwrite.h" | ||||
| #include "avformat.h" | #include "avformat.h" | ||||
| #include "internal.h" | #include "internal.h" | ||||
| @@ -203,7 +204,9 @@ static int str_read_packet(AVFormatContext *s, | |||||
| pkt->size= -1; | pkt->size= -1; | ||||
| pkt->buf = NULL; | pkt->buf = NULL; | ||||
| #if FF_API_DESTRUCT_PACKET | #if FF_API_DESTRUCT_PACKET | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| pkt->destruct = NULL; | pkt->destruct = NULL; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| @@ -21,6 +21,7 @@ | |||||
| #include "libavutil/avstring.h" | #include "libavutil/avstring.h" | ||||
| #include "libavutil/channel_layout.h" | #include "libavutil/channel_layout.h" | ||||
| #include "libavutil/internal.h" | |||||
| #include "libavutil/intreadwrite.h" | #include "libavutil/intreadwrite.h" | ||||
| #include "libavutil/dict.h" | #include "libavutil/dict.h" | ||||
| #include "avformat.h" | #include "avformat.h" | ||||
| @@ -677,7 +678,9 @@ static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb, | |||||
| vst->pkt.size= 0; | vst->pkt.size= 0; | ||||
| vst->pkt.buf = NULL; | vst->pkt.buf = NULL; | ||||
| #if FF_API_DESTRUCT_PACKET | #if FF_API_DESTRUCT_PACKET | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| vst->pkt.destruct = NULL; | vst->pkt.destruct = NULL; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| if(vst->slices != vst->cur_slice) //FIXME find out how to set slices correct from the begin | if(vst->slices != vst->cur_slice) //FIXME find out how to set slices correct from the begin | ||||
| memmove(pkt->data + 1 + 8*vst->cur_slice, pkt->data + 1 + 8*vst->slices, | memmove(pkt->data + 1 + 8*vst->cur_slice, pkt->data + 1 + 8*vst->slices, | ||||
| @@ -26,6 +26,7 @@ | |||||
| #include "libavcodec/bytestream.h" | #include "libavcodec/bytestream.h" | ||||
| #include "libavutil/opt.h" | #include "libavutil/opt.h" | ||||
| #include "libavutil/dict.h" | #include "libavutil/dict.h" | ||||
| #include "libavutil/internal.h" | |||||
| #include "libavutil/pixdesc.h" | #include "libavutil/pixdesc.h" | ||||
| #include "metadata.h" | #include "metadata.h" | ||||
| #include "id3v2.h" | #include "id3v2.h" | ||||
| @@ -964,8 +965,10 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index) | |||||
| out_pkt.buf = pkt->buf; | out_pkt.buf = pkt->buf; | ||||
| pkt->buf = NULL; | pkt->buf = NULL; | ||||
| #if FF_API_DESTRUCT_PACKET | #if FF_API_DESTRUCT_PACKET | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| out_pkt.destruct = pkt->destruct; | out_pkt.destruct = pkt->destruct; | ||||
| pkt->destruct = NULL; | pkt->destruct = NULL; | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| #endif | #endif | ||||
| } | } | ||||
| if ((ret = av_dup_packet(&out_pkt)) < 0) | if ((ret = av_dup_packet(&out_pkt)) < 0) | ||||
| @@ -25,7 +25,7 @@ | |||||
| #include "common.h" | #include "common.h" | ||||
| #include "pixfmt.h" | #include "pixfmt.h" | ||||
| #include "pixdesc.h" | #include "pixdesc.h" | ||||
| #include "internal.h" | |||||
| #include "intreadwrite.h" | #include "intreadwrite.h" | ||||
| void av_read_image_line(uint16_t *dst, | void av_read_image_line(uint16_t *dst, | ||||
| @@ -1392,6 +1392,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { | |||||
| }, | }, | ||||
| }; | }; | ||||
| FF_DISABLE_DEPRECATION_WARNINGS | |||||
| static enum AVPixelFormat get_pix_fmt_internal(const char *name) | static enum AVPixelFormat get_pix_fmt_internal(const char *name) | ||||
| { | { | ||||
| enum AVPixelFormat pix_fmt; | enum AVPixelFormat pix_fmt; | ||||
| @@ -1486,6 +1487,7 @@ enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc) | |||||
| return desc - av_pix_fmt_descriptors; | return desc - av_pix_fmt_descriptors; | ||||
| } | } | ||||
| FF_ENABLE_DEPRECATION_WARNINGS | |||||
| int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, | int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, | ||||
| int *h_shift, int *v_shift) | int *h_shift, int *v_shift) | ||||