[FFmpeg-devel] [PATCH 01/87] avcodec: Remove AVCodec, AVParser and AVBitStreamFilter next API
James Almer
jamrial at gmail.com
Mon Apr 19 17:08:58 EEST 2021
From: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
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 2e9a3581de..3194232500 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -869,45 +869,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 349b4b1269..20641c2d2b 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
--
2.31.1
More information about the ffmpeg-devel
mailing list