Re: [FFmpeg-devel] [PATCH v2 2/5] lavfi: add new iteration API

2018-03-24 Thread Michael Niedermayer
On Sat, Mar 24, 2018 at 01:28:51AM +, Josh de Kock wrote:
> Signed-off-by: Josh de Kock 
> ---
>  configure|  24 +-
>  doc/APIchanges   |   4 +
>  doc/writing_filters.txt  |   6 +-
>  libavfilter/allfilters.c | 820 
> +--
>  libavfilter/avfilter.c   |  50 +--
>  libavfilter/avfilter.h   |  29 +-
>  libavfilter/version.h|   3 +
>  7 files changed, 481 insertions(+), 455 deletions(-)

This causes "ffplay -h" to infinite loop

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No great genius has ever existed without some touch of madness. -- Aristotle


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2 2/5] lavfi: add new iteration API

2018-03-23 Thread Josh de Kock
Signed-off-by: Josh de Kock 
---
 configure|  24 +-
 doc/APIchanges   |   4 +
 doc/writing_filters.txt  |   6 +-
 libavfilter/allfilters.c | 820 +--
 libavfilter/avfilter.c   |  50 +--
 libavfilter/avfilter.h   |  29 +-
 libavfilter/version.h|   3 +
 7 files changed, 481 insertions(+), 455 deletions(-)

diff --git a/configure b/configure
index cc3edeb80f..9966ae3c10 100755
--- a/configure
+++ b/configure
@@ -3561,15 +3561,6 @@ for v in "$@"; do
 FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
 done
 
-find_things(){
-thing=$1
-pattern=$2
-file=$source_path/$3
-sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" 
"$file"
-}
-
-FILTER_LIST=$(find_things   filter   FILTER   libavfilter/allfilters.c)
-
 find_things_extern(){
 thing=$1
 pattern=$2
@@ -3578,6 +3569,13 @@ find_things_extern(){
 sed -n "s/^[^#]*extern.*$pattern *ff_\([^ ]*\)_$thing;/\1_$out/p" "$file"
 }
 
+find_filters_extern(){
+file=$source_path/$1
+#sed -n "s/^extern AVFilter 
ff_\([avfsinkrc]\{2,5\}\)_\(\w\+\);/\2_filter/p" $file
+sed -E -n "s/^extern AVFilter 
ff_([avfsinkrc]{2,5})_([a-zA-Z0-9_]+);/\2_filter/p" $file
+}
+
+FILTER_LIST=$(find_filters_extern libavfilter/allfilters.c)
 OUTDEV_LIST=$(find_things_extern muxer AVOutputFormat libavdevice/alldevices.c 
outdev)
 INDEV_LIST=$(find_things_extern demuxer AVInputFormat libavdevice/alldevices.c 
indev)
 MUXER_LIST=$(find_things_extern muxer AVOutputFormat libavformat/allformats.c)
@@ -7088,6 +7086,10 @@ echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
 
 cp_if_changed $TMPH libavutil/avconfig.h
 
+full_filter_name(){
+sed -n "s/^extern AVFilter ff_\([avfsinkrc]\{2,5\}\)_$1;/\1_$1/p" 
$source_path/libavfilter/allfilters.c
+}
+
 # generate the lists of enabled components
 print_enabled_components(){
 file=$1
@@ -7098,6 +7100,9 @@ print_enabled_components(){
 for c in $*; do
 if enabled $c; then
 case $name in
+filter_list)
+c=$(full_filter_name $(remove_suffix _filter $c))
+;;
 indev_list)
 c=$(add_suffix _demuxer $(remove_suffix _indev $c))
 ;;
@@ -7112,6 +7117,7 @@ print_enabled_components(){
 cp_if_changed $TMPH $file
 }
 
+print_enabled_components libavfilter/filter_list.c AVFilter filter_list 
$FILTER_LIST
 print_enabled_components libavcodec/codec_list.c AVCodec codec_list $CODEC_LIST
 print_enabled_components libavcodec/parser_list.c AVCodecParser parser_list 
$PARSER_LIST
 print_enabled_components libavcodec/bsf_list.c AVBitStreamFilter 
bitstream_filters $BSF_LIST
diff --git a/doc/APIchanges b/doc/APIchanges
index d410bcdd75..4052988f59 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,10 @@ libavutil: 2017-10-21
 
 API changes, most recent first:
 
+2018-xx-xx - xxx - lavc 7.13.100 - avcodec.h
+  Deprecate use of avfilter_register(), avfilter_register_all(),
+  avfilter_next(). Add av_filter_iterate().
+
 2018-03-21 - xxx - lavc 58.15.100 - avcodec.h
   Add av_packet_make_writable().
 
diff --git a/doc/writing_filters.txt b/doc/writing_filters.txt
index 5cd4ecd6a4..98b9c6f3d2 100644
--- a/doc/writing_filters.txt
+++ b/doc/writing_filters.txt
@@ -31,10 +31,8 @@ If everything went right, you should get a foobar.png with 
Lena edge-detected.
 That's it, your new playground is ready.
 
 Some little details about what's going on:
-libavfilter/allfilters.c:avfilter_register_all() is called at runtime to create
-a list of the available filters, but it's important to know that this file is
-also parsed by the configure script, which in turn will define variables for
-the build system and the C:
+libavfilter/allfilters.c:this file is parsed by the configure script, which in 
turn
+will define variables for the build system and the C:
 
 --- after running configure ---
 
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 3f67e321bf..2c63f02a54 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -23,410 +23,452 @@
 #include "avfilter.h"
 #include "config.h"
 
+extern AVFilter ff_af_abench;
+extern AVFilter ff_af_acompressor;
+extern AVFilter ff_af_acontrast;
+extern AVFilter ff_af_acopy;
+extern AVFilter ff_af_acrossfade;
+extern AVFilter ff_af_acrusher;
+extern AVFilter ff_af_adelay;
+extern AVFilter ff_af_aecho;
+extern AVFilter ff_af_aemphasis;
+extern AVFilter ff_af_aeval;
+extern AVFilter ff_af_afade;
+extern AVFilter ff_af_afftfilt;
+extern AVFilter ff_af_afir;
+extern AVFilter ff_af_aformat;
+extern AVFilter ff_af_agate;
+extern AVFilter ff_af_aiir;
+extern AVFilter ff_af_ainterleave;
+extern AVFilter ff_af_alimiter;
+extern AVFilter ff_af_allpass;
+extern AVFilter ff_af_aloop;
+extern AVFilter ff_af_amerge;
+extern AVFilter ff_af_ametadata;
+extern AVFilter ff_af_amix;
+extern AVFilter ff_af_anequalizer;
+extern AVFilter