aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-09-05 16:50:09 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2015-09-05 16:50:09 +0200
commit87c88122703f2befcf96383d05bdf14373c22df9 (patch)
tree440194d29f606b9926ad57b9a15d0709ee12ccd7
parentb27ddffbfb29f456d43c2f155eef5230b940a48b (diff)
parent01bcc2d5c23fa757d163530abb396fd02f1be7c8 (diff)
downloadffmpeg-87c88122703f2befcf96383d05bdf14373c22df9.tar.gz
Merge commit '01bcc2d5c23fa757d163530abb396fd02f1be7c8'
* commit '01bcc2d5c23fa757d163530abb396fd02f1be7c8': lavc: Drop deprecated destruct_packet related functions Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
-rw-r--r--libavcodec/avcodec.h16
-rw-r--r--libavcodec/avpacket.c48
-rw-r--r--libavcodec/utils.c10
-rw-r--r--libavcodec/version.h3
-rw-r--r--libavdevice/v4l2.c12
-rw-r--r--libavformat/avidec.c13
-rw-r--r--libavformat/mux.c5
-rw-r--r--libavformat/mxg.c10
-rw-r--r--libavformat/psxstr.c5
-rw-r--r--libavformat/rmdec.c5
-rw-r--r--libavformat/utils.c6
-rw-r--r--libavformat/yop.c5
12 files changed, 1 insertions, 137 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index a471575098..fae48a8ed7 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1439,12 +1439,7 @@ typedef struct AVPacket {
* Equals next_pts - this_pts in presentation order.
*/
int duration;
-#if FF_API_DESTRUCT_PACKET
- attribute_deprecated
- void (*destruct)(struct AVPacket *);
- attribute_deprecated
- void *priv;
-#endif
+
int64_t pos; ///< byte position in stream, -1 if unknown
/**
@@ -4010,15 +4005,6 @@ void avsubtitle_free(AVSubtitle *sub);
* @{
*/
-#if FF_API_DESTRUCT_PACKET
-/**
- * Default packet destructor.
- * @deprecated use the AVBuffer API instead
- */
-attribute_deprecated
-void av_destruct_packet(AVPacket *pkt);
-#endif
-
/**
* Initialize optional fields of a packet with default values.
*
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 10be9d53b8..7b2df14a37 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -30,22 +30,6 @@
#include "bytestream.h"
#include "internal.h"
-#if FF_API_DESTRUCT_PACKET
-
-void av_destruct_packet(AVPacket *pkt)
-{
- av_freep(&pkt->data);
- pkt->size = 0;
-}
-
-/* a dummy destruct callback for the callers that assume AVPacket.destruct ==
- * NULL => static data */
-static void dummy_destruct_packet(AVPacket *pkt)
-{
- av_assert0(0);
-}
-#endif
-
void av_init_packet(AVPacket *pkt)
{
pkt->pts = AV_NOPTS_VALUE;
@@ -55,11 +39,6 @@ void av_init_packet(AVPacket *pkt)
pkt->convergence_duration = 0;
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;
pkt->side_data_elems = 0;
@@ -91,11 +70,6 @@ int av_new_packet(AVPacket *pkt, int size)
pkt->buf = buf;
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;
}
@@ -128,11 +102,6 @@ int av_grow_packet(AVPacket *pkt, int grow_by)
if (!pkt->buf)
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;
pkt->size += grow_by;
@@ -153,11 +122,6 @@ 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;
}
@@ -203,11 +167,6 @@ static int copy_packet_data(AVPacket *pkt, const AVPacket *src, int dup)
} else {
DUP_DATA(pkt->data, src->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 && dup)
pkt->side_data = src->side_data;
if (pkt->side_data_elems && !dup) {
@@ -280,15 +239,8 @@ void av_packet_free_side_data(AVPacket *pkt)
void av_free_packet(AVPacket *pkt)
{
if (pkt) {
-FF_DISABLE_DEPRECATION_WARNINGS
if (pkt->buf)
av_buffer_unref(&pkt->buf);
-#if FF_API_DESTRUCT_PACKET
- else if (pkt->destruct)
- pkt->destruct(pkt);
- pkt->destruct = NULL;
-#endif
-FF_ENABLE_DEPRECATION_WARNINGS
pkt->data = NULL;
pkt->size = 0;
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index f51070c5bc..729df1187e 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1807,11 +1807,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
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) {
av_log(avctx, AV_LOG_ERROR, "User packet is too small (%d < %"PRId64")\n", avpkt->size, size);
@@ -1819,11 +1814,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
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;
return 0;
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 00347c958e..7a1c633204 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -76,9 +76,6 @@
#ifndef FF_API_DEINTERLACE
#define FF_API_DEINTERLACE (LIBAVCODEC_VERSION_MAJOR < 57)
#endif
-#ifndef FF_API_DESTRUCT_PACKET
-#define FF_API_DESTRUCT_PACKET (LIBAVCODEC_VERSION_MAJOR < 57)
-#endif
#ifndef FF_API_GET_BUFFER
#define FF_API_GET_BUFFER (LIBAVCODEC_VERSION_MAJOR < 57)
#endif
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index d198abc75b..2b38a00ac6 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -394,13 +394,6 @@ static int mmap_init(AVFormatContext *ctx)
return 0;
}
-#if FF_API_DESTRUCT_PACKET
-static void dummy_release_buffer(AVPacket *pkt)
-{
- av_assert0(0);
-}
-#endif
-
static int enqueue_buffer(struct video_data *s, struct v4l2_buffer *buf)
{
int res = 0;
@@ -565,11 +558,6 @@ static int mmap_read_frame(AVFormatContext *ctx, AVPacket *pkt)
pkt->data = s->buf_start[buf.index];
pkt->size = buf.bytesused;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- pkt->destruct = dummy_release_buffer;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
buf_descriptor = av_malloc(sizeof(struct buff_data));
if (!buf_descriptor) {
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 3881251a78..30b949770e 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -1308,9 +1308,6 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
AVIContext *avi = s->priv_data;
AVIOContext *pb = s->pb;
int err;
-#if FF_API_DESTRUCT_PACKET
- void *dstr;
-#endif
if (CONFIG_DV_DEMUXER && avi->dv_demux) {
int size = avpriv_dv_get_packet(avi->dv_demux, pkt);
@@ -1427,18 +1424,8 @@ resync:
if (CONFIG_DV_DEMUXER && avi->dv_demux) {
AVBufferRef *avbuf = pkt->buf;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- dstr = pkt->destruct;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
size = avpriv_dv_produce_packet(avi->dv_demux, pkt,
pkt->data, pkt->size, pkt->pos);
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- pkt->destruct = dstr;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
pkt->buf = avbuf;
pkt->flags |= AV_PKT_FLAG_KEY;
if (size < 0)
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 8d5867cdcf..a57b69642c 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -736,11 +736,6 @@ int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
if (!this_pktl)
return AVERROR(ENOMEM);
this_pktl->pkt = *pkt;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- pkt->destruct = NULL; // do not free original but only the copy
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
pkt->buf = NULL;
pkt->side_data = NULL;
pkt->side_data_elems = 0;
diff --git a/libavformat/mxg.c b/libavformat/mxg.c
index b95f5426b3..45cc5b5284 100644
--- a/libavformat/mxg.c
+++ b/libavformat/mxg.c
@@ -171,11 +171,6 @@ static int mxg_read_packet(AVFormatContext *s, AVPacket *pkt)
pkt->pts = pkt->dts = mxg->dts;
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->size = mxg->buffer_ptr - mxg->soi_ptr;
pkt->data = mxg->soi_ptr;
@@ -214,11 +209,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
/* time (GMT) of first sample in usec since 1970, little-endian */
pkt->pts = pkt->dts = AV_RL64(startmarker_ptr + 8);
pkt->stream_index = 1;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- pkt->destruct = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
pkt->buf = NULL;
pkt->size = size - 14;
pkt->data = startmarker_ptr + 16;
diff --git a/libavformat/psxstr.c b/libavformat/psxstr.c
index fd50e549ae..3aa08eb93f 100644
--- a/libavformat/psxstr.c
+++ b/libavformat/psxstr.c
@@ -238,11 +238,6 @@ static int str_read_packet(AVFormatContext *s,
pkt->data= NULL;
pkt->size= -1;
pkt->buf = NULL;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- pkt->destruct = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
return 0;
}
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 09889f6efa..59a80355e0 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -834,11 +834,6 @@ static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb,
vst->pkt.data= NULL;
vst->pkt.size= 0;
vst->pkt.buf = NULL;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- vst->pkt.destruct = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
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,
vst->videobufpos - 1 - 8*vst->slices);
diff --git a/libavformat/utils.c b/libavformat/utils.c
index e67147c246..660a4ff7ff 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1265,12 +1265,6 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index)
if (out_pkt.data == pkt->data && out_pkt.size == pkt->size) {
out_pkt.buf = pkt->buf;
pkt->buf = NULL;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- out_pkt.destruct = pkt->destruct;
- pkt->destruct = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
}
if ((ret = av_dup_packet(&out_pkt)) < 0)
goto fail;
diff --git a/libavformat/yop.c b/libavformat/yop.c
index 81b3cc2b32..64779d4fb7 100644
--- a/libavformat/yop.c
+++ b/libavformat/yop.c
@@ -132,11 +132,6 @@ static int yop_read_packet(AVFormatContext *s, AVPacket *pkt)
*pkt = yop->video_packet;
yop->video_packet.data = NULL;
yop->video_packet.buf = NULL;
-#if FF_API_DESTRUCT_PACKET
-FF_DISABLE_DEPRECATION_WARNINGS
- yop->video_packet.destruct = NULL;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
yop->video_packet.size = 0;
pkt->data[0] = yop->odd_frame;
pkt->flags |= AV_PKT_FLAG_KEY;