Paraslash Audio Streaming | |
About News Download Documentation Development |
Common helper functions for filter input/output. More...
#include <regex.h>
#include <sys/types.h>
#include <lopsub.h>
#include "filter_cmd.lsg.h"
#include "para.h"
#include "list.h"
#include "sched.h"
#include "fd.h"
#include "buffer_tree.h"
#include "filter.h"
#include "error.h"
#include "string.h"
Macros | |
#define | FOR_EACH_FILTER(j) for (j = 1; FILTER_CMD(j); j++) |
Iterate over all filters. More... | |
#define | DECODER_SAMPLE_FORMAT SF_S16_LE |
Functions | |
const struct filter * | filter_get (int filter_num) |
Obtain a reference to a filter structure. More... | |
const char * | filter_name (int filter_num) |
Return the name of a filter, given its number. More... | |
int | filter_setup (const char *fa, void **conf, struct lls_parse_result **lprp) |
Parse a filter command line and call the corresponding ->setup method. More... | |
void | print_filter_helps (bool detailed) |
Print help text of each filter to stdout. More... | |
void | print_filter_list (void) |
Print a short summary of all available filters to stdout. More... | |
void | generic_filter_pre_monitor (struct sched *s, void *context) |
Request a minimal timeout if not idle. More... | |
int | decoder_execute (const char *cmd, unsigned sample_rate, unsigned channels, char **result) |
Execute a btr command for a decoder. More... | |
Common helper functions for filter input/output.
#define FOR_EACH_FILTER | ( | j | ) | for (j = 1; FILTER_CMD(j); j++) |
Iterate over all filters.
#define DECODER_SAMPLE_FORMAT SF_S16_LE |
const struct filter* filter_get | ( | int | filter_num | ) |
Obtain a reference to a filter structure.
filter_num | Between zero and NUM_SUPPORTED_FILTERS, inclusively. |
References FILTER_CMD.
const char* filter_name | ( | int | filter_num | ) |
Return the name of a filter, given its number.
filter_num | See filter_get(). |
References FILTER_CMD.
int filter_setup | ( | const char * | fa, |
void ** | conf, | ||
struct lls_parse_result ** | lprp | ||
) |
Parse a filter command line and call the corresponding ->setup method.
fa | The filter argument. |
conf | Points to filter-specific setup upon successful return. |
lprp | Parsed command line options are returned here. |
Check if the given filter argument starts with the name of a supported filter, optionally followed by options for this filter. If yes, call the command line parser of that filter and its ->setup method.
References create_argv(), FILTER_CMD, free_argv(), and lls().
void print_filter_helps | ( | bool | detailed | ) |
Print help text of each filter to stdout.
detailed | Whether to print short or long help. |
References FOR_EACH_FILTER.
void print_filter_list | ( | void | ) |
Print a short summary of all available filters to stdout.
For each supported filter, the filter name and the purpose text is printed in a single line. Since no options are shown, the filter list is more concise than the text obtained from print_filter_helps().
References FILTER_CMD, and FOR_EACH_FILTER.
void generic_filter_pre_monitor | ( | struct sched * | s, |
void * | context | ||
) |
Request a minimal timeout if not idle.
s | The scheduler instance. |
context | Pointer to the filter node. |
If the buffer tree node of the given filter node has data available (or is in error state) a minimal I/O timeout is requested from the scheduler. Otherwise the function does nothing.
References btr_node_status(), BTR_NT_INTERNAL, filter_node::btrn, filter_node::min_iqs, and sched_min_delay().
int decoder_execute | ( | const char * | cmd, |
unsigned | sample_rate, | ||
unsigned | channels, | ||
char ** | result | ||
) |
Execute a btr command for a decoder.
The buffer tree nodes of the writers ask the parent nodes about sample_rate, channels count and sample format. This function is called by all decoders to answer these queries.
cmd | The command to be executed by the child node. |
sample_rate | Known to the decoder. |
channels | Known to the decoder. |
result | Ascii representation on the answer is stored here. |