resample filter: Infrastructure.
[paraslash.git] / resample_filter.c
1 /*
2 * Copyright (C) 2012 Andre Noll <maan@systemlinux.org>
3 *
4 * Licensed under the GPL v2. For licencing details see COPYING.
5 */
6
7 /** \file resample_filter.c A sample rate converter based on libsamplerate. */
8
9 #include <regex.h>
10
11 #include "resample_filter.cmdline.h"
12 #include "para.h"
13 #include "error.h"
14 #include "list.h"
15 #include "sched.h"
16 #include "ggo.h"
17 #include "buffer_tree.h"
18 #include "filter.h"
19 #include "string.h"
20
21 static void resample_close(struct filter_node *fn)
22 {
23 free(fn->private_data);
24 fn->private_data = NULL;
25 }
26
27 static void resample_open(struct filter_node *fn)
28 {
29 }
30
31 static void resample_pre_select(struct sched *s, struct task *t)
32 {
33 struct filter_node *fn = container_of(t, struct filter_node, task);
34 }
35
36 static void resample_post_select(__a_unused struct sched *s, struct task *t)
37 {
38 struct filter_node *fn = container_of(t, struct filter_node, task);
39 }
40
41 static int resample_parse_config(int argc, char **argv, void **config)
42 {
43 return 0;
44 }
45
46 static void resample_free_config(void *conf)
47 {
48 resample_filter_cmdline_parser_free(conf);
49 }
50
51 /**
52 * The init function of the resample filter.
53 *
54 * \param f Structure to initialize.
55 */
56 void resample_filter_init(struct filter *f)
57 {
58 struct resample_filter_args_info dummy;
59
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
70 };
71 }