summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Rebillout <arnaud.rebillout@collabora.com>2018-10-01 11:01:47 +0700
committerArun Raghavan <arun@arunraghavan.net>2018-10-04 08:44:18 +0530
commit88d77ff852859bc7d18e71385b6e5d7acffdfa49 (patch)
treeb265eb860fdf5b3e38b002ffed25989f9084fb78
parent31fd8207022273f2382d9da64173a3f0e8f2c392 (diff)
meson: Enable echo-cancel module, add libwebrtc_util lib, add speex and webrtc dependencies
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
-rw-r--r--meson.build10
-rw-r--r--src/modules/echo-cancel/meson.build18
-rw-r--r--src/modules/meson.build48
-rw-r--r--src/pulsecore/meson.build6
4 files changed, 80 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index 51c6f1efb..b3aa49f02 100644
--- a/meson.build
+++ b/meson.build
@@ -279,11 +279,21 @@ if sbc_dep.found() and dbus_dep.found()
cdata.set('HAVE_BLUEZ_5', 1)
endif
+speex_dep = dependency('speexdsp', version : '>= 1.2', required : false)
+if speex_dep.found()
+ cdata.set('HAVE_SPEEX', 1)
+endif
+
udev_dep = dependency('libudev', version : '>= 143', required : false)
if udev_dep.found()
cdata.set('HAVE_UDEV', 1)
endif
+webrtc_dep = dependency('webrtc-audio-processing', version : '>= 0.2', required : false)
+if webrtc_dep.found()
+ cdata.set('HAVE_WEBRTC', 1)
+endif
+
# Now generate config.h from everything above
configure_file(output : 'config.h', configuration : cdata)
diff --git a/src/modules/echo-cancel/meson.build b/src/modules/echo-cancel/meson.build
new file mode 100644
index 000000000..2197c80ee
--- /dev/null
+++ b/src/modules/echo-cancel/meson.build
@@ -0,0 +1,18 @@
+# The webrtc code is split off into a helper library to avoid having automake
+# link module-echo-cancel with C++ (which it does if there are any C++ deps,
+# even conditional ones).
+
+# Defining this library as shared fails, as it actually requires a symbol
+# from module-echo-cancel.c. Setting it to static solves that.
+
+libwebrtc_util_sources = [
+ 'webrtc.cc'
+]
+
+libwebrtc_util = static_library('libwebrtc_util',
+ libwebrtc_util_sources,
+ cpp_args : [pa_c_args, server_c_args],
+ include_directories : [configinc, topinc],
+ dependencies : [libpulse_dep, libpulsecommon_dep, libpulsecore_dep, webrtc_dep],
+ install : true
+)
diff --git a/src/modules/meson.build b/src/modules/meson.build
index b79011c87..683b42f56 100644
--- a/src/modules/meson.build
+++ b/src/modules/meson.build
@@ -22,7 +22,6 @@ all_modules = [
[ 'module-detect', 'module-detect.c' ],
[ 'module-device-manager', 'module-device-manager.c', [], [], [], libprotocol_native ],
[ 'module-device-restore', 'module-device-restore.c', [], [], [dbus_dep], libprotocol_native ],
-# [ 'module-echo-cancel', 'module-echo-cancel.c' ],
[ 'module-esound-compat-spawnfd', 'module-esound-compat-spawnfd.c' ],
[ 'module-esound-compat-spawnpid', 'module-esound-compat-spawnpid.c' ],
# [ 'module-esound-protocol-tcp', 'module-protocol-stub.c' ],
@@ -197,6 +196,53 @@ if x11_dep.found()
endif
endif
+# Module echo-cancel is quite modular itself and requires a section of its own
+
+module_echo_cancel_sources = [
+ 'echo-cancel/echo-cancel.h',
+ 'echo-cancel/module-echo-cancel.c',
+ 'echo-cancel/null.c',
+]
+module_echo_cancel_flags = []
+module_echo_cancel_deps = []
+module_echo_cancel_libs = []
+
+# FIXME: Adrian support should be optional
+module_echo_cancel_sources += [
+ 'echo-cancel/adrian.c', 'echo-cancel/adrian.h',
+ 'echo-cancel/adrian-aec.c', 'echo-cancel/adrian-aec.h',
+]
+module_echo_cancel_flags += ['-DHAVE_ADRIAN_EC=1']
+
+# FIXME: support ORC (depends on Adrian)
+#ORC_SOURCE += modules/echo-cancel/adrian-aec
+#module_echo_cancel_sources += [
+# 'echo-cancel/adrian-aec-orc-gen.c', 'echo-cancel/adrian-aec-orc-gen.h'
+#]
+#module_echo_cancel_deps += [orc_dep]
+
+if speex_dep.found()
+ module_echo_cancel_sources += ['echo-cancel/speex.c']
+ module_echo_cancel_deps += [speex_dep]
+endif
+
+if webrtc_dep.found()
+ subdir('echo-cancel')
+ module_echo_cancel_libs += [libwebrtc_util]
+endif
+
+all_modules += [
+ [ 'module-echo-cancel',
+ module_echo_cancel_sources,
+ [],
+ module_echo_cancel_flags,
+ module_echo_cancel_deps,
+ module_echo_cancel_libs,
+ ]
+]
+
+# Generate a shared module object for each modules
+
foreach m : all_modules
name = m[0]
sources = m[1]
diff --git a/src/pulsecore/meson.build b/src/pulsecore/meson.build
index 7057daf2e..a6830044c 100644
--- a/src/pulsecore/meson.build
+++ b/src/pulsecore/meson.build
@@ -126,6 +126,10 @@ if dbus_dep.found()
]
endif
+if speex_dep.found()
+ libpulsecore_sources += ['resampler/speex.c']
+endif
+
if x11_dep.found()
libpulsecore_sources += ['x11wrap.c']
libpulsecore_headers += ['x11wrap.h']
@@ -159,7 +163,7 @@ libpulsecore = shared_library('pulsecore-' + pa_version_major_minor,
c_args : [pa_c_args, server_c_args],
install : true,
link_with : libpulsecore_simd_lib,
- dependencies : [libm_dep, libpulsecommon_dep, libpulse_dep, ltdl_dep, shm_dep, sndfile_dep, database_dep, dbus_dep, x11_dep],
+ dependencies : [libm_dep, libpulsecommon_dep, libpulse_dep, ltdl_dep, shm_dep, sndfile_dep, database_dep, dbus_dep, speex_dep, x11_dep],
implicit_include_directories : false)
libpulsecore_dep = declare_dependency(link_with: libpulsecore)