module_tizenaudio_source2_la_CFLAGS = $(MODULE_CFLAGS) -DPA_MODULE_NAME=module_tizenaudio_source2
libprocessor_la_SOURCES = \
- src/echo-cancel/algo_speex.c \
- src/echo-cancel/algo_reference_copy.c \
- src/echo-cancel/algo_adrian.c \
+ src/echo-cancel/method_speex.c \
+ src/echo-cancel/method_reference_copy.c \
+ src/echo-cancel/method_adrian.c \
src/echo-cancel/adrian-aec.c \
src/echo-cancel/processor.c \
src/echo-cancel/processor.h \
libprocessor_la_CFLAGS = $(AM_CFLAGS) $(PA_CFLAGS) $(LIBSPEEX_CFLAGS)
if ENABLE_WEBRTC
-libprocessor_la_SOURCES += src/echo-cancel/algo_webrtc.cpp
+libprocessor_la_SOURCES += src/echo-cancel/method_webrtc.cpp
libprocessor_la_LIBADD += $(WEBRTC_LIBS)
libprocessor_la_CPPFLAGS = $(WEBRTC_CFLAGS) $(PA_CFLAGS) -DSUPPORT_METHOD_WEBRTC -std=c++17
endif
#include "adrian-aec.h"
-struct ec_adrian {
+struct method_adrian {
int blocksize;
AEC *aec;
};
void *adrian_create(size_t nframes, pa_sample_spec *ss) {
- struct ec_adrian *adrian = NULL;
+ struct method_adrian *adrian = NULL;
pa_assert(ss);
return NULL;
}
- adrian = pa_xnew0(struct ec_adrian, 1);
+ adrian = pa_xnew0(struct method_adrian, 1);
if (!(adrian->aec = AEC_init(ss->rate, 0))) {
pa_log_error("Failed to init AEC");
}
int32_t adrian_process(void *priv, int8_t *rec, int8_t *ref, int8_t *out) {
- struct ec_adrian *adrian = priv;
+ struct method_adrian *adrian = priv;
int i;
assert(rec);
}
int32_t adrian_destroy(void *priv) {
- struct ec_adrian *adrian = priv;
+ struct method_adrian *adrian = priv;
pa_assert(adrian);
#include <assert.h>
-struct algo_speex {
+struct method_speex {
SpeexEchoState *echo_state;
SpeexPreprocessState *preprocess;
};
void *speex_create(size_t nframes, pa_sample_spec *ss) {
- struct algo_speex *speex = NULL;
+ struct method_speex *speex = NULL;
spx_int32_t value = 1;
int rate;
return NULL;
}
- speex = pa_xnew0(struct algo_speex, 1);
+ speex = pa_xnew0(struct method_speex, 1);
/* TODO: need to check. weird behavior */
if (ss->channels == 2)
}
int32_t speex_process(void *priv, int8_t *rec, int8_t *ref, int8_t *out) {
- struct algo_speex *speex = priv;
+ struct method_speex *speex = priv;
assert(rec);
assert(ref);
}
int32_t speex_destroy(void *priv) {
- struct algo_speex *speex = priv;
+ struct method_speex *speex = priv;
if (speex->echo_state)
speex_echo_state_destroy(speex->echo_state);
#include <pulse/timeval.h>
#include <stdint.h>
-static void allocate_stream_buffer(struct algo_webrtc *webrtc, size_t nframes);
-static void deallocate_stream_buffer(struct algo_webrtc *webrtc);
+static void allocate_stream_buffer(struct method_webrtc *webrtc, size_t nframes);
+static void deallocate_stream_buffer(struct method_webrtc *webrtc);
static void convert_s16_to_float(float *dst, int16_t *src, size_t n);
static void convert_float_to_s16(int16_t *dst, float *src, size_t n);
int32_t webrtc_audio_destroy(void *priv);
PA_C_DECL_END
-struct algo_webrtc {
+struct method_webrtc {
AudioProcessing *ap;
Config config;
StreamConfig *sconfig;
};
void *webrtc_audio_create(size_t nframes, pa_sample_spec *ss) {
- struct algo_webrtc *webrtc = NULL;
+ struct method_webrtc *webrtc = NULL;
size_t fixed_bytes, request_bytes;
Config config;
return NULL;
}
- webrtc = pa_xnew0(struct algo_webrtc, 1);
+ webrtc = pa_xnew0(struct method_webrtc, 1);
webrtc->ss = *ss;
webrtc->fixed_bytes = fixed_bytes;
webrtc->fixed_frames = fixed_bytes / pa_frame_size(ss);
}
int32_t webrtc_audio_process(void *priv, int8_t *rec, int8_t *ref, int8_t *out) {
- struct algo_webrtc *webrtc = (struct algo_webrtc *)priv;
+ struct method_webrtc *webrtc = (struct method_webrtc *)priv;
pa_sample_spec ss;
size_t frames;
}
int32_t webrtc_audio_destroy(void *priv) {
- struct algo_webrtc *webrtc = (struct algo_webrtc *)priv;
+ struct method_webrtc *webrtc = (struct method_webrtc *)priv;
pa_assert(webrtc);
return 0;
}
-static void deallocate_stream_buffer(struct algo_webrtc *webrtc) {
+static void deallocate_stream_buffer(struct method_webrtc *webrtc) {
pa_assert(webrtc);
for (int i = 0; i < webrtc->ss.channels; i++) {
pa_xfree(webrtc->out_fbuf);
}
-static void allocate_stream_buffer(struct algo_webrtc *webrtc, size_t nframes) {
+static void allocate_stream_buffer(struct method_webrtc *webrtc, size_t nframes) {
int channels;
pa_assert(webrtc);