[FFmpeg-devel] [PATCH 07/24] avcodec: remove deprecated FF_API_AVCTX_FRAME_NUMBER

James Almer jamrial at gmail.com
Thu Jan 25 15:43:30 EET 2024


Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavcodec/avcodec.c       |  5 -----
 libavcodec/avcodec.h       | 15 ---------------
 libavcodec/decode.c        | 10 ----------
 libavcodec/encode.c        | 10 ----------
 libavcodec/pthread_frame.c |  5 -----
 libavcodec/version_major.h |  1 -
 6 files changed, 46 deletions(-)

diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c
index a6c8629f6c..692d4c35b4 100644
--- a/libavcodec/avcodec.c
+++ b/libavcodec/avcodec.c
@@ -282,11 +282,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
     }
 
     avctx->frame_num = 0;
-#if FF_API_AVCTX_FRAME_NUMBER
-FF_DISABLE_DEPRECATION_WARNINGS
-    avctx->frame_number = avctx->frame_num;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
     avctx->codec_descriptor = avcodec_descriptor_get(avctx->codec_id);
 
     if ((avctx->codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) &&
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 2dd9c5c82b..3c2b0159a9 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1091,21 +1091,6 @@ typedef struct AVCodecContext {
      */
     int frame_size;
 
-#if FF_API_AVCTX_FRAME_NUMBER
-    /**
-     * Frame counter, set by libavcodec.
-     *
-     * - decoding: total number of frames returned from the decoder so far.
-     * - encoding: total number of frames passed to the encoder so far.
-     *
-     *   @note the counter is not incremented if encoding/decoding resulted in
-     *   an error.
-     *   @deprecated use frame_num instead
-     */
-    attribute_deprecated
-    int frame_number;
-#endif
-
     /**
      * number of bytes per packet if constant and known or 0
      * Used by some WAV based audio codecs.
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 2cfb3fcf97..4cd37807db 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -820,11 +820,6 @@ int ff_decode_receive_frame(AVCodecContext *avctx, AVFrame *frame)
     }
 
     avctx->frame_num++;
-#if FF_API_AVCTX_FRAME_NUMBER
-FF_DISABLE_DEPRECATION_WARNINGS
-    avctx->frame_number = avctx->frame_num;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 
 #if FF_API_DROPCHANGED
     if (avctx->flags & AV_CODEC_FLAG_DROPCHANGED) {
@@ -1032,11 +1027,6 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
 
         if (*got_sub_ptr)
             avctx->frame_num++;
-#if FF_API_AVCTX_FRAME_NUMBER
-FF_DISABLE_DEPRECATION_WARNINGS
-        avctx->frame_number = avctx->frame_num;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
     }
 
     return ret;
diff --git a/libavcodec/encode.c b/libavcodec/encode.c
index a436be2657..6b0a16fc0b 100644
--- a/libavcodec/encode.c
+++ b/libavcodec/encode.c
@@ -198,11 +198,6 @@ int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
 
     ret = ffcodec(avctx->codec)->cb.encode_sub(avctx, buf, buf_size, sub);
     avctx->frame_num++;
-#if FF_API_AVCTX_FRAME_NUMBER
-FF_DISABLE_DEPRECATION_WARNINGS
-    avctx->frame_number = avctx->frame_num;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
     return ret;
 }
 
@@ -544,11 +539,6 @@ int attribute_align_arg avcodec_send_frame(AVCodecContext *avctx, const AVFrame
     }
 
     avctx->frame_num++;
-#if FF_API_AVCTX_FRAME_NUMBER
-FF_DISABLE_DEPRECATION_WARNINGS
-    avctx->frame_number = avctx->frame_num;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 
     return 0;
 }
diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
index 71e99a5728..ec6ae8a7fe 100644
--- a/libavcodec/pthread_frame.c
+++ b/libavcodec/pthread_frame.c
@@ -418,11 +418,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_AVCTX_FRAME_NUMBER
-FF_DISABLE_DEPRECATION_WARNINGS
-    dst->frame_number     = src->frame_number;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 #if FF_API_REORDERED_OPAQUE
 FF_DISABLE_DEPRECATION_WARNINGS
     dst->reordered_opaque = src->reordered_opaque;
diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index 79c6f6dd05..7e8f5bace3 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -38,7 +38,6 @@
  */
 
 #define FF_API_INIT_PACKET         (LIBAVCODEC_VERSION_MAJOR < 61)
-#define FF_API_AVCTX_FRAME_NUMBER  (LIBAVCODEC_VERSION_MAJOR < 61)
 #define FF_API_SLICE_OFFSET        (LIBAVCODEC_VERSION_MAJOR < 61)
 #define FF_API_SUBFRAMES           (LIBAVCODEC_VERSION_MAJOR < 61)
 #define FF_API_TICKS_PER_FRAME     (LIBAVCODEC_VERSION_MAJOR < 61)
-- 
2.43.0



More information about the ffmpeg-devel mailing list