meson: Rework FFmpeg / tinycompress detection and add pw-cat-ffmpeg option

* Decouple FFmpeg integration in pw-cat from the ffmpeg option; if
  one wants to use Compress-Offload but not the ffmpeg SPA plugin,
  it is then possible to just pass -Dpw-cat-ffmpeg=enabled to meson.
  Likewise, this also makes it possible to build the ffmpeg plugin
  without extending pw-cat.
* tinycompress does not need to be detected in the root meson.build,
  since it is only needed by the alsa plugin.
This commit is contained in:
Carlos Rafael Giani 2022-11-23 16:22:30 +01:00 committed by Wim Taymans
parent e9a2c6aa34
commit 6284cf39c0
4 changed files with 29 additions and 12 deletions

View file

@ -32,15 +32,18 @@ if ncurses_dep.found()
endif
build_pw_cat = false
build_pw_cat_with_ffmpeg = false
pwcat_deps = [ sndfile_dep ]
if avcodec_dep.found() and avformat_dep.found()
pwcat_deps += avcodec_dep
pwcat_deps += avformat_dep
endif
if get_option('pw-cat').allowed() and sndfile_dep.found()
build_pw_cat = true
if pw_cat_ffmpeg.allowed() and avcodec_dep.found() and avformat_dep.found()
pwcat_deps += avcodec_dep
pwcat_deps += avformat_dep
build_pw_cat_with_ffmpeg = true
endif
pwcat_sources = [
'pw-cat.c',
'midifile.c',
@ -70,6 +73,9 @@ elif not sndfile_dep.found() and get_option('pw-cat').enabled()
error('pw-cat is enabled but required dependency `sndfile` was not found.')
endif
summary({'Build pw-cat tool': build_pw_cat}, bool_yn: true, section: 'pw-cat/pw-play/pw-dump tool')
if build_pw_cat
summary({'Build pw-cat with FFmpeg integration': build_pw_cat_with_ffmpeg}, bool_yn: true, section: 'pw-cat/pw-play/pw-dump tool')
endif
if dbus_dep.found()
executable('pw-reserve',