History

avcodec: Remove AVCodec, AVParser and AVBitStreamFilter next API

Andreas Rheinhardt committed 5 years ago

Commit 4b2be3f1 parent b06082d6 files · +0 −126Browse files

Unified · Split

6 files
  1. libavcodec/allcodecs.c +0 −39
  2. libavcodec/avcodec.h +0 −40
  3. libavcodec/bitstream_filters.c +0 −6
  4. libavcodec/codec.h +0 −3
  5. libavcodec/parsers.c +0 −35
  6. libavcodec/version.h +0 −3
libavcodec/allcodecs.c+0−39
@@ -870,45 +870,6 @@ const AVCodec *av_codec_iterate(void **opaque) · 869 unmodified lines
870 return c;870 return c;
871}871}
872 872
873#if FF_API_NEXT
874FF_DISABLE_DEPRECATION_WARNINGS
875static AVOnce av_codec_next_init = AV_ONCE_INIT;
876
877static void av_codec_init_next(void)
878{
879 AVCodec *prev = NULL, *p;
880 void *i = 0;
881 while ((p = (AVCodec*)av_codec_iterate(&i))) {
882 if (prev)
883 prev->next = p;
884 prev = p;
885 }
886}
887
888
889
890av_cold void avcodec_register(AVCodec *codec)
891{
892 ff_thread_once(&av_codec_next_init, av_codec_init_next);
893}
894
895AVCodec *av_codec_next(const AVCodec *c)
896{
897 ff_thread_once(&av_codec_next_init, av_codec_init_next);
898
899 if (c)
900 return c->next;
901 else
902 return (AVCodec*)codec_list[0];
903}
904
905void avcodec_register_all(void)
906{
907 ff_thread_once(&av_codec_next_init, av_codec_init_next);
908}
909FF_ENABLE_DEPRECATION_WARNINGS
910#endif
911
912static enum AVCodecID remap_deprecated_codec_id(enum AVCodecID id)873static enum AVCodecID remap_deprecated_codec_id(enum AVCodecID id)
913{874{
914 switch(id){875 switch(id){
libavcodec/avcodec.h+0−40
@@ -2728,16 +2728,6 @@ typedef struct AVSubtitle { · 2727 unmodified lines
2728 int64_t pts; ///< Same as packet pts, in AV_TIME_BASE2728 int64_t pts; ///< Same as packet pts, in AV_TIME_BASE
2729} AVSubtitle;2729} AVSubtitle;
2730 2730
2731#if FF_API_NEXT
2732/**
2733 * If c is NULL, returns the first registered codec,
2734 * if c is non-NULL, returns the next registered codec after c,
2735 * or NULL if c is the last one.
2736 */
2737attribute_deprecated
2738AVCodec *av_codec_next(const AVCodec *c);
2739#endif
2740
2741/**2731/**
2742 * Return the LIBAVCODEC_VERSION_INT constant.2732 * Return the LIBAVCODEC_VERSION_INT constant.
2743 */2733 */
@@ -2753,20 +2743,6 @@ const char *avcodec_configuration(void); · 9 unmodified lines
2753 */2743 */
2754const char *avcodec_license(void);2744const char *avcodec_license(void);
2755 2745
2756#if FF_API_NEXT
2757/**
2758 * @deprecated Calling this function is unnecessary.
2759 */
2760attribute_deprecated
2761void avcodec_register(AVCodec *codec);
2762
2763/**
2764 * @deprecated Calling this function is unnecessary.
2765 */
2766attribute_deprecated
2767void avcodec_register_all(void);
2768#endif
2769
2770/**2746/**
2771 * Allocate an AVCodecContext and set its fields to default values. The2747 * Allocate an AVCodecContext and set its fields to default values. The
2772 * resulting struct should be freed with avcodec_free_context().2748 * resulting struct should be freed with avcodec_free_context().
@@ -3553,10 +3529,6 @@ typedef struct AVCodecParser { · 780 unmodified lines
3553 const uint8_t *buf, int buf_size);3529 const uint8_t *buf, int buf_size);
3554 void (*parser_close)(AVCodecParserContext *s);3530 void (*parser_close)(AVCodecParserContext *s);
3555 int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);3531 int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
3556#if FF_API_NEXT
3557 attribute_deprecated
3558 struct AVCodecParser *next;
3559#endif
3560} AVCodecParser;3532} AVCodecParser;
3561 3533
3562/**3534/**
@@ -3570,13 +3542,6 @@ typedef struct AVCodecParser { · 7 unmodified lines
3570 */3542 */
3571const AVCodecParser *av_parser_iterate(void **opaque);3543const AVCodecParser *av_parser_iterate(void **opaque);
3572 3544
3573#if FF_API_NEXT
3574attribute_deprecated
3575AVCodecParser *av_parser_next(const AVCodecParser *c);
3576
3577attribute_deprecated
3578void av_register_codec_parser(AVCodecParser *parser);
3579#endif
3580AVCodecParserContext *av_parser_init(int codec_id);3545AVCodecParserContext *av_parser_init(int codec_id);
3581 3546
3582/**3547/**
@@ -4065,11 +4030,6 @@ attribute_deprecated · 482 unmodified lines
4065const AVBitStreamFilter *av_bitstream_filter_next(const AVBitStreamFilter *f);4030const AVBitStreamFilter *av_bitstream_filter_next(const AVBitStreamFilter *f);
4066#endif4031#endif
4067 4032
4068#if FF_API_NEXT
4069attribute_deprecated
4070const AVBitStreamFilter *av_bsf_next(void **opaque);
4071#endif
4072
4073/* memory */4033/* memory */
4074 4034
4075/**4035/**
libavcodec/bitstream_filters.c+0−6
@@ -75,12 +75,6 @@ const AVBitStreamFilter *av_bsf_iterate(void **opaque) · 74 unmodified lines
75 return f;75 return f;
76}76}
77 77
78#if FF_API_NEXT
79const AVBitStreamFilter *av_bsf_next(void **opaque) {
80 return av_bsf_iterate(opaque);
81}
82#endif
83
84const AVBitStreamFilter *av_bsf_get_by_name(const char *name)78const AVBitStreamFilter *av_bsf_get_by_name(const char *name)
85{79{
86 const AVBitStreamFilter *f = NULL;80 const AVBitStreamFilter *f = NULL;
libavcodec/codec.h+0−3
@@ -243,9 +243,6 @@ typedef struct AVCodec { · 242 unmodified lines
243 *****************************************************************243 *****************************************************************
244 */244 */
245 int priv_data_size;245 int priv_data_size;
246#if FF_API_NEXT
247 struct AVCodec *next;
248#endif
249 /**246 /**
250 * @name Frame-level threading support functions247 * @name Frame-level threading support functions
251 * @{248 * @{
libavcodec/parsers.c+0−35
@@ -18,10 +18,7 @@ · 17 unmodified lines
18 18
19#include <stdint.h>19#include <stdint.h>
20 20
21#include "libavutil/thread.h"
22
23#include "avcodec.h"21#include "avcodec.h"
24#include "version.h"
25 22
26extern AVCodecParser ff_aac_parser;23extern AVCodecParser ff_aac_parser;
27extern AVCodecParser ff_aac_latm_parser;24extern AVCodecParser ff_aac_latm_parser;
@@ -78,38 +75,6 @@ extern AVCodecParser ff_xma_parser; · 50 unmodified lines
78 75
79#include "libavcodec/parser_list.c"76#include "libavcodec/parser_list.c"
80 77
81#if FF_API_NEXT
82FF_DISABLE_DEPRECATION_WARNINGS
83static AVOnce av_parser_next_init = AV_ONCE_INIT;
84
85static void av_parser_init_next(void)
86{
87 AVCodecParser *prev = NULL, *p;
88 int i = 0;
89 while ((p = (AVCodecParser*)parser_list[i++])) {
90 if (prev)
91 prev->next = p;
92 prev = p;
93 }
94}
95
96AVCodecParser *av_parser_next(const AVCodecParser *p)
97{
98 ff_thread_once(&av_parser_next_init, av_parser_init_next);
99
100 if (p)
101 return p->next;
102 else
103 return (AVCodecParser*)parser_list[0];
104}
105
106void av_register_codec_parser(AVCodecParser *parser)
107{
108 ff_thread_once(&av_parser_next_init, av_parser_init_next);
109}
110FF_ENABLE_DEPRECATION_WARNINGS
111#endif
112
113const AVCodecParser *av_parser_iterate(void **opaque)78const AVCodecParser *av_parser_iterate(void **opaque)
114{79{
115 uintptr_t i = (uintptr_t)*opaque;80 uintptr_t i = (uintptr_t)*opaque;
libavcodec/version.h+0−3
@@ -120,9 +120,6 @@ · 119 unmodified lines
120#ifndef FF_API_LOCKMGR120#ifndef FF_API_LOCKMGR
121#define FF_API_LOCKMGR (LIBAVCODEC_VERSION_MAJOR < 59)121#define FF_API_LOCKMGR (LIBAVCODEC_VERSION_MAJOR < 59)
122#endif122#endif
123#ifndef FF_API_NEXT
124#define FF_API_NEXT (LIBAVCODEC_VERSION_MAJOR < 59)
125#endif
126#ifndef FF_API_UNSANITIZED_BITRATES123#ifndef FF_API_UNSANITIZED_BITRATES
127#define FF_API_UNSANITIZED_BITRATES (LIBAVCODEC_VERSION_MAJOR < 59)124#define FF_API_UNSANITIZED_BITRATES (LIBAVCODEC_VERSION_MAJOR < 59)
128#endif125#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t