summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-libs/tg_owt/files/tg_owt-0_pre20210626-allow-disabling-pulseaudio.patch')
-rw-r--r--media-libs/tg_owt/files/tg_owt-0_pre20210626-allow-disabling-pulseaudio.patch90
1 files changed, 90 insertions, 0 deletions
diff --git a/media-libs/tg_owt/files/tg_owt-0_pre20210626-allow-disabling-pulseaudio.patch b/media-libs/tg_owt/files/tg_owt-0_pre20210626-allow-disabling-pulseaudio.patch
new file mode 100644
index 000000000000..0bddb5fd00f6
--- /dev/null
+++ b/media-libs/tg_owt/files/tg_owt-0_pre20210626-allow-disabling-pulseaudio.patch
@@ -0,0 +1,90 @@
+Add support for -DTG_OWT_BUILD_PULSE_BACKEND
+
+This is based off of the rtc_include_pulse_audio option in:
+* src/modules/audio_device/BUILD.gn
+
+ALSA must be enabled unless audio support is removed as a whole, see:
+* src/modules/audio_device/audio_device_impl.cc
+
+--- tg_owt-91d836dc84a16584c6ac52b36c04c0de504d9c34.orig/CMakeLists.txt
++++ tg_owt-91d836dc84a16584c6ac52b36c04c0de504d9c34/CMakeLists.txt
+@@ -25,12 +25,17 @@
+ option(TG_OWT_USE_PIPEWIRE "Use pipewire for desktop capture on non-Apple Unix." ON)
+ option(TG_OWT_DLOPEN_PIPEWIRE "dlopen pipewire 0.3 for desktop capture on non-Apple Unix." ${not_packaged_build})
+ option(TG_OWT_BUILD_AUDIO_BACKENDS "Build webrtc audio backends." ON)
++option(TG_OWT_BUILD_PULSE_BACKEND "Build pulseaudio audio backend on non-Apple Unix." ON)
+
+ if (NOT UNIX OR APPLE)
+ set(TG_OWT_USE_X11 OFF)
+ set(TG_OWT_USE_PIPEWIRE OFF)
+ endif()
+
++if (NOT TG_OWT_BUILD_AUDIO_BACKENDS)
++ set(TG_OWT_BUILD_PULSE_BACKEND OFF)
++endif()
++
+ if (BUILD_SHARED_LIBS)
+ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+ endif()
+@@ -162,9 +167,11 @@
+ link_libvpx(tg_owt)
+
+ if (TG_OWT_BUILD_AUDIO_BACKENDS AND (UNIX AND NOT APPLE))
+- link_libalsa(tg_owt)
+- link_libpulse(tg_owt)
+ link_dl(tg_owt)
++ link_libalsa(tg_owt)
++ if (TG_OWT_BUILD_PULSE_BACKEND)
++ link_libpulse(tg_owt)
++ endif()
+ endif()
+
+ if (NOT WIN32 AND NOT APPLE)
+@@ -2218,12 +2225,6 @@
+ modules/audio_device/linux/audio_mixer_manager_alsa_linux.h
+ modules/audio_device/linux/latebindingsymboltable_linux.cc
+ modules/audio_device/linux/latebindingsymboltable_linux.h
+- modules/audio_device/linux/audio_device_pulse_linux.cc
+- modules/audio_device/linux/audio_device_pulse_linux.h
+- modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc
+- modules/audio_device/linux/audio_mixer_manager_pulse_linux.h
+- modules/audio_device/linux/pulseaudiosymboltable_linux.cc
+- modules/audio_device/linux/pulseaudiosymboltable_linux.h
+ modules/audio_device/mac/audio_device_mac.cc
+ modules/audio_device/mac/audio_device_mac.h
+ modules/audio_device/mac/audio_mixer_manager_mac.cc
+@@ -2243,6 +2244,17 @@
+ )
+ endif()
+
++if (NOT TG_OWT_BUILD_PULSE_BACKEND)
++ remove_target_sources(tg_owt ${webrtc_loc}
++ modules/audio_device/linux/audio_device_pulse_linux.cc
++ modules/audio_device/linux/audio_device_pulse_linux.h
++ modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc
++ modules/audio_device/linux/audio_mixer_manager_pulse_linux.h
++ modules/audio_device/linux/pulseaudiosymboltable_linux.cc
++ modules/audio_device/linux/pulseaudiosymboltable_linux.h
++ )
++endif()
++
+ if (NOT WIN32)
+ remove_target_sources(tg_owt ${webrtc_loc}
+ rtc_base/win32.cc
+--- tg_owt-91d836dc84a16584c6ac52b36c04c0de504d9c34.orig/cmake/libwebrtcbuild.cmake
++++ tg_owt-91d836dc84a16584c6ac52b36c04c0de504d9c34/cmake/libwebrtcbuild.cmake
+@@ -50,8 +50,13 @@
+ target_compile_definitions(libwebrtcbuild
+ INTERFACE
+ WEBRTC_ENABLE_LINUX_ALSA
+- WEBRTC_ENABLE_LINUX_PULSE
+ )
++ if (TG_OWT_BUILD_PULSE_BACKEND)
++ target_compile_definitions(libwebrtcbuild
++ INTERFACE
++ WEBRTC_ENABLE_LINUX_PULSE
++ )
++ endif()
+ endif()
+
+ if (WIN32)