2 * Copyright (C) 2012 Andre Noll <maan@systemlinux.org>
4 * Licensed under the GPL v2. For licencing details see COPYING.
7 /** \file resample_filter.c A sample rate converter based on libsamplerate. */
11 #include "resample_filter.cmdline.h"
17 #include "buffer_tree.h"
21 static void resample_close(struct filter_node *fn)
23 free(fn->private_data);
24 fn->private_data = NULL;
27 static void resample_open(struct filter_node *fn)
31 static void resample_pre_select(struct sched *s, struct task *t)
33 struct filter_node *fn = container_of(t, struct filter_node, task);
36 static void resample_post_select(__a_unused struct sched *s, struct task *t)
38 struct filter_node *fn = container_of(t, struct filter_node, task);
41 static int resample_parse_config(int argc, char **argv, void **config)
46 static void resample_free_config(void *conf)
48 resample_filter_cmdline_parser_free(conf);
52 * The init function of the resample filter.
54 * \param f Structure to initialize.
56 void resample_filter_init(struct filter *f)
58 struct resample_filter_args_info dummy;
60 resample_filter_cmdline_parser_init(&dummy);
61 f->close = resample_close;
62 f->open = resample_open;
63 f->pre_select = resample_pre_select;
64 f->post_select = resample_post_select;
65 f->parse_config = resample_parse_config;
66 f->free_config = resample_free_config;
67 f->help = (struct ggo_help) {
68 .short_help = resample_filter_args_info_help,
69 .detailed_help = resample_filter_args_info_detailed_help