avcodec: Remove AVCodec, AVParser and AVBitStreamFilter next API

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
pull/362/head
Andreas Rheinhardt 4 years ago committed by James Almer
parent b06082d1d5
commit 4b2be3f8d4
  1. 39
      libavcodec/allcodecs.c
  2. 40
      libavcodec/avcodec.h
  3. 6
      libavcodec/bitstream_filters.c
  4. 3
      libavcodec/codec.h
  5. 35
      libavcodec/parsers.c
  6. 3
      libavcodec/version.h

@ -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){

@ -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 */
/**

@ -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;

@ -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
* @{

@ -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;

@ -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

Loading…
Cancel
Save