From: Andre Noll Date: Wed, 30 Dec 2009 00:38:26 +0000 (+0100) Subject: First preparations for btr support in para_filter. X-Git-Tag: v0.4.2~238 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=d1e55304068a6a82553f40ae7bee746f5ca2233d;hp=e4713d70469e7ca1afd8e8b9a3e67c3764cf3933 First preparations for btr support in para_filter. --- diff --git a/filter.c b/filter.c index a1cc648d..20ea1333 100644 --- a/filter.c +++ b/filter.c @@ -153,6 +153,12 @@ static int parse_config(int argc, char *argv[]) return 1; } +/* TODO: support more than one filter, actually parse options */ +static int main_btr(void) +{ + return 42; +} + /** * The main function of para_filter. * @@ -170,13 +176,17 @@ int main(int argc, char *argv[]) int ret; static struct sched s; - stdin_set_defaults(sit); - sit->buf = para_malloc(sit->bufsize), - filter_init(); ret = parse_config(argc, argv); if (ret < 0) goto out; + if (conf.buffer_tree_given) { + ret = main_btr(); + goto out; + } + stdin_set_defaults(sit); + sit->buf = para_malloc(sit->bufsize), + ret = init_filter_chain(); if (ret < 0) goto out; diff --git a/filter.h b/filter.h index 15bfaf8c..9f3ddd69 100644 --- a/filter.h +++ b/filter.h @@ -32,6 +32,8 @@ struct filter_node { struct list_head callbacks; /** A pointer to the configuration of this instance. */ void *conf; + struct btr_node *btrn; + struct task task; }; /** Describes one running instance of a chain of filters */ diff --git a/ggo/filter.m4 b/ggo/filter.m4 index 4e991764..8199f408 100644 --- a/ggo/filter.m4 +++ b/ggo/filter.m4 @@ -1,5 +1,6 @@ include(header.m4) include(loglevel.m4) +include(buffer_tree.m4) option "filter" f #~~~~~~~~~~~~~~~~ diff --git a/ggo/mp3dec_filter.ggo b/ggo/mp3dec_filter.ggo deleted file mode 100644 index a34c30ae..00000000 --- a/ggo/mp3dec_filter.ggo +++ /dev/null @@ -1,22 +0,0 @@ -option "bufsize" b -#~~~~~~~~~~~~~~~~~ -"size of output buffer" -int typestr="kilobyte" -default="128" -optional -details=" - Increase this if you encounter output buffer overrun - errors. Smaller values make the mp3dec filter use less - memory. The minimal size is 32K. -" - -option "ignore-crc" i -#~~~~~~~~~~~~~~~~~~~~ -"ignore CRC information in the audio stream." -flag off -details=" - This causes frames with CRC errors to be decoded and played - anyway. This option is not recommended, but since some encoders - have been known to generate bad CRC information, this option - is a work-around to play streams from such encoders. -" diff --git a/ggo/mp3dec_filter.m4 b/ggo/mp3dec_filter.m4 new file mode 100644 index 00000000..0a31d7e8 --- /dev/null +++ b/ggo/mp3dec_filter.m4 @@ -0,0 +1,27 @@ +include(header.m4) +include(buffer_tree.m4) + + +option "bufsize" b +#~~~~~~~~~~~~~~~~~ +"size of output buffer" +int typestr="kilobyte" +default="128" +optional +details=" + Increase this if you encounter output buffer overrun + errors. Smaller values make the mp3dec filter use less + memory. The minimal size is 32K. +" + +option "ignore-crc" i +#~~~~~~~~~~~~~~~~~~~~ +"ignore CRC information in the audio stream." +flag off +details=" + This causes frames with CRC errors to be decoded and played + anyway. This option is not recommended, but since some encoders + have been known to generate bad CRC information, this option + is a work-around to play streams from such encoders. +" +