[FFmpeg-devel] [PATCH v2] avfilter: sort filter list

Muhammad Faiz mfcc64 at gmail.com
Fri Feb 2 10:21:11 EET 2018


Move REGISTER_FILTER to FILTER_TABLE in configure.
Replace linked list with static table, and sort it.
Use bsearch() on avfilter_get_by_name().
Deprecate avfilter_register_all(), avfilter_register(), and
avfilter_next().
Add avfilter_iterate() as a replacement for avfilter_next().

Signed-off-by: Muhammad Faiz <mfcc64 at gmail.com>
---
 Makefile                 |   5 +-
 configure                | 428 ++++++++++++++++++++++++++++++++++++++++++++-
 doc/APIchanges           |   4 +
 libavfilter/allfilters.c | 441 ++++++-----------------------------------------
 libavfilter/avfilter.c   |  65 ++-----
 libavfilter/avfilter.h   |  20 ++-
 libavfilter/buffersink.c |   4 +-
 libavfilter/version.h    |  10 +-
 tests/checkasm/Makefile  |   2 +-
 9 files changed, 532 insertions(+), 447 deletions(-)

diff --git a/Makefile b/Makefile
index 9defddebfd..6427abafb5 100644
--- a/Makefile
+++ b/Makefile
@@ -61,7 +61,7 @@ CONFIGURABLE_COMPONENTS =                                           \
     $(SRC_PATH)/libavformat/protocols.c                             \
 
 config.h: ffbuild/.config
-ffbuild/.config: $(CONFIGURABLE_COMPONENTS)
+ffbuild/.config: $(CONFIGURABLE_COMPONENTS) $(SRC_PATH)/configure
 	@-tput bold 2>/dev/null
 	@-printf '\nWARNING: $(?) newer than config.h, rerun configure\n\n'
 	@-tput sgr0 2>/dev/null
@@ -142,7 +142,8 @@ distclean:: clean
 	$(RM) .version avversion.h config.asm config.h mapfile  \
 		ffbuild/.config ffbuild/config.* libavutil/avconfig.h \
 		version.h libavutil/ffversion.h libavcodec/codec_names.h \
-		libavcodec/bsf_list.c libavformat/protocol_list.c
+		libavcodec/bsf_list.c libavformat/protocol_list.c \
+		libavfilter/filter_list.c
 ifeq ($(SRC_LINK),src)
 	$(RM) src
 endif
diff --git a/configure b/configure
index fcfa7aa442..a11798625e 100755
--- a/configure
+++ b/configure
@@ -3177,6 +3177,381 @@ unix_protocol_deps="sys_un_h"
 unix_protocol_select="network"
 
 # filters
+FILTER_TABLE="
+abench                  af
+acompressor             af
+acontrast               af
+acopy                   af
+acrossfade              af
+acrusher                af
+adelay                  af
+aecho                   af
+aemphasis               af
+aeval                   af
+afade                   af
+afftfilt                af
+afir                    af
+aformat                 af
+agate                   af
+aiir                    af
+ainterleave             af
+alimiter                af
+allpass                 af
+aloop                   af
+amerge                  af
+ametadata               af
+amix                    af
+anequalizer             af
+anull                   af
+apad                    af
+aperms                  af
+aphaser                 af
+apulsator               af
+arealtime               af
+aresample               af
+areverse                af
+aselect                 af
+asendcmd                af
+asetnsamples            af
+asetpts                 af
+asetrate                af
+asettb                  af
+ashowinfo               af
+asidedata               af
+asplit                  af
+astats                  af
+astreamselect           af
+atempo                  af
+atrim                   af
+azmq                    af
+bandpass                af
+bandreject              af
+bass                    af
+biquad                  af
+bs2b                    af
+channelmap              af
+channelsplit            af
+chorus                  af
+compand                 af
+compensationdelay       af
+crossfeed               af
+crystalizer             af
+dcshift                 af
+dynaudnorm              af
+earwax                  af
+ebur128                 af
+equalizer               af
+extrastereo             af
+firequalizer            af
+flanger                 af
+haas                    af
+hdcd                    af
+headphone               af
+highpass                af
+join                    af
+ladspa                  af
+loudnorm                af
+lowpass                 af
+lv2                     af
+mcompand                af
+pan                     af
+replaygain              af
+resample                af
+rubberband              af
+sidechaincompress       af
+sidechaingate           af
+silencedetect           af
+silenceremove           af
+sofalizer               af
+stereotools             af
+stereowiden             af
+superequalizer          af
+surround                af
+treble                  af
+tremolo                 af
+vibrato                 af
+volume                  af
+volumedetect            af
+aevalsrc                asrc
+anoisesrc               asrc
+anullsrc                asrc
+flite                   asrc
+hilbert                 asrc
+sine                    asrc
+anullsink               asink
+alphaextract            vf
+alphamerge              vf
+ass                     vf
+atadenoise              vf
+avgblur                 vf
+bbox                    vf
+bench                   vf
+bitplanenoise           vf
+blackdetect             vf
+blackframe              vf
+blend                   vf
+boxblur                 vf
+bwdif                   vf
+chromakey               vf
+ciescope                vf
+codecview               vf
+colorbalance            vf
+colorchannelmixer       vf
+colorkey                vf
+colorlevels             vf
+colormatrix             vf
+colorspace              vf
+convolution             vf
+convolve                vf
+copy                    vf
+coreimage               vf
+cover_rect              vf
+crop                    vf
+cropdetect              vf
+curves                  vf
+datascope               vf
+dctdnoiz                vf
+deband                  vf
+decimate                vf
+deconvolve              vf
+deflate                 vf
+deflicker               vf
+deinterlace_qsv         vf
+deinterlace_vaapi       vf
+dejudder                vf
+delogo                  vf
+denoise_vaapi           vf
+deshake                 vf
+despill                 vf
+detelecine              vf
+dilation                vf
+displace                vf
+doubleweave             vf
+drawbox                 vf
+drawgraph               vf
+drawgrid                vf
+drawtext                vf
+edgedetect              vf
+elbg                    vf
+entropy                 vf
+eq                      vf
+erosion                 vf
+extractplanes           vf
+fade                    vf
+fftfilt                 vf
+field                   vf
+fieldhint               vf
+fieldmatch              vf
+fieldorder              vf
+fillborders             vf
+find_rect               vf
+floodfill               vf
+format                  vf
+fps                     vf
+framepack               vf
+framerate               vf
+framestep               vf
+frei0r                  vf
+fspp                    vf
+gblur                   vf
+geq                     vf
+gradfun                 vf
+haldclut                vf
+hflip                   vf
+histeq                  vf
+histogram               vf
+hqdn3d                  vf
+hqx                     vf
+hstack                  vf
+hue                     vf
+hwdownload              vf
+hwmap                   vf
+hwupload                vf
+hwupload_cuda           vf
+hysteresis              vf
+idet                    vf
+il                      vf
+inflate                 vf
+interlace               vf
+interleave              vf
+kerndeint               vf
+lenscorrection          vf
+libvmaf                 vf
+limiter                 vf
+loop                    vf
+lumakey                 vf
+lut                     vf
+lut2                    vf
+lut3d                   vf
+lutrgb                  vf
+lutyuv                  vf
+maskedclamp             vf
+maskedmerge             vf
+mcdeint                 vf
+mergeplanes             vf
+mestimate               vf
+metadata                vf
+midequalizer            vf
+minterpolate            vf
+mix                     vf
+mpdecimate              vf
+negate                  vf
+nlmeans                 vf
+nnedi                   vf
+noformat                vf
+noise                   vf
+normalize               vf
+null                    vf
+ocr                     vf
+ocv                     vf
+oscilloscope            vf
+overlay                 vf
+overlay_opencl          vf
+overlay_qsv             vf
+owdenoise               vf
+pad                     vf
+palettegen              vf
+paletteuse              vf
+perms                   vf
+perspective             vf
+phase                   vf
+pixdesctest             vf
+pixscope                vf
+pp                      vf
+pp7                     vf
+premultiply             vf
+prewitt                 vf
+procamp_vaapi           vf
+program_opencl          vf
+pseudocolor             vf
+psnr                    vf
+pullup                  vf
+qp                      vf
+random                  vf
+readeia608              vf
+readvitc                vf
+realtime                vf
+remap                   vf
+removegrain             vf
+removelogo              vf
+repeatfields            vf
+reverse                 vf
+roberts                 vf
+rotate                  vf
+sab                     vf
+scale                   vf
+scale_cuda              vf
+scale_npp               vf
+scale_qsv               vf
+scale_vaapi             vf
+scale2ref               vf
+select                  vf
+selectivecolor          vf
+sendcmd                 vf
+separatefields          vf
+setdar                  vf
+setfield                vf
+setpts                  vf
+setrange                vf
+setsar                  vf
+settb                   vf
+sharpness_vaapi         vf
+showinfo                vf
+showpalette             vf
+shuffleframes           vf
+shuffleplanes           vf
+sidedata                vf
+signalstats             vf
+signature               vf
+smartblur               vf
+sobel                   vf
+split                   vf
+spp                     vf
+ssim                    vf
+stereo3d                vf
+streamselect            vf
+subtitles               vf
+super2xsai              vf
+swaprect                vf
+swapuv                  vf
+tblend                  vf
+telecine                vf
+threshold               vf
+thumbnail               vf
+thumbnail_cuda          vf
+tile                    vf
+tinterlace              vf
+tlut2                   vf
+tonemap                 vf
+transpose               vf
+trim                    vf
+unpremultiply           vf
+unsharp                 vf
+unsharp_opencl          vf
+uspp                    vf
+vaguedenoiser           vf
+vectorscope             vf
+vflip                   vf
+vidstabdetect           vf
+vidstabtransform        vf
+vignette                vf
+vmafmotion              vf
+vpp_qsv                 vf
+vstack                  vf
+w3fdif                  vf
+waveform                vf
+weave                   vf
+xbr                     vf
+yadif                   vf
+zmq                     vf
+zoompan                 vf
+zscale                  vf
+allrgb                  vsrc
+allyuv                  vsrc
+cellauto                vsrc
+color                   vsrc
+coreimagesrc            vsrc
+frei0r_src              vsrc
+haldclutsrc             vsrc
+life                    vsrc
+mandelbrot              vsrc
+mptestsrc               vsrc
+nullsrc                 vsrc
+openclsrc               vsrc
+rgbtestsrc              vsrc
+smptebars               vsrc
+smptehdbars             vsrc
+testsrc                 vsrc
+testsrc2                vsrc
+yuvtestsrc              vsrc
+nullsink                vsink
+abitscope               avf
+adrawgraph              avf
+ahistogram              avf
+aphasemeter             avf
+avectorscope            avf
+concat                  avf
+showcqt                 avf
+showfreqs               avf
+showspectrum            avf
+showspectrumpic         avf
+showvolume              avf
+showwaves               avf
+showwavespic            avf
+spectrumsynth           vaf
+amovie                  avsrc
+movie                   avsrc
+"
+
+UNCONDITIONAL_FILTER_TABLE="
+abuffer         asrc
+buffer          vsrc
+abuffersink     asink
+buffersink      vsink
+afifo           af
+fifo            vf
+"
+
 afftfilt_filter_deps="avcodec"
 afftfilt_filter_select="fft"
 afir_filter_deps="avcodec"
@@ -3530,7 +3905,18 @@ MUXER_LIST=$(find_things    muxer    _MUX     libavformat/allformats.c)
 DEMUXER_LIST=$(find_things  demuxer  DEMUX    libavformat/allformats.c)
 OUTDEV_LIST=$(find_things   outdev   OUTDEV   libavdevice/alldevices.c)
 INDEV_LIST=$(find_things    indev    _IN      libavdevice/alldevices.c)
-FILTER_LIST=$(find_things   filter   FILTER   libavfilter/allfilters.c)
+
+extract_list_from_table(){
+    cols=$1
+    suffix=$2
+    shift 2
+    while test -n "$1"; do
+        echo "${1}${suffix}"
+        shift $cols
+    done
+}
+
+FILTER_LIST=$(extract_list_from_table 2 _filter $FILTER_TABLE)
 
 find_things_extern(){
     thing=$1
@@ -7030,6 +7416,46 @@ print_enabled_components(){
 print_enabled_components libavcodec/bsf_list.c AVBitStreamFilter bitstream_filters $BSF_LIST
 print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $PROTOCOL_LIST
 
+# filters
+extract_enabled_filter(){
+    while test -n "$1"; do
+        if enabled "${1}_filter"; then
+            echo "$1 $2"
+        fi
+        shift 2
+    done
+}
+
+extract_sorted_filter(){
+    while test -n "$1"; do
+        echo "$1 $2"
+        shift 2
+    done | sort
+}
+
+print_filter_extern(){
+    while test -n "$1"; do
+        echo "extern AVFilter ff_${2}_${1};"
+        shift 2
+    done
+}
+
+print_filter_array(){
+    echo "static AVFilter *const filter_list[] = {"
+    while test -n "$1"; do
+        echo "    &ff_${2}_${1},"
+        shift 2
+    done
+    echo "};"
+}
+
+sorted_filter_table=$(extract_sorted_filter $(extract_enabled_filter $FILTER_TABLE) $UNCONDITIONAL_FILTER_TABLE)
+
+echo "/* Automatically generated by configure - do not modify! */" > $TMPH
+print_filter_extern $sorted_filter_table >> $TMPH
+print_filter_array $sorted_filter_table >> $TMPH
+cp_if_changed $TMPH libavfilter/filter_list.c
+
 # Settings for pkg-config files
 
 cat > $TMPH <<EOF
diff --git a/doc/APIchanges b/doc/APIchanges
index 6185545d56..03842e914e 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,10 @@ libavutil:     2017-10-21
 
 API changes, most recent first:
 
+2018-02-xx - xxxxxxx - lavfi 7.12.100 - avfilter.h
+  Deprecate avfilter_register_all(), avfilter_register(), and avfilter_next().
+  Add avfilter_iterate() as a replacement of avfilter_next().
+
 2018-01-xx - xxxxxxx - lavf 58.7.100 - avformat.h
   Deprecate AVFormatContext filename field which had limited length, use the
   new dynamically allocated url field instead.
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 9adb1090b7..b8901388e5 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -19,412 +19,77 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/avassert.h"
 #include "libavutil/thread.h"
 #include "avfilter.h"
 #include "config.h"
 
+#include "libavfilter/filter_list.c"
 
-#define REGISTER_FILTER(X, x, y)                                        \
-    {                                                                   \
-        extern AVFilter ff_##y##_##x;                                   \
-        if (CONFIG_##X##_FILTER)                                        \
-            avfilter_register(&ff_##y##_##x);                           \
-    }
 
-#define REGISTER_FILTER_UNCONDITIONAL(x)                                \
-    {                                                                   \
-        extern AVFilter ff_##x;                                         \
-        avfilter_register(&ff_##x);                                     \
+#if defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
+static void check_validity(void)
+{
+    int k;
+    for (k = 0; k < FF_ARRAY_ELEMS(filter_list) - 1; k++) {
+        if (strcmp(filter_list[k]->name, filter_list[k+1]->name) >= 0) {
+            av_log(NULL, AV_LOG_FATAL, "%s filter: unsorted with %s.\n", filter_list[k]->name, filter_list[k+1]->name);
+            av_assert0(0);
+        }
     }
+}
 
-static void register_all(void)
-{
-    REGISTER_FILTER(ABENCH,         abench,         af);
-    REGISTER_FILTER(ACOMPRESSOR,    acompressor,    af);
-    REGISTER_FILTER(ACONTRAST,      acontrast,      af);
-    REGISTER_FILTER(ACOPY,          acopy,          af);
-    REGISTER_FILTER(ACROSSFADE,     acrossfade,     af);
-    REGISTER_FILTER(ACRUSHER,       acrusher,       af);
-    REGISTER_FILTER(ADELAY,         adelay,         af);
-    REGISTER_FILTER(AECHO,          aecho,          af);
-    REGISTER_FILTER(AEMPHASIS,      aemphasis,      af);
-    REGISTER_FILTER(AEVAL,          aeval,          af);
-    REGISTER_FILTER(AFADE,          afade,          af);
-    REGISTER_FILTER(AFFTFILT,       afftfilt,       af);
-    REGISTER_FILTER(AFIR,           afir,           af);
-    REGISTER_FILTER(AFORMAT,        aformat,        af);
-    REGISTER_FILTER(AGATE,          agate,          af);
-    REGISTER_FILTER(AIIR,           aiir,           af);
-    REGISTER_FILTER(AINTERLEAVE,    ainterleave,    af);
-    REGISTER_FILTER(ALIMITER,       alimiter,       af);
-    REGISTER_FILTER(ALLPASS,        allpass,        af);
-    REGISTER_FILTER(ALOOP,          aloop,          af);
-    REGISTER_FILTER(AMERGE,         amerge,         af);
-    REGISTER_FILTER(AMETADATA,      ametadata,      af);
-    REGISTER_FILTER(AMIX,           amix,           af);
-    REGISTER_FILTER(ANEQUALIZER,    anequalizer,    af);
-    REGISTER_FILTER(ANULL,          anull,          af);
-    REGISTER_FILTER(APAD,           apad,           af);
-    REGISTER_FILTER(APERMS,         aperms,         af);
-    REGISTER_FILTER(APHASER,        aphaser,        af);
-    REGISTER_FILTER(APULSATOR,      apulsator,      af);
-    REGISTER_FILTER(AREALTIME,      arealtime,      af);
-    REGISTER_FILTER(ARESAMPLE,      aresample,      af);
-    REGISTER_FILTER(AREVERSE,       areverse,       af);
-    REGISTER_FILTER(ASELECT,        aselect,        af);
-    REGISTER_FILTER(ASENDCMD,       asendcmd,       af);
-    REGISTER_FILTER(ASETNSAMPLES,   asetnsamples,   af);
-    REGISTER_FILTER(ASETPTS,        asetpts,        af);
-    REGISTER_FILTER(ASETRATE,       asetrate,       af);
-    REGISTER_FILTER(ASETTB,         asettb,         af);
-    REGISTER_FILTER(ASHOWINFO,      ashowinfo,      af);
-    REGISTER_FILTER(ASIDEDATA,      asidedata,      af);
-    REGISTER_FILTER(ASPLIT,         asplit,         af);
-    REGISTER_FILTER(ASTATS,         astats,         af);
-    REGISTER_FILTER(ASTREAMSELECT,  astreamselect,  af);
-    REGISTER_FILTER(ATEMPO,         atempo,         af);
-    REGISTER_FILTER(ATRIM,          atrim,          af);
-    REGISTER_FILTER(AZMQ,           azmq,           af);
-    REGISTER_FILTER(BANDPASS,       bandpass,       af);
-    REGISTER_FILTER(BANDREJECT,     bandreject,     af);
-    REGISTER_FILTER(BASS,           bass,           af);
-    REGISTER_FILTER(BIQUAD,         biquad,         af);
-    REGISTER_FILTER(BS2B,           bs2b,           af);
-    REGISTER_FILTER(CHANNELMAP,     channelmap,     af);
-    REGISTER_FILTER(CHANNELSPLIT,   channelsplit,   af);
-    REGISTER_FILTER(CHORUS,         chorus,         af);
-    REGISTER_FILTER(COMPAND,        compand,        af);
-    REGISTER_FILTER(COMPENSATIONDELAY, compensationdelay, af);
-    REGISTER_FILTER(CROSSFEED,      crossfeed,      af);
-    REGISTER_FILTER(CRYSTALIZER,    crystalizer,    af);
-    REGISTER_FILTER(DCSHIFT,        dcshift,        af);
-    REGISTER_FILTER(DYNAUDNORM,     dynaudnorm,     af);
-    REGISTER_FILTER(EARWAX,         earwax,         af);
-    REGISTER_FILTER(EBUR128,        ebur128,        af);
-    REGISTER_FILTER(EQUALIZER,      equalizer,      af);
-    REGISTER_FILTER(EXTRASTEREO,    extrastereo,    af);
-    REGISTER_FILTER(FIREQUALIZER,   firequalizer,   af);
-    REGISTER_FILTER(FLANGER,        flanger,        af);
-    REGISTER_FILTER(HAAS,           haas,           af);
-    REGISTER_FILTER(HDCD,           hdcd,           af);
-    REGISTER_FILTER(HEADPHONE,      headphone,      af);
-    REGISTER_FILTER(HIGHPASS,       highpass,       af);
-    REGISTER_FILTER(JOIN,           join,           af);
-    REGISTER_FILTER(LADSPA,         ladspa,         af);
-    REGISTER_FILTER(LOUDNORM,       loudnorm,       af);
-    REGISTER_FILTER(LOWPASS,        lowpass,        af);
-    REGISTER_FILTER(LV2,            lv2,            af);
-    REGISTER_FILTER(MCOMPAND,       mcompand,       af);
-    REGISTER_FILTER(PAN,            pan,            af);
-    REGISTER_FILTER(REPLAYGAIN,     replaygain,     af);
-    REGISTER_FILTER(RESAMPLE,       resample,       af);
-    REGISTER_FILTER(RUBBERBAND,     rubberband,     af);
-    REGISTER_FILTER(SIDECHAINCOMPRESS, sidechaincompress, af);
-    REGISTER_FILTER(SIDECHAINGATE,  sidechaingate,  af);
-    REGISTER_FILTER(SILENCEDETECT,  silencedetect,  af);
-    REGISTER_FILTER(SILENCEREMOVE,  silenceremove,  af);
-    REGISTER_FILTER(SOFALIZER,      sofalizer,      af);
-    REGISTER_FILTER(STEREOTOOLS,    stereotools,    af);
-    REGISTER_FILTER(STEREOWIDEN,    stereowiden,    af);
-    REGISTER_FILTER(SUPEREQUALIZER, superequalizer, af);
-    REGISTER_FILTER(SURROUND,       surround,       af);
-    REGISTER_FILTER(TREBLE,         treble,         af);
-    REGISTER_FILTER(TREMOLO,        tremolo,        af);
-    REGISTER_FILTER(VIBRATO,        vibrato,        af);
-    REGISTER_FILTER(VOLUME,         volume,         af);
-    REGISTER_FILTER(VOLUMEDETECT,   volumedetect,   af);
+static AVOnce check_validity_once = AV_ONCE_INIT;
+#define CHECK_VALIDITY() ff_thread_once(&check_validity_once, check_validity)
+#else
+#define CHECK_VALIDITY() ((void)0)
+#endif
 
-    REGISTER_FILTER(AEVALSRC,       aevalsrc,       asrc);
-    REGISTER_FILTER(ANOISESRC,      anoisesrc,      asrc);
-    REGISTER_FILTER(ANULLSRC,       anullsrc,       asrc);
-    REGISTER_FILTER(FLITE,          flite,          asrc);
-    REGISTER_FILTER(HILBERT,        hilbert,        asrc);
-    REGISTER_FILTER(SINE,           sine,           asrc);
+static int compare_name(const void *key, const void *elem)
+{
+    const char *name = key;
+    const AVFilter *const *filter = elem;
+    return strcmp(name, (*filter)->name);
+}
 
-    REGISTER_FILTER(ANULLSINK,      anullsink,      asink);
+const AVFilter *avfilter_get_by_name(const char *name)
+{
+    const AVFilter **filter;
 
-    REGISTER_FILTER(ALPHAEXTRACT,   alphaextract,   vf);
-    REGISTER_FILTER(ALPHAMERGE,     alphamerge,     vf);
-    REGISTER_FILTER(ASS,            ass,            vf);
-    REGISTER_FILTER(ATADENOISE,     atadenoise,     vf);
-    REGISTER_FILTER(AVGBLUR,        avgblur,        vf);
-    REGISTER_FILTER(BBOX,           bbox,           vf);
-    REGISTER_FILTER(BENCH,          bench,          vf);
-    REGISTER_FILTER(BITPLANENOISE,  bitplanenoise,  vf);
-    REGISTER_FILTER(BLACKDETECT,    blackdetect,    vf);
-    REGISTER_FILTER(BLACKFRAME,     blackframe,     vf);
-    REGISTER_FILTER(BLEND,          blend,          vf);
-    REGISTER_FILTER(BOXBLUR,        boxblur,        vf);
-    REGISTER_FILTER(BWDIF,          bwdif,          vf);
-    REGISTER_FILTER(CHROMAKEY,      chromakey,      vf);
-    REGISTER_FILTER(CIESCOPE,       ciescope,       vf);
-    REGISTER_FILTER(CODECVIEW,      codecview,      vf);
-    REGISTER_FILTER(COLORBALANCE,   colorbalance,   vf);
-    REGISTER_FILTER(COLORCHANNELMIXER, colorchannelmixer, vf);
-    REGISTER_FILTER(COLORKEY,       colorkey,       vf);
-    REGISTER_FILTER(COLORLEVELS,    colorlevels,    vf);
-    REGISTER_FILTER(COLORMATRIX,    colormatrix,    vf);
-    REGISTER_FILTER(COLORSPACE,     colorspace,     vf);
-    REGISTER_FILTER(CONVOLUTION,    convolution,    vf);
-    REGISTER_FILTER(CONVOLVE,       convolve,       vf);
-    REGISTER_FILTER(COPY,           copy,           vf);
-    REGISTER_FILTER(COREIMAGE,      coreimage,      vf);
-    REGISTER_FILTER(COVER_RECT,     cover_rect,     vf);
-    REGISTER_FILTER(CROP,           crop,           vf);
-    REGISTER_FILTER(CROPDETECT,     cropdetect,     vf);
-    REGISTER_FILTER(CURVES,         curves,         vf);
-    REGISTER_FILTER(DATASCOPE,      datascope,      vf);
-    REGISTER_FILTER(DCTDNOIZ,       dctdnoiz,       vf);
-    REGISTER_FILTER(DEBAND,         deband,         vf);
-    REGISTER_FILTER(DECIMATE,       decimate,       vf);
-    REGISTER_FILTER(DECONVOLVE,     deconvolve,     vf);
-    REGISTER_FILTER(DEFLATE,        deflate,        vf);
-    REGISTER_FILTER(DEFLICKER,      deflicker,      vf);
-    REGISTER_FILTER(DEINTERLACE_QSV,deinterlace_qsv,vf);
-    REGISTER_FILTER(DEINTERLACE_VAAPI, deinterlace_vaapi, vf);
-    REGISTER_FILTER(DEJUDDER,       dejudder,       vf);
-    REGISTER_FILTER(DELOGO,         delogo,         vf);
-    REGISTER_FILTER(DENOISE_VAAPI,  denoise_vaapi,  vf);
-    REGISTER_FILTER(DESHAKE,        deshake,        vf);
-    REGISTER_FILTER(DESPILL,        despill,        vf);
-    REGISTER_FILTER(DETELECINE,     detelecine,     vf);
-    REGISTER_FILTER(DILATION,       dilation,       vf);
-    REGISTER_FILTER(DISPLACE,       displace,       vf);
-    REGISTER_FILTER(DOUBLEWEAVE,    doubleweave,    vf);
-    REGISTER_FILTER(DRAWBOX,        drawbox,        vf);
-    REGISTER_FILTER(DRAWGRAPH,      drawgraph,      vf);
-    REGISTER_FILTER(DRAWGRID,       drawgrid,       vf);
-    REGISTER_FILTER(DRAWTEXT,       drawtext,       vf);
-    REGISTER_FILTER(EDGEDETECT,     edgedetect,     vf);
-    REGISTER_FILTER(ELBG,           elbg,           vf);
-    REGISTER_FILTER(ENTROPY,        entropy,        vf);
-    REGISTER_FILTER(EQ,             eq,             vf);
-    REGISTER_FILTER(EROSION,        erosion,        vf);
-    REGISTER_FILTER(EXTRACTPLANES,  extractplanes,  vf);
-    REGISTER_FILTER(FADE,           fade,           vf);
-    REGISTER_FILTER(FFTFILT,        fftfilt,        vf);
-    REGISTER_FILTER(FIELD,          field,          vf);
-    REGISTER_FILTER(FIELDHINT,      fieldhint,      vf);
-    REGISTER_FILTER(FIELDMATCH,     fieldmatch,     vf);
-    REGISTER_FILTER(FIELDORDER,     fieldorder,     vf);
-    REGISTER_FILTER(FILLBORDERS,    fillborders,    vf);
-    REGISTER_FILTER(FIND_RECT,      find_rect,      vf);
-    REGISTER_FILTER(FLOODFILL,      floodfill,      vf);
-    REGISTER_FILTER(FORMAT,         format,         vf);
-    REGISTER_FILTER(FPS,            fps,            vf);
-    REGISTER_FILTER(FRAMEPACK,      framepack,      vf);
-    REGISTER_FILTER(FRAMERATE,      framerate,      vf);
-    REGISTER_FILTER(FRAMESTEP,      framestep,      vf);
-    REGISTER_FILTER(FREI0R,         frei0r,         vf);
-    REGISTER_FILTER(FSPP,           fspp,           vf);
-    REGISTER_FILTER(GBLUR,          gblur,          vf);
-    REGISTER_FILTER(GEQ,            geq,            vf);
-    REGISTER_FILTER(GRADFUN,        gradfun,        vf);
-    REGISTER_FILTER(HALDCLUT,       haldclut,       vf);
-    REGISTER_FILTER(HFLIP,          hflip,          vf);
-    REGISTER_FILTER(HISTEQ,         histeq,         vf);
-    REGISTER_FILTER(HISTOGRAM,      histogram,      vf);
-    REGISTER_FILTER(HQDN3D,         hqdn3d,         vf);
-    REGISTER_FILTER(HQX,            hqx,            vf);
-    REGISTER_FILTER(HSTACK,         hstack,         vf);
-    REGISTER_FILTER(HUE,            hue,            vf);
-    REGISTER_FILTER(HWDOWNLOAD,     hwdownload,     vf);
-    REGISTER_FILTER(HWMAP,          hwmap,          vf);
-    REGISTER_FILTER(HWUPLOAD,       hwupload,       vf);
-    REGISTER_FILTER(HWUPLOAD_CUDA,  hwupload_cuda,  vf);
-    REGISTER_FILTER(HYSTERESIS,     hysteresis,     vf);
-    REGISTER_FILTER(IDET,           idet,           vf);
-    REGISTER_FILTER(IL,             il,             vf);
-    REGISTER_FILTER(INFLATE,        inflate,        vf);
-    REGISTER_FILTER(INTERLACE,      interlace,      vf);
-    REGISTER_FILTER(INTERLEAVE,     interleave,     vf);
-    REGISTER_FILTER(KERNDEINT,      kerndeint,      vf);
-    REGISTER_FILTER(LENSCORRECTION, lenscorrection, vf);
-    REGISTER_FILTER(LIBVMAF,        libvmaf,        vf);
-    REGISTER_FILTER(LIMITER,        limiter,        vf);
-    REGISTER_FILTER(LOOP,           loop,           vf);
-    REGISTER_FILTER(LUMAKEY,        lumakey,        vf);
-    REGISTER_FILTER(LUT,            lut,            vf);
-    REGISTER_FILTER(LUT2,           lut2,           vf);
-    REGISTER_FILTER(LUT3D,          lut3d,          vf);
-    REGISTER_FILTER(LUTRGB,         lutrgb,         vf);
-    REGISTER_FILTER(LUTYUV,         lutyuv,         vf);
-    REGISTER_FILTER(MASKEDCLAMP,    maskedclamp,    vf);
-    REGISTER_FILTER(MASKEDMERGE,    maskedmerge,    vf);
-    REGISTER_FILTER(MCDEINT,        mcdeint,        vf);
-    REGISTER_FILTER(MERGEPLANES,    mergeplanes,    vf);
-    REGISTER_FILTER(MESTIMATE,      mestimate,      vf);
-    REGISTER_FILTER(METADATA,       metadata,       vf);
-    REGISTER_FILTER(MIDEQUALIZER,   midequalizer,   vf);
-    REGISTER_FILTER(MINTERPOLATE,   minterpolate,   vf);
-    REGISTER_FILTER(MIX,            mix,            vf);
-    REGISTER_FILTER(MPDECIMATE,     mpdecimate,     vf);
-    REGISTER_FILTER(NEGATE,         negate,         vf);
-    REGISTER_FILTER(NLMEANS,        nlmeans,        vf);
-    REGISTER_FILTER(NNEDI,          nnedi,          vf);
-    REGISTER_FILTER(NOFORMAT,       noformat,       vf);
-    REGISTER_FILTER(NOISE,          noise,          vf);
-    REGISTER_FILTER(NORMALIZE,      normalize,      vf);
-    REGISTER_FILTER(NULL,           null,           vf);
-    REGISTER_FILTER(OCR,            ocr,            vf);
-    REGISTER_FILTER(OCV,            ocv,            vf);
-    REGISTER_FILTER(OSCILLOSCOPE,   oscilloscope,   vf);
-    REGISTER_FILTER(OVERLAY,        overlay,        vf);
-    REGISTER_FILTER(OVERLAY_OPENCL, overlay_opencl, vf);
-    REGISTER_FILTER(OVERLAY_QSV,    overlay_qsv,    vf);
-    REGISTER_FILTER(OWDENOISE,      owdenoise,      vf);
-    REGISTER_FILTER(PAD,            pad,            vf);
-    REGISTER_FILTER(PALETTEGEN,     palettegen,     vf);
-    REGISTER_FILTER(PALETTEUSE,     paletteuse,     vf);
-    REGISTER_FILTER(PERMS,          perms,          vf);
-    REGISTER_FILTER(PERSPECTIVE,    perspective,    vf);
-    REGISTER_FILTER(PHASE,          phase,          vf);
-    REGISTER_FILTER(PIXDESCTEST,    pixdesctest,    vf);
-    REGISTER_FILTER(PIXSCOPE,       pixscope,       vf);
-    REGISTER_FILTER(PP,             pp,             vf);
-    REGISTER_FILTER(PP7,            pp7,            vf);
-    REGISTER_FILTER(PREMULTIPLY,    premultiply,    vf);
-    REGISTER_FILTER(PREWITT,        prewitt,        vf);
-    REGISTER_FILTER(PROCAMP_VAAPI,  procamp_vaapi,  vf);
-    REGISTER_FILTER(PROGRAM_OPENCL, program_opencl, vf);
-    REGISTER_FILTER(PSEUDOCOLOR,    pseudocolor,    vf);
-    REGISTER_FILTER(PSNR,           psnr,           vf);
-    REGISTER_FILTER(PULLUP,         pullup,         vf);
-    REGISTER_FILTER(QP,             qp,             vf);
-    REGISTER_FILTER(RANDOM,         random,         vf);
-    REGISTER_FILTER(READEIA608,     readeia608,     vf);
-    REGISTER_FILTER(READVITC,       readvitc,       vf);
-    REGISTER_FILTER(REALTIME,       realtime,       vf);
-    REGISTER_FILTER(REMAP,          remap,          vf);
-    REGISTER_FILTER(REMOVEGRAIN,    removegrain,    vf);
-    REGISTER_FILTER(REMOVELOGO,     removelogo,     vf);
-    REGISTER_FILTER(REPEATFIELDS,   repeatfields,   vf);
-    REGISTER_FILTER(REVERSE,        reverse,        vf);
-    REGISTER_FILTER(ROBERTS,        roberts,        vf);
-    REGISTER_FILTER(ROTATE,         rotate,         vf);
-    REGISTER_FILTER(SAB,            sab,            vf);
-    REGISTER_FILTER(SCALE,          scale,          vf);
-    REGISTER_FILTER(SCALE_CUDA,     scale_cuda,     vf);
-    REGISTER_FILTER(SCALE_NPP,      scale_npp,      vf);
-    REGISTER_FILTER(SCALE_QSV,      scale_qsv,      vf);
-    REGISTER_FILTER(SCALE_VAAPI,    scale_vaapi,    vf);
-    REGISTER_FILTER(SCALE2REF,      scale2ref,      vf);
-    REGISTER_FILTER(SELECT,         select,         vf);
-    REGISTER_FILTER(SELECTIVECOLOR, selectivecolor, vf);
-    REGISTER_FILTER(SENDCMD,        sendcmd,        vf);
-    REGISTER_FILTER(SEPARATEFIELDS, separatefields, vf);
-    REGISTER_FILTER(SETDAR,         setdar,         vf);
-    REGISTER_FILTER(SETFIELD,       setfield,       vf);
-    REGISTER_FILTER(SETPTS,         setpts,         vf);
-    REGISTER_FILTER(SETRANGE,       setrange,       vf);
-    REGISTER_FILTER(SETSAR,         setsar,         vf);
-    REGISTER_FILTER(SETTB,          settb,          vf);
-    REGISTER_FILTER(SHARPNESS_VAAPI, sharpness_vaapi, vf);
-    REGISTER_FILTER(SHOWINFO,       showinfo,       vf);
-    REGISTER_FILTER(SHOWPALETTE,    showpalette,    vf);
-    REGISTER_FILTER(SHUFFLEFRAMES,  shuffleframes,  vf);
-    REGISTER_FILTER(SHUFFLEPLANES,  shuffleplanes,  vf);
-    REGISTER_FILTER(SIDEDATA,       sidedata,       vf);
-    REGISTER_FILTER(SIGNALSTATS,    signalstats,    vf);
-    REGISTER_FILTER(SIGNATURE,      signature,      vf);
-    REGISTER_FILTER(SMARTBLUR,      smartblur,      vf);
-    REGISTER_FILTER(SOBEL,          sobel,          vf);
-    REGISTER_FILTER(SPLIT,          split,          vf);
-    REGISTER_FILTER(SPP,            spp,            vf);
-    REGISTER_FILTER(SSIM,           ssim,           vf);
-    REGISTER_FILTER(STEREO3D,       stereo3d,       vf);
-    REGISTER_FILTER(STREAMSELECT,   streamselect,   vf);
-    REGISTER_FILTER(SUBTITLES,      subtitles,      vf);
-    REGISTER_FILTER(SUPER2XSAI,     super2xsai,     vf);
-    REGISTER_FILTER(SWAPRECT,       swaprect,       vf);
-    REGISTER_FILTER(SWAPUV,         swapuv,         vf);
-    REGISTER_FILTER(TBLEND,         tblend,         vf);
-    REGISTER_FILTER(TELECINE,       telecine,       vf);
-    REGISTER_FILTER(THRESHOLD,      threshold,      vf);
-    REGISTER_FILTER(THUMBNAIL,      thumbnail,      vf);
-    REGISTER_FILTER(THUMBNAIL_CUDA, thumbnail_cuda, vf);
-    REGISTER_FILTER(TILE,           tile,           vf);
-    REGISTER_FILTER(TINTERLACE,     tinterlace,     vf);
-    REGISTER_FILTER(TLUT2,          tlut2,          vf);
-    REGISTER_FILTER(TONEMAP,        tonemap,        vf);
-    REGISTER_FILTER(TRANSPOSE,      transpose,      vf);
-    REGISTER_FILTER(TRIM,           trim,           vf);
-    REGISTER_FILTER(UNPREMULTIPLY,  unpremultiply,  vf);
-    REGISTER_FILTER(UNSHARP,        unsharp,        vf);
-    REGISTER_FILTER(UNSHARP_OPENCL, unsharp_opencl, vf);
-    REGISTER_FILTER(USPP,           uspp,           vf);
-    REGISTER_FILTER(VAGUEDENOISER,  vaguedenoiser,  vf);
-    REGISTER_FILTER(VECTORSCOPE,    vectorscope,    vf);
-    REGISTER_FILTER(VFLIP,          vflip,          vf);
-    REGISTER_FILTER(VIDSTABDETECT,  vidstabdetect,  vf);
-    REGISTER_FILTER(VIDSTABTRANSFORM, vidstabtransform, vf);
-    REGISTER_FILTER(VIGNETTE,       vignette,       vf);
-    REGISTER_FILTER(VMAFMOTION,     vmafmotion,     vf);
-    REGISTER_FILTER(VPP_QSV,        vpp_qsv,        vf);
-    REGISTER_FILTER(VSTACK,         vstack,         vf);
-    REGISTER_FILTER(W3FDIF,         w3fdif,         vf);
-    REGISTER_FILTER(WAVEFORM,       waveform,       vf);
-    REGISTER_FILTER(WEAVE,          weave,          vf);
-    REGISTER_FILTER(XBR,            xbr,            vf);
-    REGISTER_FILTER(YADIF,          yadif,          vf);
-    REGISTER_FILTER(ZMQ,            zmq,            vf);
-    REGISTER_FILTER(ZOOMPAN,        zoompan,        vf);
-    REGISTER_FILTER(ZSCALE,         zscale,         vf);
+    CHECK_VALIDITY();
+    filter = bsearch(name, filter_list, FF_ARRAY_ELEMS(filter_list) - 1,
+                     sizeof(filter_list[0]), compare_name);
+    return filter ? *filter : NULL;
+}
 
-    REGISTER_FILTER(ALLRGB,         allrgb,         vsrc);
-    REGISTER_FILTER(ALLYUV,         allyuv,         vsrc);
-    REGISTER_FILTER(CELLAUTO,       cellauto,       vsrc);
-    REGISTER_FILTER(COLOR,          color,          vsrc);
-    REGISTER_FILTER(COREIMAGESRC,   coreimagesrc,   vsrc);
-    REGISTER_FILTER(FREI0R,         frei0r_src,     vsrc);
-    REGISTER_FILTER(HALDCLUTSRC,    haldclutsrc,    vsrc);
-    REGISTER_FILTER(LIFE,           life,           vsrc);
-    REGISTER_FILTER(MANDELBROT,     mandelbrot,     vsrc);
-    REGISTER_FILTER(MPTESTSRC,      mptestsrc,      vsrc);
-    REGISTER_FILTER(NULLSRC,        nullsrc,        vsrc);
-    REGISTER_FILTER(OPENCLSRC,      openclsrc,      vsrc);
-    REGISTER_FILTER(RGBTESTSRC,     rgbtestsrc,     vsrc);
-    REGISTER_FILTER(SMPTEBARS,      smptebars,      vsrc);
-    REGISTER_FILTER(SMPTEHDBARS,    smptehdbars,    vsrc);
-    REGISTER_FILTER(TESTSRC,        testsrc,        vsrc);
-    REGISTER_FILTER(TESTSRC2,       testsrc2,       vsrc);
-    REGISTER_FILTER(YUVTESTSRC,     yuvtestsrc,     vsrc);
+const AVFilter *avfilter_iterate(unsigned index)
+{
+    if (index < FF_ARRAY_ELEMS(filter_list))
+        return filter_list[index];
+    return NULL;
+}
 
-    REGISTER_FILTER(NULLSINK,       nullsink,       vsink);
+#if FF_API_FILTER_NEXT
+static void initialize_next(void)
+{
+    int k;
+    for (k = 0; k < FF_ARRAY_ELEMS(filter_list) - 1; k++)
+        filter_list[k]->next = filter_list[k+1];
+}
 
-    /* multimedia filters */
-    REGISTER_FILTER(ABITSCOPE,      abitscope,      avf);
-    REGISTER_FILTER(ADRAWGRAPH,     adrawgraph,     avf);
-    REGISTER_FILTER(AHISTOGRAM,     ahistogram,     avf);
-    REGISTER_FILTER(APHASEMETER,    aphasemeter,    avf);
-    REGISTER_FILTER(AVECTORSCOPE,   avectorscope,   avf);
-    REGISTER_FILTER(CONCAT,         concat,         avf);
-    REGISTER_FILTER(SHOWCQT,        showcqt,        avf);
-    REGISTER_FILTER(SHOWFREQS,      showfreqs,      avf);
-    REGISTER_FILTER(SHOWSPECTRUM,   showspectrum,   avf);
-    REGISTER_FILTER(SHOWSPECTRUMPIC, showspectrumpic, avf);
-    REGISTER_FILTER(SHOWVOLUME,     showvolume,     avf);
-    REGISTER_FILTER(SHOWWAVES,      showwaves,      avf);
-    REGISTER_FILTER(SHOWWAVESPIC,   showwavespic,   avf);
-    REGISTER_FILTER(SPECTRUMSYNTH,  spectrumsynth,  vaf);
 
-    /* multimedia sources */
-    REGISTER_FILTER(AMOVIE,         amovie,         avsrc);
-    REGISTER_FILTER(MOVIE,          movie,          avsrc);
+const AVFilter *avfilter_next(const AVFilter *prev)
+{
+    static AVOnce once = AV_ONCE_INIT;
 
-    /* those filters are part of public or internal API => registered
-     * unconditionally */
-    REGISTER_FILTER_UNCONDITIONAL(asrc_abuffer);
-    REGISTER_FILTER_UNCONDITIONAL(vsrc_buffer);
-    REGISTER_FILTER_UNCONDITIONAL(asink_abuffer);
-    REGISTER_FILTER_UNCONDITIONAL(vsink_buffer);
-    REGISTER_FILTER_UNCONDITIONAL(af_afifo);
-    REGISTER_FILTER_UNCONDITIONAL(vf_fifo);
+    ff_thread_once(&once, initialize_next);
+    return prev ? prev->next : filter_list[0];
 }
+#endif
 
+#if FF_API_FILTER_REGISTER
 void avfilter_register_all(void)
 {
-    static AVOnce control = AV_ONCE_INIT;
-
-    ff_thread_once(&control, register_all);
+    /* do nothing */
 }
+#endif
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index ea75467a75..016325a4bf 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -575,50 +575,14 @@ int avfilter_process_command(AVFilterContext *filter, const char *cmd, const cha
     return AVERROR(ENOSYS);
 }
 
-static AVFilter *first_filter;
-static AVFilter **last_filter = &first_filter;
-
-const AVFilter *avfilter_get_by_name(const char *name)
-{
-    const AVFilter *f = NULL;
-
-    if (!name)
-        return NULL;
-
-    while ((f = avfilter_next(f)))
-        if (!strcmp(f->name, name))
-            return (AVFilter *)f;
-
-    return NULL;
-}
-
-static AVMutex filter_register_mutex = AV_MUTEX_INITIALIZER;
-
+#if FF_API_FILTER_REGISTER
+attribute_deprecated
 int avfilter_register(AVFilter *filter)
 {
-    AVFilter **f;
-
-    /* the filter must select generic or internal exclusively */
-    av_assert0((filter->flags & AVFILTER_FLAG_SUPPORT_TIMELINE) != AVFILTER_FLAG_SUPPORT_TIMELINE);
-
-    ff_mutex_lock(&filter_register_mutex);
-    f = last_filter;
-
-    while (*f)
-        f = &(*f)->next;
-    *f = filter;
-    filter->next = NULL;
-    last_filter = &filter->next;
-
-    ff_mutex_unlock(&filter_register_mutex);
-
-    return 0;
-}
-
-const AVFilter *avfilter_next(const AVFilter *prev)
-{
-    return prev ? prev->next : first_filter;
+    av_log(NULL, AV_LOG_ERROR, "External filter registration is unsupported.\n");
+    return AVERROR(EINVAL);
 }
+#endif
 
 int avfilter_pad_count(const AVFilterPad *pads)
 {
@@ -649,18 +613,19 @@ static void *filter_child_next(void *obj, void *prev)
 static const AVClass *filter_child_class_next(const AVClass *prev)
 {
     const AVFilter *f = NULL;
+    unsigned i = 0;
 
-    /* find the filter that corresponds to prev */
-    while (prev && (f = avfilter_next(f)))
-        if (f->priv_class == prev)
-            break;
-
-    /* could not find filter corresponding to prev */
-    if (prev && !f)
-        return NULL;
+    if (prev) {
+        for (i = 0; f = avfilter_iterate(i); i++) {
+            if (f->priv_class == prev) {
+                i++;
+                break;
+            }
+        }
+    }
 
     /* find next filter with specific options */
-    while ((f = avfilter_next(f)))
+    for ( ; f = avfilter_iterate(i); i++)
         if (f->priv_class)
             return f->priv_class;
 
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index 62eed2168f..460babd929 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -681,7 +681,12 @@ int avfilter_config_links(AVFilterContext *filter);
  */
 int avfilter_process_command(AVFilterContext *filter, const char *cmd, const char *arg, char *res, int res_len, int flags);
 
-/** Initialize the filter system. Register all builtin filters. */
+#if FF_API_FILTER_REGISTER
+/**
+ * Initialize the filter system. Register all builtin filters.
+ * @deprecated Internal filters do not require filter registration.
+ */
+attribute_deprecated
 void avfilter_register_all(void);
 
 /**
@@ -693,8 +698,11 @@ void avfilter_register_all(void);
  * @param filter the filter to register
  * @return 0 if the registration was successful, a negative value
  * otherwise
+ * @deprecated Internal filters do not require filter registration.
  */
+attribute_deprecated
 int avfilter_register(AVFilter *filter);
+#endif
 
 /**
  * Get a filter definition matching the given name.
@@ -706,11 +714,21 @@ int avfilter_register(AVFilter *filter);
 const AVFilter *avfilter_get_by_name(const char *name);
 
 /**
+ * Iterate over all filters.
+ * @return      the filter definition if index < number of filters, or NULL.
+ */
+const AVFilter *avfilter_iterate(unsigned index);
+
+#if FF_API_FILTER_NEXT
+/**
  * Iterate over all registered filters.
  * @return If prev is non-NULL, next registered filter after prev or NULL if
  * prev is the last filter. If prev is NULL, return the first registered filter.
+ * @deprecated Use avfilter_iterate() instead.
  */
+attribute_deprecated
 const AVFilter *avfilter_next(const AVFilter *prev);
+#endif
 
 /**
  * Initialize a filter with the supplied parameters.
diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c
index 0f87b5439a..626aac73df 100644
--- a/libavfilter/buffersink.c
+++ b/libavfilter/buffersink.c
@@ -342,7 +342,7 @@ static const AVFilterPad avfilter_vsink_buffer_inputs[] = {
     { NULL }
 };
 
-AVFilter ff_vsink_buffer = {
+AVFilter ff_vsink_buffersink = {
     .name        = "buffersink",
     .description = NULL_IF_CONFIG_SMALL("Buffer video frames, and make them available to the end of the filter graph."),
     .priv_size   = sizeof(BufferSinkContext),
@@ -363,7 +363,7 @@ static const AVFilterPad avfilter_asink_abuffer_inputs[] = {
     { NULL }
 };
 
-AVFilter ff_asink_abuffer = {
+AVFilter ff_asink_abuffersink = {
     .name        = "abuffersink",
     .description = NULL_IF_CONFIG_SMALL("Buffer audio frames, and make them available to the end of the filter graph."),
     .priv_class  = &abuffersink_class,
diff --git a/libavfilter/version.h b/libavfilter/version.h
index 0f11721822..93f4ffc2a6 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -30,8 +30,8 @@
 #include "libavutil/version.h"
 
 #define LIBAVFILTER_VERSION_MAJOR   7
-#define LIBAVFILTER_VERSION_MINOR  11
-#define LIBAVFILTER_VERSION_MICRO 101
+#define LIBAVFILTER_VERSION_MINOR  12
+#define LIBAVFILTER_VERSION_MICRO 100
 
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
                                                LIBAVFILTER_VERSION_MINOR, \
@@ -58,5 +58,11 @@
 #ifndef FF_API_FILTER_GET_SET
 #define FF_API_FILTER_GET_SET               (LIBAVFILTER_VERSION_MAJOR < 8)
 #endif
+#ifndef FF_API_FILTER_REGISTER
+#define FF_API_FILTER_REGISTER              (LIBAVFILTER_VERSION_MAJOR < 9)
+#endif
+#ifndef FF_API_FILTER_NEXT
+#define FF_API_FILTER_NEXT                  (LIBAVFILTER_VERSION_MAJOR < 9)
+#endif
 
 #endif /* AVFILTER_VERSION_H */
diff --git a/tests/checkasm/Makefile b/tests/checkasm/Makefile
index afbd09b940..8de45cddab 100644
--- a/tests/checkasm/Makefile
+++ b/tests/checkasm/Makefile
@@ -61,7 +61,7 @@ tests/checkasm/checkasm.o: CFLAGS += -Umain
 CHECKASM := tests/checkasm/checkasm$(EXESUF)
 
 $(CHECKASM): $(CHECKASMOBJS) $(FF_STATIC_DEP_LIBS)
-	$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(CHECKASMOBJS) $(FF_STATIC_DEP_LIBS) $(EXTRALIBS-avcodec) $(EXTRALIBS-avfilter) $(EXTRALIBS-avutil) $(EXTRALIBS)
+	$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(CHECKASMOBJS) $(FF_STATIC_DEP_LIBS) $(EXTRALIBS-avcodec) $(EXTRALIBS-avfilter) $(EXTRALIBS-avutil) $(EXTRALIBS-avformat) $(EXTRALIBS-swresample) $(EXTRALIBS)
 
 checkasm: $(CHECKASM)
 
-- 
2.13.2



More information about the ffmpeg-devel mailing list