PipeWire: spa/interfaces/audio/aec.h Source File

PipeWire 0.3.51

aec.h
1/* PipeWire
2 *
3 * Copyright © 2021 Wim Taymans <wim.taymans@gmail.com>
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24
25
26#include <spa/utils/dict.h>
27#include <spa/utils/hook.h>
28#include <spa/param/audio/raw.h>
29
30#ifndef SPA_AUDIO_AEC_H
31#define SPA_AUDIO_AEC_H
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37#define SPA_TYPE_INTERFACE_AUDIO_AEC SPA_TYPE_INFO_INTERFACE_BASE "Audio:AEC"
38
39#define SPA_VERSION_AUDIO_AEC 0
40struct spa_audio_aec {
41 struct spa_interface iface;
42 const char *name;
43 const struct spa_dict *info;
44 const char *latency;
45};
46
47 struct spa_audio_aec_info {
48#define SPA_AUDIO_AEC_CHANGE_MASK_PROPS (1u<<0)
49 uint64_t change_mask;
50
51 const struct spa_dict *props;
52};
53
54struct spa_audio_aec_events {
55#define SPA_VERSION_AUDIO_AEC_EVENTS 0
56 uint32_t version;
59 void (*info) (void *data, const struct spa_audio_aec_info *info);
60};
61
62struct spa_audio_aec_methods {
63#define SPA_VERSION_AUDIO_AEC_METHODS 0
64 uint32_t version;
65
66 int (*add_listener) (void *object,
67 struct spa_hook *listener,
68 const struct spa_audio_aec_events *events,
69 void *data);
70
71 int (*init) (void *data, const struct spa_dict *args, const struct spa_audio_info_raw *info);
72 int (*run) (void *data, const float *rec[], const float *play[], float *out[], uint32_t n_samples);
73 int (*set_props) (void *data, const struct spa_dict *args);
74};
75
76#define spa_audio_aec_method(o,method,version,...) \
77({ \
78 int _res = -ENOTSUP; \
79 struct spa_audio_aec *_o = o; \
80 spa_interface_call_res(&_o->iface, \
81 struct spa_audio_aec_methods, _res, \
82 method, version, ##__VA_ARGS__); \
83 _res; \
84})
85
86#define spa_audio_aec_add_listener(o,...) spa_audio_aec_method(o, add_listener, 0, __VA_ARGS__)
87#define spa_audio_aec_init(o,...) spa_audio_aec_method(o, init, 0, __VA_ARGS__)
88#define spa_audio_aec_run(o,...) spa_audio_aec_method(o, run, 0, __VA_ARGS__)
89#define spa_audio_aec_set_props(o,...) spa_audio_aec_method(o, set_props, 0, __VA_ARGS__)
90
91#ifdef __cplusplus
92} /* extern "C" */
93#endif
94
95#endif /* SPA_AUDIO_AEC_H */
raw.h
spa/param/audio/raw.h
hook.h
spa/utils/hook.h
spa_audio_aec_events
Definition: aec.h:61
spa_audio_aec_events::info
void(* info)(void *data, const struct spa_audio_aec_info *info)
Emitted when info changes.
Definition: aec.h:67
spa_audio_aec_events::version
uint32_t version
version of this structure
Definition: aec.h:64
spa_audio_aec_info
Definition: aec.h:53
spa_audio_aec_info::change_mask
uint64_t change_mask
Definition: aec.h:56
spa_audio_aec_methods
Definition: aec.h:70
spa_audio_aec_methods::set_props
int(* set_props)(void *data, const struct spa_dict *args)
Definition: aec.h:82
spa_audio_aec_methods::add_listener
int(* add_listener)(void *object, struct spa_hook *listener, const struct spa_audio_aec_events *events, void *data)
Definition: aec.h:75
spa_audio_aec_methods::run
int(* run)(void *data, const float *rec[], const float *play[], float *out[], uint32_t n_samples)
Definition: aec.h:81
spa_audio_aec_methods::init
int(* init)(void *data, const struct spa_dict *args, const struct spa_audio_info_raw *info)
Definition: aec.h:80
spa_audio_aec
Definition: aec.h:46
spa_audio_aec::info
const struct spa_dict * info
Definition: aec.h:49
spa_audio_aec::latency
const char * latency
Definition: aec.h:50
spa_audio_aec::iface
struct spa_interface iface
Definition: aec.h:47
spa_audio_info_raw
Audio information description.
Definition: raw.h:298
spa_dict
Definition: dict.h:59
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:351
spa_interface
Definition: hook.h:158
dict.h
spa/utils/dict.h