Bug 1726279 - Enable AudioIPC rework for Windows and Linux by default. r=cubeb-reviewers,padenot

Differential Revision: https://phabricator.services.mozilla.com/D134930
This commit is contained in:
Matthew Gregan 2022-01-14 03:52:35 +00:00
parent 4ee43223cc
commit 598758c576
6 changed files with 33 additions and 21 deletions

View File

@ -60,7 +60,7 @@ rev = "21c26326f5f45f415c49eac4ba5bc41a2f961321"
[source."https://github.com/kinetiknz/audioipc-2"]
git = "https://github.com/kinetiknz/audioipc-2"
replace-with = "vendored-sources"
rev = "978b4082bdc7d8e1aa58dd49e45cdc81beacb333"
rev = "f04cfa6a9463232e0468436b0482a698bb12b1ec"
[source."https://github.com/jfkthame/mapped_hyph.git"]
git = "https://github.com/jfkthame/mapped_hyph.git"

6
Cargo.lock generated
View File

@ -267,7 +267,7 @@ dependencies = [
[[package]]
name = "audioipc2"
version = "0.5.0"
source = "git+https://github.com/kinetiknz/audioipc-2?rev=978b4082bdc7d8e1aa58dd49e45cdc81beacb333#978b4082bdc7d8e1aa58dd49e45cdc81beacb333"
source = "git+https://github.com/kinetiknz/audioipc-2?rev=f04cfa6a9463232e0468436b0482a698bb12b1ec#f04cfa6a9463232e0468436b0482a698bb12b1ec"
dependencies = [
"ashmem",
"audio_thread_priority",
@ -292,7 +292,7 @@ dependencies = [
[[package]]
name = "audioipc2-client"
version = "0.5.0"
source = "git+https://github.com/kinetiknz/audioipc-2?rev=978b4082bdc7d8e1aa58dd49e45cdc81beacb333#978b4082bdc7d8e1aa58dd49e45cdc81beacb333"
source = "git+https://github.com/kinetiknz/audioipc-2?rev=f04cfa6a9463232e0468436b0482a698bb12b1ec#f04cfa6a9463232e0468436b0482a698bb12b1ec"
dependencies = [
"audio_thread_priority",
"audioipc2",
@ -303,7 +303,7 @@ dependencies = [
[[package]]
name = "audioipc2-server"
version = "0.5.0"
source = "git+https://github.com/kinetiknz/audioipc-2?rev=978b4082bdc7d8e1aa58dd49e45cdc81beacb333#978b4082bdc7d8e1aa58dd49e45cdc81beacb333"
source = "git+https://github.com/kinetiknz/audioipc-2?rev=f04cfa6a9463232e0468436b0482a698bb12b1ec#f04cfa6a9463232e0468436b0482a698bb12b1ec"
dependencies = [
"audio_thread_priority",
"audioipc2",

View File

@ -8156,7 +8156,11 @@
- name: media.cubeb.sandbox_v2
type: bool
mirror: always
#if defined(XP_MACOSX)
#if defined(XP_LINUX) && !defined(MOZ_WIDGET_ANDROID)
value: true
#elif defined(XP_WIN) && !defined(_ARM64_)
value: true
#elif defined(XP_MACOSX)
value: true
#else
value: false

View File

@ -1 +1 @@
{"files":{"Cargo.toml":"d12aaf7e88bb704890b9401de55775c9e746be92448c6f280c1cb8e37e2e773f","benches/serialization.rs":"d56855d868dab6aa22c8b03a61084535351b76c94b68d8b1d20764e352fe473f","build.rs":"3f061cf9a989f63a71c693a543d26f7003e8b643c39c23ea555110252a2c39d2","src/cmsghdr.c":"d7344b3dc15cdce410c68669b848bb81f7fe36362cd3699668cb613fa05180f8","src/codec.rs":"b24f3dac2fa0a566883295627b5391b132e1772eddc2ff0b31e857c58f485a09","src/errors.rs":"67a4a994d0724397657581cde153bdfc05ce86e7efc467f23fafc8f64df80fa4","src/ipccore.rs":"f92de4b5621ad4be02d2c3dd9f95501a368f1644e0b24b6a93d1267afde8c15f","src/lib.rs":"69622b35ba60ee17daffb5b243c5d2c31d8359219a54c08ad9a13326a51aa3f6","src/messages.rs":"d78247a1c2d5de1d799df100baaeebf6e1b6daba95ef6058fd90387f82526f80","src/rpccore.rs":"e6800250049690cd900b66a010541affad4b30a6f4dea168ebe807043490f916","src/shm.rs":"748c4a261e298900ee0266acf42e4e9f72594d9b90f530c71d8d4f1d659a6de0","src/sys/mod.rs":"da4412ee630e53a0d3a79d9e18953280818bd58ed3fb3c6abedeeb8a092d3dfc","src/sys/unix/cmsg.rs":"71a51a5cd6fd54054f500af82a76b19a690258767ac7b68c6c35cc9d962d5629","src/sys/unix/mod.rs":"246e83874d9765f6db88ea8bc3511b8d1ce4557744f4415ad41de135f6b9baff","src/sys/unix/msg.rs":"d29d3974c145df8b1b931222f62aa64be0ec165b578f31b8f98555fa4d052b01","src/sys/windows/mod.rs":"50af90f17d9b61045ac009e0f53077f9a645c72c214c400b116c4eca2adce0d7"},"package":null}
{"files":{"Cargo.toml":"d12aaf7e88bb704890b9401de55775c9e746be92448c6f280c1cb8e37e2e773f","benches/serialization.rs":"d56855d868dab6aa22c8b03a61084535351b76c94b68d8b1d20764e352fe473f","build.rs":"3f061cf9a989f63a71c693a543d26f7003e8b643c39c23ea555110252a2c39d2","src/cmsghdr.c":"d7344b3dc15cdce410c68669b848bb81f7fe36362cd3699668cb613fa05180f8","src/codec.rs":"b24f3dac2fa0a566883295627b5391b132e1772eddc2ff0b31e857c58f485a09","src/errors.rs":"67a4a994d0724397657581cde153bdfc05ce86e7efc467f23fafc8f64df80fa4","src/ipccore.rs":"11030d7a163c35ceb1b798552805a8982c33da24862a95a98bfc2633bbbd8c17","src/lib.rs":"69622b35ba60ee17daffb5b243c5d2c31d8359219a54c08ad9a13326a51aa3f6","src/messages.rs":"d78247a1c2d5de1d799df100baaeebf6e1b6daba95ef6058fd90387f82526f80","src/rpccore.rs":"e6800250049690cd900b66a010541affad4b30a6f4dea168ebe807043490f916","src/shm.rs":"748c4a261e298900ee0266acf42e4e9f72594d9b90f530c71d8d4f1d659a6de0","src/sys/mod.rs":"da4412ee630e53a0d3a79d9e18953280818bd58ed3fb3c6abedeeb8a092d3dfc","src/sys/unix/cmsg.rs":"71a51a5cd6fd54054f500af82a76b19a690258767ac7b68c6c35cc9d962d5629","src/sys/unix/mod.rs":"246e83874d9765f6db88ea8bc3511b8d1ce4557744f4415ad41de135f6b9baff","src/sys/unix/msg.rs":"d29d3974c145df8b1b931222f62aa64be0ec165b578f31b8f98555fa4d052b01","src/sys/windows/mod.rs":"50af90f17d9b61045ac009e0f53077f9a645c72c214c400b116c4eca2adce0d7"},"package":null}

View File

@ -72,9 +72,12 @@ impl EventLoopHandle {
{
let (handler, mut proxy) = make_client::<C>();
let driver = Box::new(FramedDriver::new(handler));
let token = self.add_connection(connection, driver)?;
proxy.connect_event_loop(self.clone(), token);
Ok(proxy)
let r = self.add_connection(connection, driver);
trace!("EventLoop::bind_client {:?}", r);
r.map(|token| {
proxy.connect_event_loop(self.clone(), token);
proxy
})
}
pub fn bind_server<S: Server + Send + 'static>(
@ -90,7 +93,7 @@ impl EventLoopHandle {
let driver = Box::new(FramedDriver::new(handler));
let r = self.add_connection(connection, driver);
trace!("EventLoop::bind_server {:?}", r);
Ok(())
r.map(|_| ())
}
// Register a new connection with associated driver on the EventLoop.
@ -104,19 +107,24 @@ impl EventLoopHandle {
let (tx, rx) = mpsc::channel();
self.requests_tx
.send(Request::AddConnection(connection, driver, tx))
.expect("EventLoop::add_connection");
self.waker.wake().expect("wake failed");
let token = rx.recv().expect("EventLoop::add_connection")?;
Ok(token)
.map_err(|_| {
debug!("EventLoopHandle::add_connection send failed");
io::ErrorKind::ConnectionAborted
})?;
self.waker.wake()?;
rx.recv().map_err(|_| {
debug!("EventLoopHandle::add_connection recv failed");
io::ErrorKind::ConnectionAborted
})?
}
// Signal EventLoop to shutdown. Causes EventLoop::poll to return Ok(false).
fn shutdown(&self) -> Result<()> {
self.requests_tx
.send(Request::Shutdown)
.map_err(|e| io::Error::new(io::ErrorKind::Other, e.to_string()))?;
self.waker.wake()?;
Ok(())
self.requests_tx.send(Request::Shutdown).map_err(|_| {
debug!("EventLoopHandle::shutdown send failed");
io::ErrorKind::ConnectionAborted
})?;
self.waker.wake()
}
// Signal EventLoop to wake connection specified by `token` for processing.

View File

@ -23,8 +23,8 @@ webrender_bindings = { path = "../../../../gfx/webrender_bindings" }
cubeb-coreaudio = { git = "https://github.com/mozilla/cubeb-coreaudio-rs", rev = "dea28d0c7d9952bbf430701ee244f6a4349c98f1", optional = true }
cubeb-pulse = { git = "https://github.com/mozilla/cubeb-pulse-rs", rev="f2456201dbfdc467b80f0ff6bbb1b8a6faf7df02", optional = true, features=["pulse-dlopen"] }
cubeb-sys = { version = "0.9", optional = true, features=["gecko-in-tree"] }
audioipc2-client = { git = "https://github.com/kinetiknz/audioipc-2", rev = "978b4082bdc7d8e1aa58dd49e45cdc81beacb333", optional = true } # macos (v2) branch
audioipc2-server = { git = "https://github.com/kinetiknz/audioipc-2", rev = "978b4082bdc7d8e1aa58dd49e45cdc81beacb333", optional = true } # macos (v2) branch
audioipc2-client = { git = "https://github.com/kinetiknz/audioipc-2", rev = "f04cfa6a9463232e0468436b0482a698bb12b1ec", optional = true } # macos (v2) branch
audioipc2-server = { git = "https://github.com/kinetiknz/audioipc-2", rev = "f04cfa6a9463232e0468436b0482a698bb12b1ec", optional = true } # macos (v2) branch
audioipc-client = { git = "https://github.com/mozilla/audioipc-2", rev = "515bb210a93f520642fd3a60f391652680b3e988", optional = true }
audioipc-server = { git = "https://github.com/mozilla/audioipc-2", rev = "515bb210a93f520642fd3a60f391652680b3e988", optional = true }
encoding_glue = { path = "../../../../intl/encoding_glue" }