From 8d71d2dab831b77cadb74f2e4630f549acc94ac4 Mon Sep 17 00:00:00 2001 From: Tapasweni Pathak Date: Tue, 9 Oct 2018 13:57:59 +0530 Subject: [PATCH] pipewire: add enable/disable to meson for spa plugins --- .gitmodules | 9 ++++ README | 5 +++ meson.build | 18 ++++++-- meson_options.txt | 64 +++++++++++++++++++++++++++ pipewire-alsa | 1 + pipewire-jack | 1 + pipewire-pulseaudio | 1 + spa/meson.build | 12 +++-- spa/plugins/audioconvert/fmtconvert.c | 2 - spa/plugins/ffmpeg/ffmpeg.c | 2 + spa/plugins/meson.build | 40 ++++++++++++----- 11 files changed, 134 insertions(+), 21 deletions(-) create mode 100644 .gitmodules create mode 160000 pipewire-alsa create mode 160000 pipewire-jack create mode 160000 pipewire-pulseaudio diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..71f651ee9 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,9 @@ +[submodule "pipewire-alsa"] + path = pipewire-alsa + url = git@github.com:PipeWire/pipewire-alsa.git +[submodule "pipewire-jack"] + path = pipewire-jack + url = git@github.com:PipeWire/pipewire-jack.git +[submodule "pipewire-pulseaudio"] + path = pipewire-pulseaudio + url = git@github.com:PipeWire/pipewire-pulseaudio.git diff --git a/README b/README index 77bcce4f6..783a6a92d 100644 --- a/README +++ b/README @@ -32,3 +32,8 @@ $ meson build $ cd build $ ninja +You can see the available meson options in meson_options.txt file. All plugins are +disabled by default. To enable a spa plugin you need to enable spa-plugins and the +plugin name meson option. + +$ meson build -Dspa-plugins=true -D=true diff --git a/meson.build b/meson.build index 8a7a696f3..e9143b80a 100644 --- a/meson.build +++ b/meson.build @@ -168,11 +168,21 @@ if get_option('gstreamer') dependency('gstreamer-allocators-1.0'),] endif -subdir('spa') +if get_option('spa') + subdir('spa') +endif + subdir('src') -subdir('pipewire-jack') -subdir('pipewire-pulseaudio') -subdir('alsa-plugins') + +if get_option('pipewire-jack') + subdir('pipewire-jack/src') +endif +if get_option('pipewire-pulseaudio') + subdir('pipewire-pulseaudio/src') +endif +if get_option('pipewire-alsa') + subdir('pipewire-alsa/alsa-plugins') +endif if get_option('docs') doxygen = find_program('doxygen', required : false) diff --git a/meson_options.txt b/meson_options.txt index 3d21b2b4b..42a4ea6c0 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -14,3 +14,67 @@ option('systemd', description: 'Enable systemd integration', type: 'boolean', value: true) +option('pipewire-alsa', + description: 'Enable pipewire-alsa integration', + type: 'boolean', + value: false) +option('pipewire-jack', + description: 'Enable pipewire-jack integration', + type: 'boolean', + value: false) +option('pipewire-pulseaudio', + description: 'Enable pipewire-pulseaudio integration', + type: 'boolean', + value: false) +option('spa', + description: 'Enable spa integration', + type: 'boolean', + value: true) +option('spa-plugins', + description: 'Enable spa plugins integration', + type: 'boolean', + value: false) +option('alsa', + description: 'Enable alsa spa plugin integration', + type: 'boolean', + value: false) +option('audiomixer', + description: 'Enable audiomixer spa plugin integration', + type: 'boolean', + value: false) +option('audioconvert', + description: 'Enable audiconvert spa plugin integration', + type: 'boolean', + value: false) +option('bluez5', + description: 'Enable bluez5 spa plugin integration', + type: 'boolean', + value: false) +option('audiotestsrc', + description: 'Enable audiotestsrc spa plugin integration', + type: 'boolean', + value: false) +option('ffmpeg', + description: 'Enable ffmpeg spa plugin integration', + type: 'boolean', + value: false) +option('support', + description: 'Enable support spa plugin integration', + type: 'boolean', + value: false) +option('test', + description: 'Enable test spa plugin integration', + type: 'boolean', + value: false) +option('v4l2', + description: 'Enable v4l2 spa plugin integration', + type: 'boolean', + value: false) +option('videotestsrc', + description: 'Enable videotestsrc spa plugin integration', + type: 'boolean', + value: false) +option('volume', + description: 'Enable volume spa plugin integration', + type: 'boolean', + value: false) diff --git a/pipewire-alsa b/pipewire-alsa new file mode 160000 index 000000000..9955e3203 --- /dev/null +++ b/pipewire-alsa @@ -0,0 +1 @@ +Subproject commit 9955e3203025cfe2cd7913d7851e3adb33863259 diff --git a/pipewire-jack b/pipewire-jack new file mode 160000 index 000000000..ea3310bc6 --- /dev/null +++ b/pipewire-jack @@ -0,0 +1 @@ +Subproject commit ea3310bc6dd565cc9070ff57bf2608a1cf705306 diff --git a/pipewire-pulseaudio b/pipewire-pulseaudio new file mode 160000 index 000000000..6a4da8a6b --- /dev/null +++ b/pipewire-pulseaudio @@ -0,0 +1 @@ +Subproject commit 6a4da8a6b31e5ed2e455608d853de159f470ba2e diff --git a/spa/meson.build b/spa/meson.build index fc8249528..dd7e70d4f 100644 --- a/spa/meson.build +++ b/spa/meson.build @@ -1,18 +1,18 @@ #project('spa', 'c') - alsa_dep = dependency('alsa') v4l2_dep = dependency('libv4l2') x11_dep = dependency('x11', required : false) sdl_dep = dependency('sdl2', required : false) +libva_dep = dependency('libva', required : false) +sbc_dep = dependency('sbc', required : false) avcodec_dep = dependency('libavcodec', required : false) avformat_dep = dependency('libavformat', required : false) avfilter_dep = dependency('libavfilter', required : false) -libva_dep = dependency('libva', required : false) -sbc_dep = dependency('sbc', required : false) libudev_dep = dependency('libudev') threads_dep = dependency('threads') speexdsp_dep = dependency('speexdsp') +sdl_dep = dependency('sdl2', required : false) #cc = meson.get_compiler('c') #dl_lib = cc.find_library('dl', required : false) @@ -22,7 +22,11 @@ speexdsp_dep = dependency('speexdsp') spa_inc = include_directories('include') subdir('include') -subdir('plugins') + +if get_option('spa-plugins') + subdir('plugins') +endif + subdir('tools') subdir('tests') diff --git a/spa/plugins/audioconvert/fmtconvert.c b/spa/plugins/audioconvert/fmtconvert.c index 288d4eee9..42c5aafae 100644 --- a/spa/plugins/audioconvert/fmtconvert.c +++ b/spa/plugins/audioconvert/fmtconvert.c @@ -615,8 +615,6 @@ impl_node_port_set_param(struct spa_node *node, uint32_t id, uint32_t flags, const struct spa_pod *param) { - struct impl *this; - spa_return_val_if_fail(node != NULL, -EINVAL); this = SPA_CONTAINER_OF(node, struct impl, node); diff --git a/spa/plugins/ffmpeg/ffmpeg.c b/spa/plugins/ffmpeg/ffmpeg.c index 21f481b85..d5902441d 100644 --- a/spa/plugins/ffmpeg/ffmpeg.c +++ b/spa/plugins/ffmpeg/ffmpeg.c @@ -84,7 +84,9 @@ int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t static struct spa_handle_factory f; static char name[128]; + #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100) av_register_all(); + #endif if (*index == 0) { c = av_codec_next(NULL); diff --git a/spa/plugins/meson.build b/spa/plugins/meson.build index db784db8e..70dc24828 100644 --- a/spa/plugins/meson.build +++ b/spa/plugins/meson.build @@ -1,15 +1,33 @@ -subdir('alsa') -subdir('audioconvert') -subdir('audiomixer') -subdir('audiotestsrc') -if sbc_dep.found() +if get_option('alsa') + subdir('alsa') +endif +if get_option('audioconvert') + subdir('audioconvert') +endif +if get_option('audiomixer') + subdir('audiomixer') +endif +if get_option('audiotestsrc') + subdir('audiotestsrc') +endif +if get_option('bluez5') and sbc_dep.found() subdir('bluez5') endif -if avcodec_dep.found() +if get_option('ffmpeg') and avcodec_dep.found() subdir('ffmpeg') endif -subdir('support') -subdir('test') -subdir('videotestsrc') -subdir('volume') -subdir('v4l2') +if get_option('support') + subdir('support') +endif +if get_option('test') + subdir('test') +endif +if get_option('videotestsrc') + subdir('videotestsrc') +endif +if get_option('volume') + subdir('volume') +endif +if get_option('v4l2') + subdir('v4l2') +endif