X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=filter.h;h=69d4dfee8534941ab74bb17d7d2a5ff8e23eed6b;hp=ab98c2442b9d13ae5158716fc2fe7f24904685e6;hb=HEAD;hpb=7649f22106cec2c6eb8bb10f279401e1af5451d0 diff --git a/filter.h b/filter.h index ab98c244..77057e6a 100644 --- a/filter.h +++ b/filter.h @@ -1,8 +1,4 @@ -/* - * Copyright (C) 2005 Andre Noll - * - * Licensed under the GPL v2. For licencing details see COPYING. - */ +/* Copyright (C) 2005 Andre Noll , see file COPYING. */ /** \file filter.h Filter-related structures and exported symbols from filter_common.c. */ @@ -32,16 +28,18 @@ struct filter_node { }; /** - * The structure associated with a paraslash filter. + * Describes a method to convert audio data. * - * Paraslash filters are "modules" which transform an audio stream. struct - * filter contains methods which are implemented by each filter. + * Paraslash filters are "modules" which transform the data of an audio stream. + * This structure contains the methods which have to be implemented by each + * filter. * - * Note: As several instances of the same filter may be running at the same - * time, all these filter functions must be reentrant; no static non-constant - * variables may be used. + * As several instances of the same filter may be running at the same time, all + * filter methods must be reentrant and no static non-constant variables must + * be used. * - * \sa \ref filter_node. + * \sa \ref filter_node, struct \ref receiver, struct \ref writer, struct \ref + * sched. */ struct filter { /** @@ -85,24 +83,10 @@ struct filter { * This should free whatever ->setup() has allocated. */ void (*teardown)(const struct lls_parse_result *lpr, void *conf); - /** - * Set scheduler timeout and add file descriptors to fd sets. - * - * This function controls the timeout value for the next call to - * select(2). It may decrease the current timeout but shall never - * increase it. The second purpose of this function is to add file - * descriptors to the two fd sets of the sched structure. The - * descriptors in these sets will be watched by the subsequent - * select(2) call. - */ - void (*pre_select)(struct sched *s, void *context); - /** - * Convert (filter) the given data. - * - * Pointer to the converting function of the filter. On errors, the - * post_select function is supposed to return a negative error code. - */ - int (*post_select)(struct sched *s, void *context); + /** Force a zero timeout if data is available in the buffer tree. */ + void (*pre_monitor)(struct sched *s, void *context); + /** Convert (filter) input data into output data. */ + int (*post_monitor)(struct sched *s, void *context); /** * Answer a buffer tree query. * @@ -128,7 +112,7 @@ int filter_setup(const char *fa, void **conf, struct lls_parse_result **lprp); #define FILTER_CMD_OPT_STRING_VAL(_cmd, _opt, _lpr) \ (lls_string_val(0, FILTER_CMD_OPT_RESULT(_cmd, _opt, _lpr))) -void generic_filter_pre_select(struct sched *s, void *context); +void generic_filter_pre_monitor(struct sched *s, void *context); int decoder_execute(const char *cmd, unsigned sample_rate, unsigned channels, char **result);