From d1e55304068a6a82553f40ae7bee746f5ca2233d Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 30 Dec 2009 01:38:26 +0100 Subject: [PATCH] First preparations for btr support in para_filter. --- filter.c | 16 +++++++++++++--- filter.h | 2 ++ ggo/filter.m4 | 1 + ggo/{mp3dec_filter.ggo => mp3dec_filter.m4} | 5 +++++ 4 files changed, 21 insertions(+), 3 deletions(-) rename ggo/{mp3dec_filter.ggo => mp3dec_filter.m4} (91%) 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.m4 similarity index 91% rename from ggo/mp3dec_filter.ggo rename to ggo/mp3dec_filter.m4 index a34c30ae..0a31d7e8 100644 --- a/ggo/mp3dec_filter.ggo +++ b/ggo/mp3dec_filter.m4 @@ -1,3 +1,7 @@ +include(header.m4) +include(buffer_tree.m4) + + option "bufsize" b #~~~~~~~~~~~~~~~~~ "size of output buffer" @@ -20,3 +24,4 @@ details=" have been known to generate bad CRC information, this option is a work-around to play streams from such encoders. " + -- 2.39.5