Convert filters to lopsub.
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 10 Apr 2016 20:44:30 +0000 (22:44 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 26 Mar 2017 09:02:28 +0000 (11:02 +0200)
commit4adde8dae3317fa83b81e7a860c9ed9133e99bb0
tree36d8f128f4227f47d484d23de22fa70e292f8bb8
parent44779382f0699be6b8daeeb25e7e1a2c40116d4b
Convert filters to lopsub.

This replaces the *_filter.m4 gengetopt files by the filter_cmd
lopsub suite, where each filter is realized as a subcommand. Due to
this change, para_filter needs to be linked with -llopsub.

The filter structure is now stored in the user_data pointer provided
by lopsub, allowing to get rid of the global filters[] array, the
FILTER_ENUM macro and the corresponding enumeration constants.

The removal of the ->goo_help member of struct filter makes this
structure constant. Hence ->init() of struct filter can also go
away. We still can tell whether a filter is supported by checking
the user_data pointer: if it is NULL, the filter is unsupported. The
new filter_supported() helper in filter_common.c is provided for
convenience.

Parsing of the filter command line options is now performed
generically, and the ->parse_config() method is renamed to ->setup(),
an optional function which is supposed to perform semantic checks
and the one-time setup of the filter, if any. It is accompanied by
->teardown() which replaces ->free_config().

The conversion of the individual filters is easy since most filters
have a simple syntax or take no arguments at all. The resample_filter,
however, needs a different way to copy the wav parameters from the
lopsub parse result to the wav parms structure. A suitable macro,
LLS_COPY_WAV_PARMS is added to check_wav.h for this purpose. The old
COPY_WAV_PARMS needs to stay until para_write, the only other user
of the macro, has been converted as well.

The section heading of the manual page has changed slightly, causing
t0005 to fail. Hence this test needs a slight adjustment.
36 files changed:
Makefile.in
Makefile.real
aacdec_filter.c
amp_filter.c
audiod.c
check_wav.h
compress_filter.c
configure.ac
error.h
fecdec_filter.c
filter.c
filter.h
filter_common.c
flacdec_filter.c
m4/gengetopt/amp_filter.m4 [deleted file]
m4/gengetopt/compress_filter.m4 [deleted file]
m4/gengetopt/mp3dec_filter.m4 [deleted file]
m4/gengetopt/prebuffer_filter.m4 [deleted file]
m4/gengetopt/resample_filter.m4 [deleted file]
m4/gengetopt/sync_filter.m4 [deleted file]
m4/lls/filter_cmd.suite.m4 [new file with mode: 0644]
m4/lls/include/channels.m4 [new file with mode: 0644]
m4/lls/include/sample-format.m4 [new file with mode: 0644]
m4/lls/include/sample-rate.m4 [new file with mode: 0644]
man_util.bash
mp3dec_filter.c
oggdec_filter.c
opusdec_filter.c
play.c
prebuffer_filter.c
resample_filter.c
spxdec_filter.c
sync_filter.c
t/t0005-man.sh
wav_filter.c
wmadec_filter.c