[FFmpeg-cvslog] avutil: remove deprecated FF_API_REORDERED_OPAQUE
James Almer
git at videolan.org
Thu Mar 7 16:42:17 EET 2024
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sat Jan 20 13:13:53 2024 -0300| [67e7f0b05eeee37eee1357769038270fda08fe32] | committer: James Almer
avutil: remove deprecated FF_API_REORDERED_OPAQUE
Signed-off-by: James Almer <jamrial at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=67e7f0b05eeee37eee1357769038270fda08fe32
---
libavcodec/avcodec.h | 16 ----------------
libavcodec/decode.c | 5 -----
libavcodec/encode.c | 6 ------
libavcodec/libdav1d.c | 22 +---------------------
libavcodec/librav1e.c | 13 -------------
libavcodec/libvpxenc.c | 14 --------------
libavcodec/libwebpenc_animencoder.c | 13 -------------
libavcodec/libx264.c | 18 ------------------
libavcodec/libx265.c | 20 --------------------
libavcodec/nvenc.c | 12 ------------
libavcodec/nvenc.h | 4 ----
libavcodec/options.c | 5 -----
libavcodec/pthread_frame.c | 5 -----
libavutil/frame.c | 5 -----
libavutil/frame.h | 15 ---------------
libavutil/version.h | 1 -
16 files changed, 1 insertion(+), 173 deletions(-)
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 9eb98e7db4..f0332897b5 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1353,22 +1353,6 @@ typedef struct AVCodecContext {
*/
int err_recognition;
-#if FF_API_REORDERED_OPAQUE
- /**
- * opaque 64-bit number (generally a PTS) that will be reordered and
- * output in AVFrame.reordered_opaque
- * - encoding: Set by libavcodec to the reordered_opaque of the input
- * frame corresponding to the last returned packet. Only
- * supported by encoders with the
- * AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE capability.
- * - decoding: Set by user.
- *
- * @deprecated Use AV_CODEC_FLAG_COPY_OPAQUE instead
- */
- attribute_deprecated
- int64_t reordered_opaque;
-#endif
-
/**
* Hardware accelerator in use
* - encoding: unused.
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 8b9c5f48f0..27e03e2fae 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1474,11 +1474,6 @@ FF_DISABLE_DEPRECATION_WARNINGS
FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
-#if FF_API_REORDERED_OPAQUE
-FF_DISABLE_DEPRECATION_WARNINGS
- frame->reordered_opaque = avctx->reordered_opaque;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
ret = fill_frame_props(avctx, frame);
if (ret < 0)
diff --git a/libavcodec/encode.c b/libavcodec/encode.c
index 4881c599d1..7fc9737e93 100644
--- a/libavcodec/encode.c
+++ b/libavcodec/encode.c
@@ -234,12 +234,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
int ff_encode_reordered_opaque(AVCodecContext *avctx,
AVPacket *pkt, const AVFrame *frame)
{
-#if FF_API_REORDERED_OPAQUE
-FF_DISABLE_DEPRECATION_WARNINGS
- avctx->reordered_opaque = frame->reordered_opaque;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) {
int ret = av_buffer_replace(&pkt->opaque_ref, frame->opaque_ref);
if (ret < 0)
diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index 78a5c63bf4..79478ae893 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -298,9 +298,6 @@ static void libdav1d_flush(AVCodecContext *c)
typedef struct OpaqueData {
void *pkt_orig_opaque;
-#if FF_API_REORDERED_OPAQUE
- int64_t reordered_opaque;
-#endif
} OpaqueData;
static void libdav1d_data_free(const uint8_t *data, void *opaque) {
@@ -346,12 +343,7 @@ static int libdav1d_receive_frame_internal(AVCodecContext *c, Dav1dPicture *p)
pkt->buf = NULL;
-FF_DISABLE_DEPRECATION_WARNINGS
- if (
-#if FF_API_REORDERED_OPAQUE
- c->reordered_opaque != AV_NOPTS_VALUE ||
-#endif
- (pkt->opaque && (c->flags & AV_CODEC_FLAG_COPY_OPAQUE))) {
+ if (pkt->opaque && (c->flags & AV_CODEC_FLAG_COPY_OPAQUE)) {
od = av_mallocz(sizeof(*od));
if (!od) {
av_packet_free(&pkt);
@@ -359,10 +351,6 @@ FF_DISABLE_DEPRECATION_WARNINGS
return AVERROR(ENOMEM);
}
od->pkt_orig_opaque = pkt->opaque;
-#if FF_API_REORDERED_OPAQUE
- od->reordered_opaque = c->reordered_opaque;
-#endif
-FF_ENABLE_DEPRECATION_WARNINGS
}
pkt->opaque = od;
@@ -464,14 +452,6 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
pkt = (AVPacket *)p->m.user_data.data;
od = pkt->opaque;
-#if FF_API_REORDERED_OPAQUE
-FF_DISABLE_DEPRECATION_WARNINGS
- if (od && od->reordered_opaque != AV_NOPTS_VALUE)
- frame->reordered_opaque = od->reordered_opaque;
- else
- frame->reordered_opaque = AV_NOPTS_VALUE;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
// restore the original user opaque value for
// ff_decode_frame_props_from_pkt()
diff --git a/libavcodec/librav1e.c b/libavcodec/librav1e.c
index 56539435a7..dbd728a408 100644
--- a/libavcodec/librav1e.c
+++ b/libavcodec/librav1e.c
@@ -57,9 +57,6 @@ typedef struct librav1eContext {
typedef struct FrameData {
int64_t pts;
int64_t duration;
-#if FF_API_REORDERED_OPAQUE
- int64_t reordered_opaque;
-#endif
void *frame_opaque;
AVBufferRef *frame_opaque_ref;
@@ -472,11 +469,6 @@ static int librav1e_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
}
fd->pts = frame->pts;
fd->duration = frame->duration;
-#if FF_API_REORDERED_OPAQUE
-FF_DISABLE_DEPRECATION_WARNINGS
- fd->reordered_opaque = frame->reordered_opaque;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) {
fd->frame_opaque = frame->opaque;
@@ -583,11 +575,6 @@ retry:
fd = rpkt->opaque;
pkt->pts = pkt->dts = fd->pts;
pkt->duration = fd->duration;
-#if FF_API_REORDERED_OPAQUE
-FF_DISABLE_DEPRECATION_WARNINGS
- avctx->reordered_opaque = fd->reordered_opaque;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) {
pkt->opaque = fd->frame_opaque;
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index dbf1bd679f..4b89e47e83 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -68,9 +68,6 @@ typedef struct FrameData {
int64_t pts;
int64_t duration;
-#if FF_API_REORDERED_OPAQUE
- int64_t reordered_opaque;
-#endif
void *frame_opaque;
AVBufferRef *frame_opaque_ref;
@@ -383,11 +380,6 @@ static int frame_data_submit(AVCodecContext *avctx, AVFifo *fifo,
if (ret < 0)
goto fail;
}
-#if FF_API_REORDERED_OPAQUE
-FF_DISABLE_DEPRECATION_WARNINGS
- fd.reordered_opaque = frame->reordered_opaque;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
ret = av_fifo_write(fifo, &fd, 1);
if (ret < 0)
@@ -414,12 +406,6 @@ static int frame_data_apply(AVCodecContext *avctx, AVFifo *fifo, AVPacket *pkt)
goto skip;
}
-#if FF_API_REORDERED_OPAQUE
-FF_DISABLE_DEPRECATION_WARNINGS
- avctx->reordered_opaque = fd.reordered_opaque;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
pkt->duration = fd.duration;
if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) {
pkt->opaque = fd.frame_opaque;
diff --git a/libavcodec/libwebpenc_animencoder.c b/libavcodec/libwebpenc_animencoder.c
index 8756231f23..02f0b6f64d 100644
--- a/libavcodec/libwebpenc_animencoder.c
+++ b/libavcodec/libwebpenc_animencoder.c
@@ -39,9 +39,6 @@ typedef struct LibWebPAnimContext {
int64_t first_frame_pts; // pts of the first encoded frame.
int64_t end_pts; // pts + duration of the last frame
-#if FF_API_REORDERED_OPAQUE
- int64_t reordered_opaque;
-#endif
void *first_frame_opaque;
AVBufferRef *first_frame_opaque_ref;
@@ -92,11 +89,6 @@ static int libwebp_anim_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if (pkt->pts != AV_NOPTS_VALUE && s->end_pts > pkt->pts)
pkt->duration = s->end_pts - pkt->pts;
-#if FF_API_REORDERED_OPAQUE
-FF_DISABLE_DEPRECATION_WARNINGS
- avctx->reordered_opaque = s->reordered_opaque;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) {
pkt->opaque = s->first_frame_opaque;
pkt->opaque_ref = s->first_frame_opaque_ref;
@@ -134,11 +126,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (!avctx->frame_num) {
s->first_frame_pts = frame->pts;
-#if FF_API_REORDERED_OPAQUE
-FF_DISABLE_DEPRECATION_WARNINGS
- s->reordered_opaque = frame->reordered_opaque;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) {
s->first_frame_opaque = frame->opaque;
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 10d646bd76..0997c4e134 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -54,9 +54,6 @@
#define MB_CEIL(x) MB_FLOOR((x) + (MB_SIZE - 1))
typedef struct X264Opaque {
-#if FF_API_REORDERED_OPAQUE
- int64_t reordered_opaque;
-#endif
int64_t wallclock;
int64_t duration;
@@ -512,11 +509,6 @@ static int setup_frame(AVCodecContext *ctx, const AVFrame *frame,
goto fail;
}
-#if FF_API_REORDERED_OPAQUE
-FF_DISABLE_DEPRECATION_WARNINGS
- opaque->reordered_opaque = frame->reordered_opaque;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
opaque->duration = frame->duration;
opaque->wallclock = wallclock;
if (ctx->export_side_data & AV_CODEC_EXPORT_DATA_PRFT)
@@ -681,11 +673,6 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
out_opaque = pic_out.opaque;
if (out_opaque >= x4->reordered_opaque &&
out_opaque < &x4->reordered_opaque[x4->nb_reordered_opaque]) {
-#if FF_API_REORDERED_OPAQUE
-FF_DISABLE_DEPRECATION_WARNINGS
- ctx->reordered_opaque = out_opaque->reordered_opaque;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
wallclock = out_opaque->wallclock;
pkt->duration = out_opaque->duration;
@@ -700,11 +687,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
// Unexpected opaque pointer on picture output
av_log(ctx, AV_LOG_ERROR, "Unexpected opaque pointer; "
"this is a bug, please report it.\n");
-#if FF_API_REORDERED_OPAQUE
-FF_DISABLE_DEPRECATION_WARNINGS
- ctx->reordered_opaque = 0;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
}
switch (pic_out.i_type) {
diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index 447e6da25f..92183b9ca2 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -42,9 +42,6 @@
#include "sei.h"
typedef struct ReorderedData {
-#if FF_API_REORDERED_OPAQUE
- int64_t reordered_opaque;
-#endif
int64_t duration;
void *frame_opaque;
@@ -626,11 +623,6 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
rd = &ctx->rd[rd_idx];
rd->duration = pic->duration;
-#if FF_API_REORDERED_OPAQUE
-FF_DISABLE_DEPRECATION_WARNINGS
- rd->reordered_opaque = pic->reordered_opaque;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) {
rd->frame_opaque = pic->opaque;
ret = av_buffer_replace(&rd->frame_opaque_ref, pic->opaque_ref);
@@ -768,11 +760,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
int idx = (int)(intptr_t)x265pic_out.userData - 1;
ReorderedData *rd = &ctx->rd[idx];
-#if FF_API_REORDERED_OPAQUE
-FF_DISABLE_DEPRECATION_WARNINGS
- avctx->reordered_opaque = rd->reordered_opaque;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
pkt->duration = rd->duration;
if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) {
@@ -783,13 +770,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
rd_release(ctx, idx);
}
-#if FF_API_REORDERED_OPAQUE
- else {
-FF_DISABLE_DEPRECATION_WARNINGS
- avctx->reordered_opaque = 0;
-FF_ENABLE_DEPRECATION_WARNINGS
- }
-#endif
*got_packet = 1;
return 0;
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 626f10d20a..fd73af2a32 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -2282,12 +2282,6 @@ static int nvenc_store_frame_data(AVCodecContext *avctx, NV_ENC_PIC_PARAMS *pic_
frame_data->duration = frame->duration;
frame_data->frame_opaque = frame->opaque;
-#if FF_API_REORDERED_OPAQUE
-FF_DISABLE_DEPRECATION_WARNINGS
- frame_data->reordered_opaque = frame->reordered_opaque;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
ctx->frame_data_array_pos = (ctx->frame_data_array_pos + 1) % ctx->frame_data_array_nb;
pic_params->inputDuration = idx;
@@ -2304,12 +2298,6 @@ static int nvenc_retrieve_frame_data(AVCodecContext *avctx, NV_ENC_LOCK_BITSTREA
pkt->duration = frame_data->duration;
-#if FF_API_REORDERED_OPAQUE
-FF_DISABLE_DEPRECATION_WARNINGS
- avctx->reordered_opaque = frame_data->reordered_opaque;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) {
pkt->opaque = frame_data->frame_opaque;
pkt->opaque_ref = frame_data->frame_opaque_ref;
diff --git a/libavcodec/nvenc.h b/libavcodec/nvenc.h
index e5b0eb8305..48cdfc58aa 100644
--- a/libavcodec/nvenc.h
+++ b/libavcodec/nvenc.h
@@ -100,10 +100,6 @@ typedef struct NvencFrameData
{
int64_t duration;
-#if FF_API_REORDERED_OPAQUE
- int64_t reordered_opaque;
-#endif
-
void *frame_opaque;
AVBufferRef *frame_opaque_ref;
} NvencFrameData;
diff --git a/libavcodec/options.c b/libavcodec/options.c
index 928e430ce9..dcc67e497a 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -125,11 +125,6 @@ static int init_context_defaults(AVCodecContext *s, const AVCodec *codec)
s->sw_pix_fmt = AV_PIX_FMT_NONE;
s->sample_fmt = AV_SAMPLE_FMT_NONE;
-#if FF_API_REORDERED_OPAQUE
-FF_DISABLE_DEPRECATION_WARNINGS
- s->reordered_opaque = AV_NOPTS_VALUE;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
if(codec && codec2->priv_data_size){
s->priv_data = av_mallocz(codec2->priv_data_size);
if (!s->priv_data)
diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
index cffcced99a..fd356bd190 100644
--- a/libavcodec/pthread_frame.c
+++ b/libavcodec/pthread_frame.c
@@ -412,11 +412,6 @@ static int update_context_from_user(AVCodecContext *dst, const AVCodecContext *s
dst->skip_frame = src->skip_frame;
dst->frame_num = src->frame_num;
-#if FF_API_REORDERED_OPAQUE
-FF_DISABLE_DEPRECATION_WARNINGS
- dst->reordered_opaque = src->reordered_opaque;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
av_packet_unref(dst->internal->last_pkt_props);
err = av_packet_copy_props(dst->internal->last_pkt_props, src->internal->last_pkt_props);
diff --git a/libavutil/frame.c b/libavutil/frame.c
index dc80d71adf..93ac3a753d 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -266,11 +266,6 @@ FF_DISABLE_DEPRECATION_WARNINGS
FF_ENABLE_DEPRECATION_WARNINGS
#endif
dst->time_base = src->time_base;
-#if FF_API_REORDERED_OPAQUE
-FF_DISABLE_DEPRECATION_WARNINGS
- dst->reordered_opaque = src->reordered_opaque;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
dst->quality = src->quality;
dst->best_effort_timestamp = src->best_effort_timestamp;
#if FF_API_FRAME_PICTURE_NUMBER
diff --git a/libavutil/frame.h b/libavutil/frame.h
index 84a431f14c..3186d3a872 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -546,21 +546,6 @@ typedef struct AVFrame {
int palette_has_changed;
#endif
-#if FF_API_REORDERED_OPAQUE
- /**
- * reordered opaque 64 bits (generally an integer or a double precision float
- * PTS but can be anything).
- * The user sets AVCodecContext.reordered_opaque to represent the input at
- * that time,
- * the decoder reorders values as needed and sets AVFrame.reordered_opaque
- * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque
- *
- * @deprecated Use AV_CODEC_FLAG_COPY_OPAQUE instead
- */
- attribute_deprecated
- int64_t reordered_opaque;
-#endif
-
/**
* Sample rate of the audio data.
*/
diff --git a/libavutil/version.h b/libavutil/version.h
index e626b46455..2eaf57cde2 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -105,7 +105,6 @@
* @{
*/
-#define FF_API_REORDERED_OPAQUE (LIBAVUTIL_VERSION_MAJOR < 59)
#define FF_API_FRAME_PICTURE_NUMBER (LIBAVUTIL_VERSION_MAJOR < 59)
#define FF_API_HDR_VIVID_THREE_SPLINE (LIBAVUTIL_VERSION_MAJOR < 59)
#define FF_API_FRAME_PKT (LIBAVUTIL_VERSION_MAJOR < 59)
More information about the ffmpeg-cvslog
mailing list