summaryrefslogtreecommitdiff
path: root/filter.h (follow)
Commit message (Collapse)AuthorAge
* Switch to SPDX identifiers.Andre Noll2026-03-17
| | | | | | | | Generated with sed -i 's|Copyright.*Andre Noll.*|SPDX-License-Identifier: GPL-2.0 */|g' *.c *.h followed by manually tweaking the result a bit. No license change intended.
* Improve filter documentation.Andre Noll2025-10-08
| | | | | | | | | | | | | | | This extends the top level doxygen comments of filter.c and filter.h and the documentation of para_filter(1)'s main function. The new text outlines how filters in general and para_filter(1) in particular set up their buffer tree nodes and register the corresponding tasks. We re-order the function declarations of filter.h so that they are grouped together. The previously undocumented write_int16_host_endian() is doxified using the _static_inline_ macro to prevent doxygen from excluding the documentation. On the other hand, most comments of filter.c are dedoxified, so that only the top level file comment and the documentation of the main function make it into the web docs. Everything else is too special to be useful there.
* Make struct sched private, introduce sched_new().Andre Noll2025-07-13
| | | | | | | | | | | | | | | | This moves the declaration of the structure from sched.h to sched.c because the information stored in this structure has almost no users outside of the scheduler core. As a result, the size of the structure is no longer known outside of sched.c. To initialize a scheduler instance, users now must call the new sched_new(), passing an alternative poll function if needed, We don't let applications set the default timeout anymore because the value is kind of arbitrary anyway and most users specified one second. So hardcode this as the default. Besides allocating the scheduler structure, sched_new() also initializes the task list and the poll function pointer. Thanks to these initializations, the two conditions of sched.c removed in this patch are never true.
* Rename ->{pre,post}_select methods to ->{pre,post}_monitor.Andre Noll2022-08-25
| | | | | | | The word "monitor" is neutral and continues to be correct after the switch from select(2) to poll(2). Pure rename, nothing to see here.
* Consolidate receiver/filter/writer {pre,post}_select() docs.Andre Noll2022-08-25
| | | | | | | | | | | | | The documentation of these three ->pre_select() and ->post_select() methods overlapped quite a bit. Some comments stated general properties of the sched API which fit better in the documentation of sched.h, so move these bits there. Improve the text a bit while at it and avoid talking about select(2) and fd sets as these are implementation details. Instead, focus on the general concept of fd monitoring. Pure comment cleanups, no code changes.
* Shorten copyright notice.Andre Noll2017-09-22
| | | | | | | | | | | | | | | | | | | | | The GPLv2 line does not add any additional information, so drop it. This leaves a single line of legalese text for most files, which is about the amount of screen real estate it deserves. This patch was created with the following script (plus some manual fixups): awk '{ if (NR <= 5) { gs = gensub(/.*Copyright.* ([0-9]+).*Andre Noll.*/, "\\1", "g") if (gs != $0) year = gs next } if (NR == 6 && year != "") printf("/* Copyright (C) %s Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */\n", year) print }'
* filter: Remove duplicate documentation of filter_get().Andre Noll2017-06-25
| | | | | | This public function is documented both in filter.h and in filter_common.c. Get rid of the comment in the header file as this is incomplete and causes a doxygen warning.
* doxygen: Add \ref to references.Andre Noll2017-06-25
| | | | | This way doxygen issues a warning if the file/function/structure no longer exists and a stale reference remains.
* Convert para_filter to lopsub.Andre Noll2017-03-26
| | | | | | | | | | | | | | | | Changes the semantics in case --filter is not given. We used to print an error, but it makes more sense to show the list of supported filters in this case. If no filters are given, we now print the list of available filters. A new function in filter_common.c, print_filter_list(), is introduced for this purpose. The manual page of para_filter has been extended to include an overall description of the command. The only error code of filter.c, E_NO_FILTERS, becomes unused and is removed.
* make converter_arg in resamplefilter an enum optionAndre Noll2017-03-26
|
* Convert filters to lopsub.Andre Noll2017-03-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the *_filter.m4 gengetopt files by the filter_cmd lopsub suite, where each filter is realized as a subcommand. Due to this change, para_filter needs to be linked with -llopsub. The filter structure is now stored in the user_data pointer provided by lopsub, allowing to get rid of the global filters[] array, the FILTER_ENUM macro and the corresponding enumeration constants. The removal of the ->goo_help member of struct filter makes this structure constant. Hence ->init() of struct filter can also go away. We still can tell whether a filter is supported by checking the user_data pointer: if it is NULL, the filter is unsupported. The new filter_supported() helper in filter_common.c is provided for convenience. Parsing of the filter command line options is now performed generically, and the ->parse_config() method is renamed to ->setup(), an optional function which is supposed to perform semantic checks and the one-time setup of the filter, if any. It is accompanied by ->teardown() which replaces ->free_config(). The conversion of the individual filters is easy since most filters have a simple syntax or take no arguments at all. The resample_filter, however, needs a different way to copy the wav parameters from the lopsub parse result to the wav parms structure. A suitable macro, LLS_COPY_WAV_PARMS is added to check_wav.h for this purpose. The old COPY_WAV_PARMS needs to stay until para_write, the only other user of the macro, has been converted as well. The section heading of the manual page has changed slightly, causing t0005 to fail. Hence this test needs a slight adjustment.
* filter: Make ->open() optional.Andre Noll2016-08-25
| | | | | | | | There is no need to force each filter to supply this method, so teach the three callers of ->open() to check for NULL pointers. The commit also fixes some trivial language issues in the documentation of ->open() and ->close().
* Constify argument of check_filter_arg().Andre Noll2016-08-22
| | | | The function does not modify the memory pointed to by "fa".
* filter.h: Remove stale comment.Andre Noll2016-06-19
| | | | | The array this comment refers to was moved to filter.c in commit f0c49ce0, leaving a stale comment in the header file.
* Constify struct filter access and introduce filter_get().Andre Noll2016-01-10
| | | | | | | | | | This modifies all users of the filter API to not access the filter array directly. Instead all callers now obtain a const pointer to the filter structure through the new filter_get() accessor function. However, the filter array can not be made constant yet because the ->init methods modify the filter structure. This requires some casts in filter_common.c unfortunately.
* Make FOR_EACH_SUPPORTED_FILTER() local to filter_common.c.Andre Noll2016-01-10
| | | | | The macro is only used in this .c file, so it should not be public. This patch moves the macro from filter.h to filter_common.c.
* filter.h: Improve documentation of ->pre_select().Andre Noll2015-12-28
| | | | | Fix a grammar issue ("it only allowed") and explain the purpose of the fd sets.
* Update year in copyright headers.Andre Noll2015-01-12
| | | | | | | | | | | | | | | | Done with files=$(git grep -l 'Copyright (C) [0-9]\{4\}\(-2014\)* Andre Noll') sed --in-place= -e 's/Copyright (C) \([0-9]\{4\}\)-2014 Andre Noll/Copyright (C) \1 Andre Noll/1' $files In previous years we ran a similar script to set the second year in the range to the current year. This is kind of silly, so let's get rid of this useless information. This commit replaces "Copyright (C) A-B" by "Copyright (C) A" in all file headers, i.e. only the first year (A) is left in. Accurate information including time stamps for each change can be obtained from the git history.
* doc: Change email address to maan@tuebingen.mpg.deAndre Noll2014-08-18
| | | | | | | | | | | | | | The mail server on systemlinux.org was down for more than a week lately, so let's use an alternative official address. This commit changes all maan@systemlinux.org addresses to maan@tuebingen.mpg.de. Most .c and .h files contain the email address in the copyright header, so they must all be patched. Three other files contain the address for a different reason: * README lists email and git, gitweb and home page URLs * configure.ac needs it for configure -h * version.c contains it for the -V option of all commands
* sched: Directly pass context pointer to pre/post_select().Andre Noll2014-05-25
| | | | | | | | | | | | | | | The patch is large, but it's fairly straight forward: Instead of a task pointer all ->pre_select() and ->post_select() methods now receive the context pointer that was passed to the scheduler when the task was registered. This allows to kill the public task_context(). Two pre_select/post_select functions are not directly called by the scheduler: session_post_select(), generic_recv_pre_select(). These are changed to receive a proper struct rather than a void pointer. Note that generic_filter_pre_select() is not changed in this manner because some filters do not provide a pre_select wrapper but set task->pre_select to generic_filter_pre_select().
* task_register() conversion: filter tasksAndre Noll2014-05-25
|
* Change copyright year to 2014.Andre Noll2014-02-22
| | | | | | | | | This year, we're really on time. The changes in this patch were created by the following silly script: files=$(git grep -l 'Copyright (C) [0-9]\{4\}\(-2013\)* Andre Noll') sed --in-place= -e 's/Copyright (C) \([0-9]\{4\}\)-2013 Andre Noll/Copyright (C) \1-2014 Andre Noll/1' $files sed --in-place= -e 's/Copyright (C) 2013 Andre Noll/Copyright (C) 2013-2014 Andre Noll/1' $files
* Fix documentation of filter->post-select().Andre Noll2013-07-21
| | | | | The ->post_select() methods return an integer these days and should *not* set the ->error field of the task struct directly.
* Revamp ggo help.Andre Noll2013-06-13
| | | | | | | | | | | | | This adds usage and description fields to struct ggo_help and changes ggo_print_help() to optionally print these. The boolean detailed_help flag of ggo_print_help() is replaced by a bitmask which lets the caller specify what to print. Four pre-defined masks are used to print the normal help, the detailed help, the help for modules (receivers, filters, writers) and the detailed module help. The new macro DEFINE_GGO_HELP can be employed to create a struct ggo_help from a gengetopt structure.
* sched: Rename new_post_select back to post_select.Andre Noll2013-04-30
|
* sched: Kill old ->post_select variant.Andre Noll2013-04-30
| | | | It has no more users.
* sched: Provide alternative post_select variant.Andre Noll2013-04-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code which accesses the ->error field of another task has been a source of bugs in the past. This patch is a first step to make ->error private to sched.c. Currently the ->post_select() methods of all tasks are supposed to set ->error to a negative value to indicate that the task should be terminated, i.e. t->error being negative instructs the scheduler to not call t->pre_select() or t->post_select() any more in subsequent iterations. An equivalent way to achieve the same is to let ->post_select() return an error code instead. Benefits include * It reduces the use of ->error outside of sched.c * It's impossible to miss setting the error code * It simplifies code slightly Therefore we'd like to change the prototype of the ->post_select() methods from void (*post_select)(struct sched *s, struct task *t); to int (*post_select)(struct sched *s, struct task *t); Changes to struct sched affects many parts of the code base, hence converting all users at once would result in a very large patch. Therefore we temporarily introduce an additional ->new_post_select() method according to the second declaration above. The scheduler calls the new method if it is defined and falls back to the old variant otherwise. This approach allows to switch over one task after another without breaking things. This patch introduces the infrastructure just described and switches over the http receiver. Subsequent commits will change all other tasks in the same way. After all tasks have been switched over we can get rid of the old ->post_select variant and rename ->new_post_select() back to ->post_select().
* Change copyright year to 2013.Andre Noll2013-03-25
| | | | Better late than never.
* Change year in copyright message to 2012.Andre Noll2012-01-07
|
* doxygen: Add some missing documentation.Andre Noll2011-05-15
|
* Replace 2010 in copyright message by 2011.Andre Noll2011-01-17
|
* Introduce decoder_execute().Andre Noll2010-07-13
| | | | | | | All four decoders support the same two commands: "sample_rate" and "channels". This patch adds a public function to filter_common.c which implements these two commands and is called by all decoders. This allows to kill four copies of code with identical functionality.
* filter.h: Add some missing documentation.Andre Noll2010-07-10
|
* Change year in COPYRIGHT to 2010.Andre Noll2010-04-05
| | | | Hey, this is earlier than last year :)
* filter.h: Document that the ->close method need not be provided.Andre Noll2010-01-14
|
* filter.h: Kill some unused fields of struct filter_node.Andre Noll2010-01-12
|
* Kill unused filter_node->fc.Andre Noll2010-01-12
|
* Kill unused struct filter_chain.Andre Noll2010-01-12
|
* Kill unused struct filter_callbacks.Andre Noll2010-01-12
| | | | Stream grabbing doesn't work with callbacks any more.
* Kill global close_filters().Andre Noll2010-01-12
| | | | | This allows to skip the leading underscore from audiod's _close_filters().
* Kill filter->convert.Andre Noll2010-01-12
| | | | Its last user was filter_postselect().
* Kill unused filter_post_select().Andre Noll2010-01-12
|
* Switch audiod over to the buffer tree API.Andre Noll2010-01-07
| | | | Still a bit rough and there are too many btr merges.
* Introduce btr_node_status() and add btr support to the file writer.Andre Noll2010-01-05
|
* Introduce and use generic_filter_pre_select().Andre Noll2010-01-03
|
* Simplify prepare_filter_node().Andre Noll2010-01-03
|
* Introduce filter_node->min_iqs.Andre Noll2010-01-03
|
* Consolidate decoder code by introducing prepare_filter_node().Andre Noll2010-01-03
|
* Add btr support to filter code.Andre Noll2009-12-31
| | | | | A bit rough and only the mp3dec filter kind of works. Execute support for mp3dec is also missing.
* First preparations for btr support in para_filter.Andre Noll2009-12-30
|