paraslash Paraslash Audio Streaming
About   News   Download   Documentation   Development

Data Fields
filter Struct Reference

Describes a method to convert audio data. More...

#include <filter.h>

Data Fields

void(* open )(struct filter_node *fn)
 Open one instance of this filter. More...
 
void(* close )(struct filter_node *fn)
 Close one instance of this filter. More...
 
void *(* setup )(const struct lls_parse_result *lpr)
 Prepare the filter according to command line options. More...
 
void(* teardown )(const struct lls_parse_result *lpr, void *conf)
 Deallocate precomputed resources. More...
 
void(* pre_monitor )(struct sched *s, void *context)
 Force a zero timeout if data is available in the buffer tree. More...
 
int(* post_monitor )(struct sched *s, void *context)
 Convert (filter) input data into output data. More...
 
btr_command_handler execute
 Answer a buffer tree query. More...
 

Detailed Description

Describes a method to convert audio data.

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.

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.

See also
filter_node, struct receiver, struct writer, struct sched.

Field Documentation

◆ open

void(* open) (struct filter_node *fn)

Open one instance of this filter.

This should allocate the output buffer of the given filter node and do any other filter-specific preparations like initializing the private_data member of fn suitably. The open function is optional, If it is provided, it is assumed to succeed.

◆ close

void(* close) (struct filter_node *fn)

Close one instance of this filter.

Free all resources associated with fn that were previously allocated by the open() function. It's OK to set this to NULL if the filter does not need to perform any cleanup operation.

◆ setup

void*(* setup) (const struct lls_parse_result *lpr)

Prepare the filter according to command line options.

In addition to the syntactic checks which are automatically performed by the lopsub functions, some filters like to also check the command line arguments semantically. Moreover, since applications may open the filter many times with the same options, filters need a method which allows them to precompute once those parts of the setup which depend only on the command line options.

If this function pointer is not NULL, the function is called once at startup. The returned pointer value is made available to the ->open method via the ->conf pointer of struct filter_node.

Filters are supposed to abort if the setup fails. If the function returns, it is assumed to have succeeded.

◆ teardown

void(* teardown) (const struct lls_parse_result *lpr, void *conf)

Deallocate precomputed resources.

This should free whatever ->setup() has allocated.

◆ pre_monitor

void(* pre_monitor) (struct sched *s, void *context)

Force a zero timeout if data is available in the buffer tree.

◆ post_monitor

int(* post_monitor) (struct sched *s, void *context)

Convert (filter) input data into output data.

◆ execute

Answer a buffer tree query.

This optional function pointer is used for inter node communications of the buffer tree nodes. See btr_command_handler for details.


The documentation for this struct was generated from the following file: