Bug 1811911 - Add support for the Sun cubeb backend in the build system r=padenot

Sending this patch on behalf of the NetBSD foundation, this is one of the
out-of-tree patches that they'd like to upstream.

Differential Revision: https://phabricator.services.mozilla.com/D167649
This commit is contained in:
Gabriele Svelto 2023-01-24 12:44:26 +00:00
Родитель 0fb8fd0b30
Коммит c823a63207
2 изменённых файлов: 22 добавлений и 0 удалений

Просмотреть файл

@ -22,6 +22,12 @@ if CONFIG['MOZ_ALSA']:
]
DEFINES['USE_ALSA'] = True
if CONFIG['MOZ_SUNAUDIO']:
SOURCES += [
'cubeb_sun.c',
]
DEFINES['USE_SUN'] = True
if (
CONFIG["MOZ_PULSEAUDIO"]
or CONFIG["MOZ_JACK"]

Просмотреть файл

@ -200,6 +200,10 @@ def audio_backends_default(target):
return ("sndio",)
elif target.os == "OSX":
return ("audiounit",)
elif target.os == "NetBSD":
return ("sunaudio",)
elif target.os == "SunOS":
return ("sunaudio",)
elif target.os == "WINNT":
return ("wasapi",)
else:
@ -218,6 +222,7 @@ option(
"oss",
"pulseaudio",
"sndio",
"sunaudio",
"wasapi",
),
default=audio_backends_default,
@ -293,6 +298,15 @@ def imply_sndio(values, target):
return any("sndio" in value for value in values) or None
@depends("--enable-audio-backends", target)
def imply_sunaudio(values, target):
if any("sunaudio" in value for value in values) and (
target.os != "NetBSD" and target.os != "SunOS"
):
die("Cannot enable sunaudio on %s", target.os)
return any("sunaudio" in value for value in values) or None
@depends("--enable-audio-backends", target)
def imply_wasapi(values, target):
if any("wasapi" in value for value in values) and target.os != "WINNT":
@ -316,6 +330,8 @@ imply_option("--enable-pulseaudio", imply_pulseaudio, reason="--enable-audio-bac
imply_option("--enable-sndio", imply_sndio, reason="--enable-audio-backends")
set_config("MOZ_SUNAUDIO", imply_sunaudio, when="--enable-audio-backends")
set_config("MOZ_WASAPI", imply_wasapi, when="--enable-audio-backends")
# ALSA cubeb backend