From patchwork Thu Feb 1 18:29:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Faiz X-Patchwork-Id: 7473 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.156.27 with SMTP id q27csp3410390jak; Thu, 1 Feb 2018 10:30:28 -0800 (PST) X-Google-Smtp-Source: AH8x225UqgaH+0jROQbtuYAbO17oO/Gc7unmM5+vINxeihHq/NuZkJFecPvwfrM0R8gzHYmy1gDl X-Received: by 10.28.120.15 with SMTP id t15mr8877067wmc.34.1517509828310; Thu, 01 Feb 2018 10:30:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517509828; cv=none; d=google.com; s=arc-20160816; b=zZt4rzBG6r7wZwFgMmUwUXBs9dmJxAGhh/3harg8Fie4buHPJbn8Cpu1IC+xFLKFQx A8phSxIJEY2HmgX2ZgC8RiPhewVYU0zIysh0LJ8851C0XRt9IpgL1YejQyw73QfK/77m N9YT3JXFLyx46geHI8Aq+zBh+6zOrDA+yaxG+RtFkgszqpbFmG7UshQvlbyNAPJz57UO agwqA64CmWRL5iY7q90mKtwFodZGGIHtzhdkbHvbD27Q/SyYF5eWCPXHsZjAK62ry6iz zmd0zMJhqpC5WBGp3w3T+tyFsZ8/M8rojvLYhGN1qtQaNzlH3UmLW/SfvqftVNxIg4h2 7dJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=3E+xE1Ihbe4+O1LkQtJ2V4471yxs/xEbs5rcTA/7qrs=; b=fAWUZxrsMtUB/VESpO0xjau/c7r/ghx4BQi1noS394eSYwSo7aZAy4lq8Kn62JZsO3 rUxGML4JiLttPndzjgE5d6JarSq08fz4AtOp4nt0AqynRzGm4qG2NtMSuPBXWxF3w31I 7E3+a6HCuJY+zAlYGJcz7wgFbC1G7sqKfBLCC7weP/BGilqC9oduKBl8YJnbsWKYB0LZ BecVdQ7iQIsW2Zmhs+DdUvulj5j61fkpJoGLVtHpZkh4lIjX7XFxHVJzpG+VY30DCtgM rHb4bN1MN9yLNc4sapFHMiu6P+3JAgn5ZYkeSz7G1C0BYg+BynHWUlfn+yCzcO75grOI 6Jjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=RuPHr1Jo; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id h11si131242wrf.158.2018.02.01.10.30.27; Thu, 01 Feb 2018 10:30:28 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=RuPHr1Jo; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 885A9689B85; Thu, 1 Feb 2018 20:30:19 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl0-f66.google.com (mail-pl0-f66.google.com [209.85.160.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 02B02680368 for ; Thu, 1 Feb 2018 20:30:12 +0200 (EET) Received: by mail-pl0-f66.google.com with SMTP id o13so4162878pli.6 for ; Thu, 01 Feb 2018 10:30:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=DUwgC8w4fOvitRaHdnHq2AwhWHsba2Bf5RPPhKCaYRg=; b=RuPHr1JoAsfIaHmxCXmlUZjst3HEYHyZIKE+0tu8FlJRTufK3SC9BqF2Dn0uqf3OjE XbzFzq7AkA4pWpO6UZFpTfzNttHbpD4u7pVJNTBWt3eI8HIxG+Nqprii8l72Wet6QUZR WGLxXeA7h21SkJjcPhmlYzz5fcjt3BncCRUJNMyrJOFkBri59C0BANuaaOwadnt9l4uv w0NPPeIcnOPOey/Bd8ynXnWQ8XMaRZny49bqKlDeZbC29kssmYL23gPQ5G3mIzb1+BPS HAoXLBZpnPaSmV/S77BbXZV62HAdOctlxDVS4L42YFGPCs0guFGu9a2AoXzrenebTDcN LZdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=DUwgC8w4fOvitRaHdnHq2AwhWHsba2Bf5RPPhKCaYRg=; b=qSZ1sR5h/YJ9B31LKT8HRbAm8MYf5NmVzvLUGCoNT+cpOJWjSftjtjdr+2mvE3N4wz l2pwNwSIBax5g6pLLYeF4rIGpv0D2ICbHVK0dn/tlOBYploLxtR/JvnsQdeSIaQGNOIZ OQbBD3JeTS4IXMaTK4hrEOSCjHmsAT2D6cF0j5P19ECZAGykAwKH7NyWvQ3QSSV6S0z2 iuQtZXRBjWZjOy+qUvs9SU5m3E8SAHMHQxanUEom90s1iG9AlHp3h6qx0UCKYhrsOJMC cYAeftcJ9yNhGiExvJuHLPTQ5DRQP+ZPhWyFe/PrbHGlx1u+mrO5PUGY/cXT1tMV6PYo x2ew== X-Gm-Message-State: AKwxytf69XIDwV8wskoEhtV7/FSkBwTMmEPrKQgRTsT8zVd/3yEyFTCK QACf8uSDKRVF7tyzz1mCMsZp0h1f X-Received: by 2002:a17:902:67:: with SMTP id 94-v6mr32353671pla.183.1517509815665; Thu, 01 Feb 2018 10:30:15 -0800 (PST) Received: from localhost.localdomain ([114.124.213.12]) by smtp.gmail.com with ESMTPSA id v73sm232641pfk.84.2018.02.01.10.30.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Feb 2018 10:30:14 -0800 (PST) From: Muhammad Faiz To: ffmpeg-devel@ffmpeg.org Date: Fri, 2 Feb 2018 01:29:54 +0700 Message-Id: <20180201182954.31793-1-mfcc64@gmail.com> X-Mailer: git-send-email 2.13.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avfilter: sort filter list X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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 --- 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 <= 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..7ac2cfa8dd 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) checkasm: $(CHECKASM)