mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
avutil: remove deprecated FF_API_REORDERED_OPAQUE
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
b8fef7e9c5
commit
67e7f0b05e
@ -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.
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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()
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
*/
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user