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

PipeWire 1.0.3

Loading...
Searching...
No Matches
aec.h
1/* PipeWire */
2/* SPDX-FileCopyrightText: Copyright © 2021 Wim Taymans <wim.taymans@gmail.com> */
3/* SPDX-License-Identifier: MIT */
4
5#include <spa/pod/builder.h>
6#include <spa/utils/dict.h>
7#include <spa/utils/hook.h>
8#include <spa/param/audio/raw.h>
9
10#ifndef SPA_AUDIO_AEC_H
11#define SPA_AUDIO_AEC_H
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17#define SPA_TYPE_INTERFACE_AUDIO_AEC SPA_TYPE_INFO_INTERFACE_BASE "Audio:AEC"
18
19#define SPA_VERSION_AUDIO_AEC 1
20struct spa_audio_aec {
21 struct spa_interface iface;
22 const char *name;
23 const struct spa_dict *info;
24 const char *latency;
25};
26
27 struct spa_audio_aec_info {
28#define SPA_AUDIO_AEC_CHANGE_MASK_PROPS (1u<<0)
29 uint64_t change_mask;
30
31 const struct spa_dict *props;
32};
33
34struct spa_audio_aec_events {
35#define SPA_VERSION_AUDIO_AEC_EVENTS 0
36 uint32_t version;
39 void (*info) (void *data, const struct spa_audio_aec_info *info);
40};
41
42struct spa_audio_aec_methods {
43#define SPA_VERSION_AUDIO_AEC_METHODS 3
44 uint32_t version;
45
46 int (*add_listener) (void *object,
47 struct spa_hook *listener,
48 const struct spa_audio_aec_events *events,
49 void *data);
50
51 int (*init) (void *object, const struct spa_dict *args, const struct spa_audio_info_raw *info);
52 int (*run) (void *object, const float *rec[], const float *play[], float *out[], uint32_t n_samples);
53 int (*set_props) (void *object, const struct spa_dict *args);
54 /* since 0.3.58, version 1:1 */
55 int (*activate) (void *object);
56 /* since 0.3.58, version 1:1 */
57 int (*deactivate) (void *object);
58
59 /* version 1:2 */
60 int (*enum_props) (void* object, int index, struct spa_pod_builder* builder);
61 int (*get_params) (void* object, struct spa_pod_builder* builder);
62 int (*set_params) (void *object, const struct spa_pod *args);
63
64 /* version 1:3 */
65 int (*init2) (void *object, const struct spa_dict *args,
66 struct spa_audio_info_raw *play_info,
67 struct spa_audio_info_raw *rec_info,
68 struct spa_audio_info_raw *out_info);
69};
70
71#define spa_audio_aec_method(o,method,version,...) \
72({ \
73 int _res = -ENOTSUP; \
74 struct spa_audio_aec *_o = (o); \
75 spa_interface_call_res(&_o->iface, \
76 struct spa_audio_aec_methods, _res, \
77 method, (version), ##__VA_ARGS__); \
78 _res; \
79})
80
81#define spa_audio_aec_add_listener(o,...) spa_audio_aec_method(o, add_listener, 0, __VA_ARGS__)
82#define spa_audio_aec_init(o,...) spa_audio_aec_method(o, init, 0, __VA_ARGS__)
83#define spa_audio_aec_run(o,...) spa_audio_aec_method(o, run, 0, __VA_ARGS__)
84#define spa_audio_aec_set_props(o,...) spa_audio_aec_method(o, set_props, 0, __VA_ARGS__)
85#define spa_audio_aec_activate(o) spa_audio_aec_method(o, activate, 1)
86#define spa_audio_aec_deactivate(o) spa_audio_aec_method(o, deactivate, 1)
87#define spa_audio_aec_enum_props(o,...) spa_audio_aec_method(o, enum_props, 2, __VA_ARGS__)
88#define spa_audio_aec_get_params(o,...) spa_audio_aec_method(o, get_params, 2, __VA_ARGS__)
89#define spa_audio_aec_set_params(o,...) spa_audio_aec_method(o, set_params, 2, __VA_ARGS__)
90#define spa_audio_aec_init2(o,...) spa_audio_aec_method(o, init2, 3, __VA_ARGS__)
91
92#ifdef __cplusplus
93} /* extern "C" */
94#endif
95
96#endif /* SPA_AUDIO_AEC_H */
raw.h
spa/param/audio/raw.h
builder.h
spa/pod/builder.h
hook.h
spa/utils/hook.h
spa_audio_aec_events
Definition aec.h:41
spa_audio_aec_events::info
void(* info)(void *data, const struct spa_audio_aec_info *info)
Emitted when info changes.
Definition aec.h:47
spa_audio_aec_events::version
uint32_t version
version of this structure
Definition aec.h:44
spa_audio_aec_info
Definition aec.h:33
spa_audio_aec_info::change_mask
uint64_t change_mask
Definition aec.h:36
spa_audio_aec_methods
Definition aec.h:50
spa_audio_aec_methods::get_params
int(* get_params)(void *object, struct spa_pod_builder *builder)
Definition aec.h:70
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:55
spa_audio_aec_methods::set_props
int(* set_props)(void *object, const struct spa_dict *args)
Definition aec.h:62
spa_audio_aec_methods::deactivate
int(* deactivate)(void *object)
Definition aec.h:66
spa_audio_aec_methods::activate
int(* activate)(void *object)
Definition aec.h:64
spa_audio_aec_methods::init2
int(* init2)(void *object, const struct spa_dict *args, struct spa_audio_info_raw *play_info, struct spa_audio_info_raw *rec_info, struct spa_audio_info_raw *out_info)
Definition aec.h:74
spa_audio_aec_methods::enum_props
int(* enum_props)(void *object, int index, struct spa_pod_builder *builder)
Definition aec.h:69
spa_audio_aec_methods::run
int(* run)(void *object, const float *rec[], const float *play[], float *out[], uint32_t n_samples)
Definition aec.h:61
spa_audio_aec_methods::set_params
int(* set_params)(void *object, const struct spa_pod *args)
Definition aec.h:71
spa_audio_aec_methods::init
int(* init)(void *object, const struct spa_dict *args, const struct spa_audio_info_raw *info)
Definition aec.h:60
spa_audio_aec
Definition aec.h:26
spa_audio_aec::info
const struct spa_dict * info
Definition aec.h:29
spa_audio_aec::latency
const char * latency
Definition aec.h:30
spa_audio_aec::iface
struct spa_interface iface
Definition aec.h:27
spa_audio_info_raw
Audio information description.
Definition raw.h:284
spa_dict
Definition dict.h:39
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition hook.h:350
spa_interface
Definition hook.h:138
spa_pod_builder
Definition builder.h:53
spa_pod
Definition pod.h:43
dict.h
spa/utils/dict.h