UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
audio_filter.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 2021-2023 CESNET, z. s. p. o.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, is permitted provided that the following conditions
11 * are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 *
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 *
20 * 3. Neither the name of CESNET nor the names of its contributors may be
21 * used to endorse or promote products derived from this software without
22 * specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS
25 * "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
26 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
27 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
28 * EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
29 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
35 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 */
37
38#ifndef AUDIO_FILTER_H_
39#define AUDIO_FILTER_H_
40
41#define AUDIO_FILTER_ABI_VERSION 3
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47struct module;
48struct audio_frame;
49
57
59 const char *name;
60
67 enum af_result_code (*init)(struct module *mod, const char *cfg, void **state);
68
70 void (*done)(void *state);
71
79 enum af_result_code (*configure)(void *state,
80 int bps, int ch_count, int sample_rate);
81
83 void (*get_configured_in)(void *state,
84 int *bps, int *ch_count, int *sample_rate);
85
88 int *bps, int *ch_count, int *sample_rate);
89
93 // frame and return a different one
94 enum af_result_code (*filter)(void *state, struct audio_frame **f);
95};
96
98 const struct audio_filter_info *info;
99 void *state;
100};
101
102enum af_result_code audio_filter_init(struct module *parent, const char *name, const char *cfg,
103 struct audio_filter *filter);
104
106
108 int bps, int ch_count, int sample_rate);
109
111 int *bps, int *ch_count, int *sample_rate);
112
114 int *bps, int *ch_count, int *sample_rate);
115
117
118//void register_audio_filter(struct audio_filter_info *filter);
119
120#ifdef __cplusplus
121}
122#endif
123
124#endif //AUDIO_FILTER_H_
void ** state
int int int sample_rate
struct video_frame * frame
void audio_filter_get_configured_in(struct audio_filter *state, int *bps, int *ch_count, int *sample_rate)
enum af_result_code audio_filter_init(struct module *parent, const char *name, const char *cfg, struct audio_filter *filter)
void audio_filter_get_configured_out(struct audio_filter *state, int *bps, int *ch_count, int *sample_rate)
enum af_result_code audio_filter_configure(struct audio_filter *state, int bps, int ch_count, int sample_rate)
enum af_result_code audio_filter(struct audio_filter *state, struct audio_frame **frame)
void audio_filter_destroy(struct audio_filter *state)
af_result_code
@ AF_FAILURE
@ AF_MISCONFIGURED
@ AF_CONFIGURED_CLOSEST
@ AF_HELP_SHOWN
@ AF_OK
static af_result_code filter(void *state, struct audio_frame **frame)
const char * parent
Definition settings.cpp:198
const char * name
Definition settings.cpp:193
void(* done)(void *state)
Frees filter.
enum af_result_code(* init)(struct module *mod, const char *cfg, void **state)
Initializes filter.
enum af_result_code(* configure)(void *state, int bps, int ch_count, int sample_rate)
Configure audio input format.
void(* get_configured_out)(void *state, int *bps, int *ch_count, int *sample_rate)
Get configured output audio format.
enum af_result_code(* filter)(void *state, struct audio_frame **f)
Filter audio frame.
const char * name
void(* get_configured_in)(void *state, int *bps, int *ch_count, int *sample_rate)
Get configured input audio format.
const struct audio_filter_info * info
struct used to comunicate with audio capture/playback device
Definition types.h:99