[FFmpeg-cvslog] avcodec: Remove AVCodec, AVParser and AVBitStreamFilter next API

Andreas Rheinhardt git at videolan.org
Wed Apr 28 00:14:09 EEST 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Thu Feb 25 14:02:44 2021 +0100| [4b2be3f8d45db8fa795233b938391b23f6c518ea] | committer: James Almer

avcodec: Remove AVCodec, AVParser and AVBitStreamFilter next API

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4b2be3f8d45db8fa795233b938391b23f6c518ea
---

 libavcodec/allcodecs.c         | 39 ---------------------------------------
 libavcodec/avcodec.h           | 40 ----------------------------------------
 libavcodec/bitstream_filters.c |  6 ------
 libavcodec/codec.h             |  3 ---
 libavcodec/parsers.c           | 35 -----------------------------------
 libavcodec/version.h           |  3 ---
 6 files changed, 126 deletions(-)

diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index b748c9718e..5a935c1a0e 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -870,45 +870,6 @@ const AVCodec *av_codec_iterate(void **opaque)
     return c;
 }
 
-#if FF_API_NEXT
-FF_DISABLE_DEPRECATION_WARNINGS
-static AVOnce av_codec_next_init = AV_ONCE_INIT;
-
-static void av_codec_init_next(void)
-{
-    AVCodec *prev = NULL, *p;
-    void *i = 0;
-    while ((p = (AVCodec*)av_codec_iterate(&i))) {
-        if (prev)
-            prev->next = p;
-        prev = p;
-    }
-}
-
-
-
-av_cold void avcodec_register(AVCodec *codec)
-{
-    ff_thread_once(&av_codec_next_init, av_codec_init_next);
-}
-
-AVCodec *av_codec_next(const AVCodec *c)
-{
-    ff_thread_once(&av_codec_next_init, av_codec_init_next);
-
-    if (c)
-        return c->next;
-    else
-        return (AVCodec*)codec_list[0];
-}
-
-void avcodec_register_all(void)
-{
-    ff_thread_once(&av_codec_next_init, av_codec_init_next);
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
 static enum AVCodecID remap_deprecated_codec_id(enum AVCodecID id)
 {
     switch(id){
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 8a71c04230..483ab9a358 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2728,16 +2728,6 @@ typedef struct AVSubtitle {
     int64_t pts;    ///< Same as packet pts, in AV_TIME_BASE
 } AVSubtitle;
 
-#if FF_API_NEXT
-/**
- * If c is NULL, returns the first registered codec,
- * if c is non-NULL, returns the next registered codec after c,
- * or NULL if c is the last one.
- */
-attribute_deprecated
-AVCodec *av_codec_next(const AVCodec *c);
-#endif
-
 /**
  * Return the LIBAVCODEC_VERSION_INT constant.
  */
@@ -2753,20 +2743,6 @@ const char *avcodec_configuration(void);
  */
 const char *avcodec_license(void);
 
-#if FF_API_NEXT
-/**
- * @deprecated Calling this function is unnecessary.
- */
-attribute_deprecated
-void avcodec_register(AVCodec *codec);
-
-/**
- * @deprecated Calling this function is unnecessary.
- */
-attribute_deprecated
-void avcodec_register_all(void);
-#endif
-
 /**
  * Allocate an AVCodecContext and set its fields to default values. The
  * resulting struct should be freed with avcodec_free_context().
@@ -3553,10 +3529,6 @@ typedef struct AVCodecParser {
                         const uint8_t *buf, int buf_size);
     void (*parser_close)(AVCodecParserContext *s);
     int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
-#if FF_API_NEXT
-    attribute_deprecated
-    struct AVCodecParser *next;
-#endif
 } AVCodecParser;
 
 /**
@@ -3570,13 +3542,6 @@ typedef struct AVCodecParser {
  */
 const AVCodecParser *av_parser_iterate(void **opaque);
 
-#if FF_API_NEXT
-attribute_deprecated
-AVCodecParser *av_parser_next(const AVCodecParser *c);
-
-attribute_deprecated
-void av_register_codec_parser(AVCodecParser *parser);
-#endif
 AVCodecParserContext *av_parser_init(int codec_id);
 
 /**
@@ -4065,11 +4030,6 @@ attribute_deprecated
 const AVBitStreamFilter *av_bitstream_filter_next(const AVBitStreamFilter *f);
 #endif
 
-#if FF_API_NEXT
-attribute_deprecated
-const AVBitStreamFilter *av_bsf_next(void **opaque);
-#endif
-
 /* memory */
 
 /**
diff --git a/libavcodec/bitstream_filters.c b/libavcodec/bitstream_filters.c
index 02d33abb18..3de2af92d3 100644
--- a/libavcodec/bitstream_filters.c
+++ b/libavcodec/bitstream_filters.c
@@ -75,12 +75,6 @@ const AVBitStreamFilter *av_bsf_iterate(void **opaque)
     return f;
 }
 
-#if FF_API_NEXT
-const AVBitStreamFilter *av_bsf_next(void **opaque) {
-    return av_bsf_iterate(opaque);
-}
-#endif
-
 const AVBitStreamFilter *av_bsf_get_by_name(const char *name)
 {
     const AVBitStreamFilter *f = NULL;
diff --git a/libavcodec/codec.h b/libavcodec/codec.h
index de050b2815..c95078491d 100644
--- a/libavcodec/codec.h
+++ b/libavcodec/codec.h
@@ -243,9 +243,6 @@ typedef struct AVCodec {
      *****************************************************************
      */
     int priv_data_size;
-#if FF_API_NEXT
-    struct AVCodec *next;
-#endif
     /**
      * @name Frame-level threading support functions
      * @{
diff --git a/libavcodec/parsers.c b/libavcodec/parsers.c
index 3d944f5222..40b42e6d1a 100644
--- a/libavcodec/parsers.c
+++ b/libavcodec/parsers.c
@@ -18,10 +18,7 @@
 
 #include <stdint.h>
 
-#include "libavutil/thread.h"
-
 #include "avcodec.h"
-#include "version.h"
 
 extern AVCodecParser ff_aac_parser;
 extern AVCodecParser ff_aac_latm_parser;
@@ -78,38 +75,6 @@ extern AVCodecParser ff_xma_parser;
 
 #include "libavcodec/parser_list.c"
 
-#if FF_API_NEXT
-FF_DISABLE_DEPRECATION_WARNINGS
-static AVOnce av_parser_next_init = AV_ONCE_INIT;
-
-static void av_parser_init_next(void)
-{
-    AVCodecParser *prev = NULL, *p;
-    int i = 0;
-    while ((p = (AVCodecParser*)parser_list[i++])) {
-        if (prev)
-            prev->next = p;
-        prev = p;
-    }
-}
-
-AVCodecParser *av_parser_next(const AVCodecParser *p)
-{
-    ff_thread_once(&av_parser_next_init, av_parser_init_next);
-
-    if (p)
-        return p->next;
-    else
-        return (AVCodecParser*)parser_list[0];
-}
-
-void av_register_codec_parser(AVCodecParser *parser)
-{
-    ff_thread_once(&av_parser_next_init, av_parser_init_next);
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
 const AVCodecParser *av_parser_iterate(void **opaque)
 {
     uintptr_t i = (uintptr_t)*opaque;
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 78c14f1c0d..8d189312ed 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -120,9 +120,6 @@
 #ifndef FF_API_LOCKMGR
 #define FF_API_LOCKMGR (LIBAVCODEC_VERSION_MAJOR < 59)
 #endif
-#ifndef FF_API_NEXT
-#define FF_API_NEXT              (LIBAVCODEC_VERSION_MAJOR < 59)
-#endif
 #ifndef FF_API_UNSANITIZED_BITRATES
 #define FF_API_UNSANITIZED_BITRATES (LIBAVCODEC_VERSION_MAJOR < 59)
 #endif



More information about the ffmpeg-cvslog mailing list