diff --git a/media/libcubeb/src/moz.build b/media/libcubeb/src/moz.build index c91665adf9d4..c4574a60cbd5 100644 --- a/media/libcubeb/src/moz.build +++ b/media/libcubeb/src/moz.build @@ -60,6 +60,8 @@ if CONFIG['OS_TARGET'] == 'Darwin': 'cubeb_osx_run_loop.c', ] DEFINES['USE_AUDIOUNIT'] = True + if CONFIG['MOZ_AUDIOUNIT_RUST']: + DEFINES['USE_AUDIOUNIT_RUST'] = True if CONFIG['OS_TARGET'] == 'WINNT': SOURCES += [ diff --git a/toolkit/library/gtest/rust/Cargo.toml b/toolkit/library/gtest/rust/Cargo.toml index e7317587b5d9..49cf7969ec6d 100644 --- a/toolkit/library/gtest/rust/Cargo.toml +++ b/toolkit/library/gtest/rust/Cargo.toml @@ -10,6 +10,7 @@ bindgen = ["gkrust-shared/bindgen"] servo = ["gkrust-shared/servo"] quantum_render = ["gkrust-shared/quantum_render"] cubeb-remoting = ["gkrust-shared/cubeb-remoting"] +cubeb_coreaudio_rust = ["gkrust-shared/cubeb_coreaudio_rust"] cubeb_pulse_rust = ["gkrust-shared/cubeb_pulse_rust"] gecko_debug = ["gkrust-shared/gecko_debug"] gecko_refcount_logging = ["gkrust-shared/gecko_refcount_logging"] diff --git a/toolkit/library/rust/Cargo.toml b/toolkit/library/rust/Cargo.toml index e539d94a7c4e..2f67e593444e 100644 --- a/toolkit/library/rust/Cargo.toml +++ b/toolkit/library/rust/Cargo.toml @@ -12,6 +12,7 @@ quantum_render = ["gkrust-shared/quantum_render"] webrender_debugger = ["gkrust-shared/webrender_debugger"] cubeb-remoting = ["gkrust-shared/cubeb-remoting"] cubeb_pulse_rust = ["gkrust-shared/cubeb_pulse_rust"] +cubeb_coreaudio_rust = ["gkrust-shared/cubeb_coreaudio_rust"] gecko_debug = ["gkrust-shared/gecko_debug"] gecko_refcount_logging = ["gkrust-shared/gecko_refcount_logging"] simd-accel = ["gkrust-shared/simd-accel"] diff --git a/toolkit/library/rust/gkrust-features.mozbuild b/toolkit/library/rust/gkrust-features.mozbuild index 72caac0e922e..bf8e73c98da6 100644 --- a/toolkit/library/rust/gkrust-features.mozbuild +++ b/toolkit/library/rust/gkrust-features.mozbuild @@ -19,6 +19,9 @@ if CONFIG['MOZ_WEBRENDER_DEBUGGER']: if CONFIG['MOZ_PULSEAUDIO']: gkrust_features += ['cubeb_pulse_rust'] +if CONFIG['MOZ_AUDIOUNIT_RUST']: + gkrust_features += ['cubeb_coreaudio_rust'] + if CONFIG['MOZ_RUST_SIMD']: gkrust_features += ['simd-accel'] diff --git a/toolkit/library/rust/shared/Cargo.toml b/toolkit/library/rust/shared/Cargo.toml index c659552cdc95..49ff9d8291f6 100644 --- a/toolkit/library/rust/shared/Cargo.toml +++ b/toolkit/library/rust/shared/Cargo.toml @@ -18,6 +18,7 @@ prefs_parser = { path = "../../../../modules/libpref/parser" } profiler_helper = { path = "../../../../tools/profiler/rust-helper", optional = true } mozurl = { path = "../../../../netwerk/base/mozurl" } webrender_bindings = { path = "../../../../gfx/webrender_bindings", optional = true } +cubeb-coreaudio = { path = "../../../../media/libcubeb/cubeb-coreaudio-rs", optional = true } cubeb-pulse = { path = "../../../../media/libcubeb/cubeb-pulse-rs", optional = true, features=["pulse-dlopen"] } cubeb-sys = { version = "0.5.0", optional = true, features=["gecko-in-tree"] } encoding_c = "0.9.0" @@ -51,6 +52,7 @@ servo = ["geckoservo"] quantum_render = ["webrender_bindings"] webrender_debugger = ["webrender_bindings/webrender_debugger"] cubeb-remoting = ["cubeb-sys", "audioipc-client", "audioipc-server"] +cubeb_coreaudio_rust = ["cubeb-sys", "cubeb-coreaudio"] cubeb_pulse_rust = ["cubeb-sys", "cubeb-pulse"] gecko_debug = ["geckoservo/gecko_debug", "nsstring/gecko_debug"] gecko_refcount_logging = ["geckoservo/gecko_refcount_logging"] diff --git a/toolkit/library/rust/shared/lib.rs b/toolkit/library/rust/shared/lib.rs index c5ff9e10dc31..1e544632b20e 100644 --- a/toolkit/library/rust/shared/lib.rs +++ b/toolkit/library/rust/shared/lib.rs @@ -19,6 +19,8 @@ extern crate profiler_helper; extern crate mozurl; #[cfg(feature = "quantum_render")] extern crate webrender_bindings; +#[cfg(feature = "cubeb_coreaudio_rust")] +extern crate cubeb_coreaudio; #[cfg(feature = "cubeb_pulse_rust")] extern crate cubeb_pulse; extern crate encoding_c; diff --git a/toolkit/moz.configure b/toolkit/moz.configure index 2eb0684861f1..1637dd8575e8 100644 --- a/toolkit/moz.configure +++ b/toolkit/moz.configure @@ -153,6 +153,15 @@ pulseaudio = pkg_check_modules('MOZ_PULSEAUDIO', 'libpulse', when='--enable-puls set_config('MOZ_PULSEAUDIO', depends_if(pulseaudio)(lambda _: True)) set_define('MOZ_PULSEAUDIO', depends_if(pulseaudio)(lambda _: True)) +# AudioUnit cubeb Rust backend +# ============================================================== +@depends(target) +def enable_audiounit_rust(target): + return target.os == 'OSX' and target.kernel == 'Darwin' + +set_config('MOZ_AUDIOUNIT_RUST', True, when=enable_audiounit_rust) +set_define('MOZ_AUDIOUNIT_RUST', True, when=enable_audiounit_rust) + # Javascript engine # ============================================================== include('../js/moz.configure')