mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1754861 - Update AudioIPC macOS branch to d4ea0f2e. r=cubeb-reviewers,chunmin
Differential Revision: https://phabricator.services.mozilla.com/D138478
This commit is contained in:
parent
ee26d5ca8e
commit
fe86399007
@ -65,7 +65,7 @@ rev = "21c26326f5f45f415c49eac4ba5bc41a2f961321"
|
||||
[source."https://github.com/kinetiknz/audioipc-2"]
|
||||
git = "https://github.com/kinetiknz/audioipc-2"
|
||||
replace-with = "vendored-sources"
|
||||
rev = "f04cfa6a9463232e0468436b0482a698bb12b1ec"
|
||||
rev = "d4ea0f2e5da7afcaf60e63aa291f7b7d0018fa86"
|
||||
|
||||
[source."https://github.com/jfkthame/mapped_hyph.git"]
|
||||
git = "https://github.com/jfkthame/mapped_hyph.git"
|
||||
|
6
Cargo.lock
generated
6
Cargo.lock
generated
@ -266,7 +266,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "audioipc2"
|
||||
version = "0.5.0"
|
||||
source = "git+https://github.com/kinetiknz/audioipc-2?rev=f04cfa6a9463232e0468436b0482a698bb12b1ec#f04cfa6a9463232e0468436b0482a698bb12b1ec"
|
||||
source = "git+https://github.com/kinetiknz/audioipc-2?rev=d4ea0f2e5da7afcaf60e63aa291f7b7d0018fa86#d4ea0f2e5da7afcaf60e63aa291f7b7d0018fa86"
|
||||
dependencies = [
|
||||
"ashmem",
|
||||
"audio_thread_priority",
|
||||
@ -291,7 +291,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "audioipc2-client"
|
||||
version = "0.5.0"
|
||||
source = "git+https://github.com/kinetiknz/audioipc-2?rev=f04cfa6a9463232e0468436b0482a698bb12b1ec#f04cfa6a9463232e0468436b0482a698bb12b1ec"
|
||||
source = "git+https://github.com/kinetiknz/audioipc-2?rev=d4ea0f2e5da7afcaf60e63aa291f7b7d0018fa86#d4ea0f2e5da7afcaf60e63aa291f7b7d0018fa86"
|
||||
dependencies = [
|
||||
"audio_thread_priority",
|
||||
"audioipc2",
|
||||
@ -302,7 +302,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "audioipc2-server"
|
||||
version = "0.5.0"
|
||||
source = "git+https://github.com/kinetiknz/audioipc-2?rev=f04cfa6a9463232e0468436b0482a698bb12b1ec#f04cfa6a9463232e0468436b0482a698bb12b1ec"
|
||||
source = "git+https://github.com/kinetiknz/audioipc-2?rev=d4ea0f2e5da7afcaf60e63aa291f7b7d0018fa86#d4ea0f2e5da7afcaf60e63aa291f7b7d0018fa86"
|
||||
dependencies = [
|
||||
"audio_thread_priority",
|
||||
"audioipc2",
|
||||
|
@ -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":"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}
|
||||
{"files":{"Cargo.toml":"d12aaf7e88bb704890b9401de55775c9e746be92448c6f280c1cb8e37e2e773f","benches/serialization.rs":"d56855d868dab6aa22c8b03a61084535351b76c94b68d8b1d20764e352fe473f","build.rs":"3f061cf9a989f63a71c693a543d26f7003e8b643c39c23ea555110252a2c39d2","src/cmsghdr.c":"d7344b3dc15cdce410c68669b848bb81f7fe36362cd3699668cb613fa05180f8","src/codec.rs":"328c7c43e23e42dd1768c1806ef679517c966dcdc4b27b2382d183593345d1e1","src/errors.rs":"67a4a994d0724397657581cde153bdfc05ce86e7efc467f23fafc8f64df80fa4","src/ipccore.rs":"11030d7a163c35ceb1b798552805a8982c33da24862a95a98bfc2633bbbd8c17","src/lib.rs":"84d4b3db37309ca6dd735a59270a787049028d048458af514ef9b3aaf6a2dd58","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}
|
22
third_party/rust/audioipc2/src/codec.rs
vendored
22
third_party/rust/audioipc2/src/codec.rs
vendored
@ -65,6 +65,8 @@ enum State {
|
||||
}
|
||||
|
||||
const MAX_MESSAGE_LEN: u32 = 1024 * 1024;
|
||||
const MAGIC: u64 = 0xa4d1_019c_c910_1d4a;
|
||||
const HEADER_LEN: usize = size_of::<u32>() + size_of::<u64>();
|
||||
|
||||
impl<In, Out> Default for LengthDelimitedCodec<In, Out> {
|
||||
fn default() -> Self {
|
||||
@ -80,14 +82,17 @@ impl<In, Out> Default for LengthDelimitedCodec<In, Out> {
|
||||
impl<In, Out> LengthDelimitedCodec<In, Out> {
|
||||
// Lengths are encoded as little endian u32
|
||||
fn decode_length(buf: &mut BytesMut) -> Option<u32> {
|
||||
if buf.len() < size_of::<u32>() {
|
||||
if buf.len() < HEADER_LEN {
|
||||
// Not enough data
|
||||
return None;
|
||||
}
|
||||
|
||||
let magic = LittleEndian::read_u64(&buf[0..8]);
|
||||
assert_eq!(magic, MAGIC);
|
||||
|
||||
// Consume the length field
|
||||
let n = LittleEndian::read_u32(buf.as_ref());
|
||||
buf.advance(size_of::<u32>());
|
||||
let n = LittleEndian::read_u32(&buf[8..12]);
|
||||
buf.advance(HEADER_LEN);
|
||||
Some(n)
|
||||
}
|
||||
|
||||
@ -131,7 +136,12 @@ where
|
||||
State::Length => {
|
||||
match Self::decode_length(buf) {
|
||||
Some(n) => {
|
||||
assert!(n <= MAX_MESSAGE_LEN);
|
||||
assert!(
|
||||
n <= MAX_MESSAGE_LEN,
|
||||
"assertion failed: {} <= {}",
|
||||
n,
|
||||
MAX_MESSAGE_LEN
|
||||
);
|
||||
self.state = State::Data(n);
|
||||
|
||||
// Ensure that the buffer has enough space to read the
|
||||
@ -176,7 +186,9 @@ where
|
||||
}
|
||||
|
||||
let encoded_len = self.encode_buf.len();
|
||||
buf.reserve(encoded_len + size_of::<u32>());
|
||||
assert!(encoded_len <= MAX_MESSAGE_LEN as usize);
|
||||
buf.reserve(encoded_len + HEADER_LEN);
|
||||
buf.put_u64_le(MAGIC);
|
||||
buf.put_u32_le(encoded_len.try_into().unwrap());
|
||||
buf.extend_from_slice(&self.encode_buf);
|
||||
|
||||
|
5
third_party/rust/audioipc2/src/lib.rs
vendored
5
third_party/rust/audioipc2/src/lib.rs
vendored
@ -88,9 +88,10 @@ impl PlatformHandle {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::missing_safety_doc)]
|
||||
#[cfg(windows)]
|
||||
pub fn duplicate(h: PlatformHandleType) -> Result<PlatformHandle, std::io::Error> {
|
||||
let dup = unsafe { duplicate_platform_handle(h, None) }?;
|
||||
pub unsafe fn duplicate(h: PlatformHandleType) -> Result<PlatformHandle, std::io::Error> {
|
||||
let dup = duplicate_platform_handle(h, None)?;
|
||||
Ok(PlatformHandle::new(dup))
|
||||
}
|
||||
}
|
||||
|
@ -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 = "f04cfa6a9463232e0468436b0482a698bb12b1ec", optional = true } # macos (v2) branch
|
||||
audioipc2-server = { git = "https://github.com/kinetiknz/audioipc-2", rev = "f04cfa6a9463232e0468436b0482a698bb12b1ec", optional = true } # macos (v2) branch
|
||||
audioipc2-client = { git = "https://github.com/kinetiknz/audioipc-2", rev = "d4ea0f2e5da7afcaf60e63aa291f7b7d0018fa86", optional = true } # macos (v2) branch
|
||||
audioipc2-server = { git = "https://github.com/kinetiknz/audioipc-2", rev = "d4ea0f2e5da7afcaf60e63aa291f7b7d0018fa86", 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" }
|
||||
|
Loading…
Reference in New Issue
Block a user