-/*
- * Copyright (C) 2005 Andre Noll <maan@tuebingen.mpg.de>
- *
- * Licensed under the GPL v2. For licencing details see COPYING.
- */
+/* Copyright (C) 2005 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
/** \file filter.h Filter-related structures and exported symbols from filter_common.c. */
};
/**
- * 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 {
/**
* 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.
*
#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);