зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1885501 - Update audio_thread_priority to 0.32. r=padenot,cubeb-reviewers,supply-chain-reviewers
Version 0.32 of audio_thread_priority no longer links statically with avrt.dll, which should help with the crash from bug 1884214. Differential Revision: https://phabricator.services.mozilla.com/D204747
This commit is contained in:
Родитель
30510ae714
Коммит
3a457a3dde
|
@ -60,9 +60,9 @@ git = "https://github.com/mozilla/application-services"
|
|||
rev = "5fc8ee2f0f6950e36d4096983757bd046d55df9f"
|
||||
replace-with = "vendored-sources"
|
||||
|
||||
[source."git+https://github.com/mozilla/audioipc?rev=596bdb7fbb5745ea415726e16bd497e6c850a540"]
|
||||
[source."git+https://github.com/mozilla/audioipc?rev=409e11f8de6288e9ddfe269654523735302e59e6"]
|
||||
git = "https://github.com/mozilla/audioipc"
|
||||
rev = "596bdb7fbb5745ea415726e16bd497e6c850a540"
|
||||
rev = "409e11f8de6288e9ddfe269654523735302e59e6"
|
||||
replace-with = "vendored-sources"
|
||||
|
||||
[source."git+https://github.com/mozilla/cubeb-coreaudio-rs?rev=d23ab55eab684b46f46e1da177c8814f6103a009"]
|
||||
|
|
|
@ -235,9 +235,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "audio_thread_priority"
|
||||
version = "0.31.0"
|
||||
version = "0.32.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "17fd24082f432a11ad4fde564af75fc9a0beef2f4199e7691b090ff0e065c4d0"
|
||||
checksum = "e3632611da7e79f8fc8fd75840f1ccfa7792dbf1e25d00791344a4450dd8834f"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"dbus",
|
||||
|
@ -250,7 +250,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "audioipc2"
|
||||
version = "0.6.0"
|
||||
source = "git+https://github.com/mozilla/audioipc?rev=596bdb7fbb5745ea415726e16bd497e6c850a540#596bdb7fbb5745ea415726e16bd497e6c850a540"
|
||||
source = "git+https://github.com/mozilla/audioipc?rev=409e11f8de6288e9ddfe269654523735302e59e6#409e11f8de6288e9ddfe269654523735302e59e6"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
"ashmem",
|
||||
|
@ -278,7 +278,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "audioipc2-client"
|
||||
version = "0.6.0"
|
||||
source = "git+https://github.com/mozilla/audioipc?rev=596bdb7fbb5745ea415726e16bd497e6c850a540#596bdb7fbb5745ea415726e16bd497e6c850a540"
|
||||
source = "git+https://github.com/mozilla/audioipc?rev=409e11f8de6288e9ddfe269654523735302e59e6#409e11f8de6288e9ddfe269654523735302e59e6"
|
||||
dependencies = [
|
||||
"audio_thread_priority",
|
||||
"audioipc2",
|
||||
|
@ -289,7 +289,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "audioipc2-server"
|
||||
version = "0.6.0"
|
||||
source = "git+https://github.com/mozilla/audioipc?rev=596bdb7fbb5745ea415726e16bd497e6c850a540#596bdb7fbb5745ea415726e16bd497e6c850a540"
|
||||
source = "git+https://github.com/mozilla/audioipc?rev=409e11f8de6288e9ddfe269654523735302e59e6#409e11f8de6288e9ddfe269654523735302e59e6"
|
||||
dependencies = [
|
||||
"audio_thread_priority",
|
||||
"audioipc2",
|
||||
|
|
|
@ -37,8 +37,8 @@ user-login = "Amanieu"
|
|||
user-name = "Amanieu d'Antras"
|
||||
|
||||
[[publisher.audio_thread_priority]]
|
||||
version = "0.31.0"
|
||||
when = "2024-01-17"
|
||||
version = "0.32.0"
|
||||
when = "2024-03-14"
|
||||
user-id = 1258
|
||||
user-login = "padenot"
|
||||
user-name = "Paul Adenot"
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"files":{"Cargo.toml":"6bceb8b41d1646bd255b39c13dcca5bbcc0984f0f2aca73decb7ee5627443387","LICENSE":"32ee9dbf6196874fc9d406c54a888a6c4cbb9aa4a7f35b46befeaff43a78fe85","Makefile":"0f9a771cfb30c7c4b9961d82fdca4e9e229a955bb2e636474a4101389e18e938","README.md":"c123692b3b50dd621b896a8269814d609cbf1e532b461bf4a77854ddd607eb7a","atp_test.cpp":"8075a040941a65fb9e3f7cbf0535853ca6661c3ac442ec35569b42b24bbec797","audio_thread_priority.h":"f0ecaf1b674f794cde0dc834028e074d4e4675d22ae96acf08b2ae1dceb3474e","generate_osx_bindings.sh":"06e4e03450f788ced18d31fff5660919e6f6ec1119ddace363ffeb82f0518a71","src/lib.rs":"1d5c629d1ee2dab80f7bf422a3add07eaca203f5c1557fdd379361d632e14224","src/mach_sys.rs":"352560fcb9b41d877cff92e5b3b04d6dc68b1f30508ce4b9aed78940120a883e","src/rt_linux.rs":"e77db6d66fb76772dde6c12850ef2c50730cfe00decc0c67211e63f3e8a59c9f","src/rt_mach.rs":"29f8c0397f14cecbac1f76394c2abfe0e05903b54486cf735f9a94a10c168643","src/rt_win.rs":"f2ba097cebf65252c27d9d6dcfbe1fcc041c4b312724bd98e080e114a4de3bb6"},"package":"17fd24082f432a11ad4fde564af75fc9a0beef2f4199e7691b090ff0e065c4d0"}
|
||||
{"files":{"Cargo.toml":"2dd36097338035819ea7fdb1de6d37009571d761fb659194423f7143a3ba25c7","LICENSE":"32ee9dbf6196874fc9d406c54a888a6c4cbb9aa4a7f35b46befeaff43a78fe85","Makefile":"0f9a771cfb30c7c4b9961d82fdca4e9e229a955bb2e636474a4101389e18e938","README.md":"c123692b3b50dd621b896a8269814d609cbf1e532b461bf4a77854ddd607eb7a","atp_test.cpp":"8075a040941a65fb9e3f7cbf0535853ca6661c3ac442ec35569b42b24bbec797","audio_thread_priority.h":"f0ecaf1b674f794cde0dc834028e074d4e4675d22ae96acf08b2ae1dceb3474e","generate_osx_bindings.sh":"06e4e03450f788ced18d31fff5660919e6f6ec1119ddace363ffeb82f0518a71","src/lib.rs":"142a4f40a0deba0544673c5c8cb4398525a7ead2cc5addb4e69dd9a81e771ded","src/mach_sys.rs":"352560fcb9b41d877cff92e5b3b04d6dc68b1f30508ce4b9aed78940120a883e","src/rt_linux.rs":"e77db6d66fb76772dde6c12850ef2c50730cfe00decc0c67211e63f3e8a59c9f","src/rt_mach.rs":"29f8c0397f14cecbac1f76394c2abfe0e05903b54486cf735f9a94a10c168643","src/rt_win.rs":"0c85d771c544e4bb2b8fb60bdffe5a3080c112896f42360eb92cd3b85c010ca0"},"package":"e3632611da7e79f8fc8fd75840f1ccfa7792dbf1e25d00791344a4450dd8834f"}
|
|
@ -12,7 +12,7 @@
|
|||
[package]
|
||||
edition = "2018"
|
||||
name = "audio_thread_priority"
|
||||
version = "0.31.0"
|
||||
version = "0.32.0"
|
||||
authors = ["Paul Adenot <paul@paul.cx>"]
|
||||
description = "Bump a thread to real-time priority, for audio work, on Linux, Windows and macOS"
|
||||
readme = "README.md"
|
||||
|
@ -61,5 +61,5 @@ version = "0.3"
|
|||
version = "0.52"
|
||||
features = [
|
||||
"Win32_Foundation",
|
||||
"Win32_System_Threading",
|
||||
"Win32_System_LibraryLoader",
|
||||
]
|
||||
|
|
|
@ -647,6 +647,15 @@ mod tests {
|
|||
// automatically deallocated, but not demoted until the thread exits.
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn it_works_in_different_threads() {
|
||||
let handles: Vec<_> = (0..32).map(|_| std::thread::spawn(it_works)).collect();
|
||||
for handle in handles {
|
||||
handle.join().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(target_os = "linux")] {
|
||||
use nix::unistd::*;
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
use windows_sys::s;
|
||||
use windows_sys::Win32::Foundation::GetLastError;
|
||||
use windows_sys::Win32::Foundation::FALSE;
|
||||
use windows_sys::Win32::Foundation::HANDLE;
|
||||
use windows_sys::Win32::System::Threading::{
|
||||
AvRevertMmThreadCharacteristics, AvSetMmThreadCharacteristicsA,
|
||||
};
|
||||
|
||||
use self::avrt_lib::AvRtLibrary;
|
||||
use crate::AudioThreadPriorityError;
|
||||
|
||||
use log::info;
|
||||
use std::sync::OnceLock;
|
||||
use windows_sys::{
|
||||
w,
|
||||
Win32::Foundation::{HANDLE, WIN32_ERROR},
|
||||
};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct RtPriorityHandleInternal {
|
||||
|
@ -17,7 +14,7 @@ pub struct RtPriorityHandleInternal {
|
|||
}
|
||||
|
||||
impl RtPriorityHandleInternal {
|
||||
pub fn new(mmcss_task_index: u32, task_handle: HANDLE) -> RtPriorityHandleInternal {
|
||||
fn new(mmcss_task_index: u32, task_handle: HANDLE) -> RtPriorityHandleInternal {
|
||||
RtPriorityHandleInternal {
|
||||
mmcss_task_index,
|
||||
task_handle,
|
||||
|
@ -25,45 +22,205 @@ impl RtPriorityHandleInternal {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn demote_current_thread_from_real_time_internal(
|
||||
rt_priority_handle: RtPriorityHandleInternal,
|
||||
) -> Result<(), AudioThreadPriorityError> {
|
||||
let rv = unsafe { AvRevertMmThreadCharacteristics(rt_priority_handle.task_handle) };
|
||||
if rv == FALSE {
|
||||
return Err(AudioThreadPriorityError::new(&format!(
|
||||
"Unable to restore the thread priority ({:?})",
|
||||
unsafe { GetLastError() }
|
||||
)));
|
||||
}
|
||||
|
||||
info!(
|
||||
"task {} priority restored.",
|
||||
rt_priority_handle.mmcss_task_index
|
||||
);
|
||||
|
||||
Ok(())
|
||||
fn avrt() -> Result<&'static AvRtLibrary, AudioThreadPriorityError> {
|
||||
static AV_RT_LIBRARY: OnceLock<Result<AvRtLibrary, WIN32_ERROR>> = OnceLock::new();
|
||||
AV_RT_LIBRARY
|
||||
.get_or_init(AvRtLibrary::try_new)
|
||||
.as_ref()
|
||||
.map_err(|win32_error| {
|
||||
AudioThreadPriorityError::new(&format!("Unable to load avrt.dll ({win32_error})"))
|
||||
})
|
||||
}
|
||||
|
||||
pub fn promote_current_thread_to_real_time_internal(
|
||||
_audio_buffer_frames: u32,
|
||||
_audio_samplerate_hz: u32,
|
||||
) -> Result<RtPriorityHandleInternal, AudioThreadPriorityError> {
|
||||
let mut task_index = 0u32;
|
||||
avrt()?
|
||||
.set_mm_thread_characteristics(w!("Audio"))
|
||||
.map(|(mmcss_task_index, task_handle)| {
|
||||
info!("task {mmcss_task_index} bumped to real time priority.");
|
||||
RtPriorityHandleInternal::new(mmcss_task_index, task_handle)
|
||||
})
|
||||
.map_err(|win32_error| {
|
||||
AudioThreadPriorityError::new(&format!(
|
||||
"Unable to bump the thread priority ({win32_error})"
|
||||
))
|
||||
})
|
||||
}
|
||||
|
||||
let handle = unsafe { AvSetMmThreadCharacteristicsA(s!("Audio"), &mut task_index) };
|
||||
let handle = RtPriorityHandleInternal::new(task_index, handle);
|
||||
pub fn demote_current_thread_from_real_time_internal(
|
||||
rt_priority_handle: RtPriorityHandleInternal,
|
||||
) -> Result<(), AudioThreadPriorityError> {
|
||||
let RtPriorityHandleInternal {
|
||||
mmcss_task_index,
|
||||
task_handle,
|
||||
} = rt_priority_handle;
|
||||
avrt()?
|
||||
.revert_mm_thread_characteristics(task_handle)
|
||||
.map(|_| {
|
||||
info!("task {mmcss_task_index} priority restored.");
|
||||
})
|
||||
.map_err(|win32_error| {
|
||||
AudioThreadPriorityError::new(&format!(
|
||||
"Unable to restore the thread priority for task {mmcss_task_index} ({win32_error})"
|
||||
))
|
||||
})
|
||||
}
|
||||
|
||||
if handle.task_handle == 0 {
|
||||
return Err(AudioThreadPriorityError::new(&format!(
|
||||
"Unable to restore the thread priority ({:?})",
|
||||
unsafe { GetLastError() }
|
||||
)));
|
||||
mod avrt_lib {
|
||||
use super::win32_utils::{win32_error_if, OwnedLibrary};
|
||||
use std::sync::Once;
|
||||
use windows_sys::{
|
||||
core::PCWSTR,
|
||||
s, w,
|
||||
Win32::Foundation::{BOOL, FALSE, HANDLE, WIN32_ERROR},
|
||||
};
|
||||
|
||||
type AvSetMmThreadCharacteristicsWFn = unsafe extern "system" fn(PCWSTR, *mut u32) -> HANDLE;
|
||||
type AvRevertMmThreadCharacteristicsFn = unsafe extern "system" fn(HANDLE) -> BOOL;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(super) struct AvRtLibrary {
|
||||
// This field is never read because only used for its Drop behavior
|
||||
#[allow(dead_code)]
|
||||
module: OwnedLibrary,
|
||||
|
||||
av_set_mm_thread_characteristics_w: AvSetMmThreadCharacteristicsWFn,
|
||||
av_revert_mm_thread_characteristics: AvRevertMmThreadCharacteristicsFn,
|
||||
}
|
||||
|
||||
info!(
|
||||
"task {} bumped to real time priority.",
|
||||
handle.mmcss_task_index
|
||||
);
|
||||
impl AvRtLibrary {
|
||||
pub(super) fn try_new() -> Result<Self, WIN32_ERROR> {
|
||||
let module = OwnedLibrary::try_new(w!("avrt.dll"))?;
|
||||
let av_set_mm_thread_characteristics_w = unsafe {
|
||||
std::mem::transmute::<_, AvSetMmThreadCharacteristicsWFn>(
|
||||
module.get_proc(s!("AvSetMmThreadCharacteristicsW"))?,
|
||||
)
|
||||
};
|
||||
let av_revert_mm_thread_characteristics = unsafe {
|
||||
std::mem::transmute::<_, AvRevertMmThreadCharacteristicsFn>(
|
||||
module.get_proc(s!("AvRevertMmThreadCharacteristics"))?,
|
||||
)
|
||||
};
|
||||
Ok(Self {
|
||||
module,
|
||||
av_set_mm_thread_characteristics_w,
|
||||
av_revert_mm_thread_characteristics,
|
||||
})
|
||||
}
|
||||
|
||||
Ok(handle)
|
||||
pub(super) fn set_mm_thread_characteristics(
|
||||
&self,
|
||||
task_name: PCWSTR,
|
||||
) -> Result<(u32, HANDLE), WIN32_ERROR> {
|
||||
// Ensure that the first call never runs in parallel with other calls. This
|
||||
// seems necessary to guarantee the success of these other calls. We saw them
|
||||
// fail with an error code of ERROR_PATH_NOT_FOUND in tests, presumably on a
|
||||
// machine where the MMCSS service was initially inactive.
|
||||
static FIRST_CALL: Once = Once::new();
|
||||
let mut first_call_result = None;
|
||||
FIRST_CALL.call_once(|| {
|
||||
first_call_result = Some(self.set_mm_thread_characteristics_internal(task_name))
|
||||
});
|
||||
first_call_result
|
||||
.unwrap_or_else(|| self.set_mm_thread_characteristics_internal(task_name))
|
||||
}
|
||||
|
||||
fn set_mm_thread_characteristics_internal(
|
||||
&self,
|
||||
task_name: PCWSTR,
|
||||
) -> Result<(u32, HANDLE), WIN32_ERROR> {
|
||||
let mut mmcss_task_index = 0u32;
|
||||
let task_handle = unsafe {
|
||||
(self.av_set_mm_thread_characteristics_w)(task_name, &mut mmcss_task_index)
|
||||
};
|
||||
win32_error_if(task_handle == 0)?;
|
||||
Ok((mmcss_task_index, task_handle))
|
||||
}
|
||||
|
||||
pub(super) fn revert_mm_thread_characteristics(
|
||||
&self,
|
||||
handle: HANDLE,
|
||||
) -> Result<(), WIN32_ERROR> {
|
||||
let rv = unsafe { (self.av_revert_mm_thread_characteristics)(handle) };
|
||||
win32_error_if(rv == FALSE)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mod win32_utils {
|
||||
use windows_sys::{
|
||||
core::{PCSTR, PCWSTR},
|
||||
Win32::{
|
||||
Foundation::{FreeLibrary, GetLastError, HMODULE, WIN32_ERROR},
|
||||
System::LibraryLoader::{GetProcAddress, LoadLibraryW},
|
||||
},
|
||||
};
|
||||
|
||||
pub(super) fn win32_error_if(condition: bool) -> Result<(), WIN32_ERROR> {
|
||||
if condition {
|
||||
Err(unsafe { GetLastError() })
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(super) struct OwnedLibrary(HMODULE);
|
||||
|
||||
impl OwnedLibrary {
|
||||
pub(super) fn try_new(lib_file_name: PCWSTR) -> Result<Self, WIN32_ERROR> {
|
||||
let module = unsafe { LoadLibraryW(lib_file_name) };
|
||||
win32_error_if(module == 0)?;
|
||||
Ok(Self(module))
|
||||
}
|
||||
|
||||
fn raw(&self) -> HMODULE {
|
||||
self.0
|
||||
}
|
||||
|
||||
/// SAFETY: The caller must transmute the value wrapped in a Ok(_) to the correct
|
||||
/// function type, with the correct extern specifier.
|
||||
pub(super) unsafe fn get_proc(
|
||||
&self,
|
||||
proc_name: PCSTR,
|
||||
) -> Result<unsafe extern "system" fn() -> isize, WIN32_ERROR> {
|
||||
let proc = unsafe { GetProcAddress(self.raw(), proc_name) };
|
||||
win32_error_if(proc.is_none())?;
|
||||
Ok(proc.unwrap())
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for OwnedLibrary {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
FreeLibrary(self.raw());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::{
|
||||
avrt, demote_current_thread_from_real_time_internal,
|
||||
promote_current_thread_to_real_time_internal,
|
||||
};
|
||||
|
||||
#[test]
|
||||
fn test_successful_avrt_library_load() {
|
||||
assert!(avrt().is_ok())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_successful_api_use() {
|
||||
let handle = promote_current_thread_to_real_time_internal(512, 44100);
|
||||
println!("handle: {handle:?}");
|
||||
assert!(handle.is_ok());
|
||||
|
||||
let result = demote_current_thread_from_real_time_internal(handle.unwrap());
|
||||
println!("result: {result:?}");
|
||||
assert!(result.is_ok());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"files":{"Cargo.toml":"f4852af58bcfd24732469ffbdddfc9404bc0d8c1d2cef279f6a6b6ddd3a080a8","cbindgen.toml":"fb6abe1671497f432a06e40b1db7ed7cd2cceecbd9a2382193ad7534e8855e34","src/context.rs":"a0559e92b554ef3156ab2bf2f1424555c8ef4a7977b9f43ac8500a9f399f8d99","src/lib.rs":"c87d9d57a16a9286cde730978db692df0fbc70cc69dd4f4677198d6843031fd8","src/send_recv.rs":"859abe75b521eb4297c84b30423814b5b87f3c7741ad16fe72189212e123e1ac","src/stream.rs":"90dc6a85552f3569ab1847de4247a46bcff2f5aef0c4d43fa2376589df015b25"},"package":null}
|
||||
{"files":{"Cargo.toml":"e94c46bbd290f02adccc7ae932285416d7e021bfde80abb2fb31a2c05426e732","cbindgen.toml":"fb6abe1671497f432a06e40b1db7ed7cd2cceecbd9a2382193ad7534e8855e34","src/context.rs":"a0559e92b554ef3156ab2bf2f1424555c8ef4a7977b9f43ac8500a9f399f8d99","src/lib.rs":"c87d9d57a16a9286cde730978db692df0fbc70cc69dd4f4677198d6843031fd8","src/send_recv.rs":"859abe75b521eb4297c84b30423814b5b87f3c7741ad16fe72189212e123e1ac","src/stream.rs":"90dc6a85552f3569ab1847de4247a46bcff2f5aef0c4d43fa2376589df015b25"},"package":null}
|
|
@ -25,7 +25,7 @@ cubeb-backend = "0.12"
|
|||
log = "0.4"
|
||||
|
||||
[dependencies.audio_thread_priority]
|
||||
version = "0.31"
|
||||
version = "0.32"
|
||||
default-features = false
|
||||
|
||||
[dependencies.audioipc]
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"files":{"Cargo.toml":"03e2fd801658feeb4bc399194a001acd1f4880967bc2993ef3f1ef20d5545bb9","cbindgen.toml":"fb6abe1671497f432a06e40b1db7ed7cd2cceecbd9a2382193ad7534e8855e34","src/lib.rs":"06aff4fd1326aeabb16b01f81a6f3c59c1717ebe96285a063724830cdf30303a","src/server.rs":"31e0c763527a16dfc281399e8a6c9eb8c1bac71ab9d7866288ec87297f4316e0"},"package":null}
|
||||
{"files":{"Cargo.toml":"77997660e305851d9c0e656aac7159b999452a36f3436d8b2f402edd36fef853","cbindgen.toml":"fb6abe1671497f432a06e40b1db7ed7cd2cceecbd9a2382193ad7534e8855e34","src/lib.rs":"d70079c66de72c3469504f1f0c9cf5e510644cac17f2d8300b8d12218740e07b","src/server.rs":"187e2236aa9f2fb6cc4a533d40714a71504afa5ef9d849ac28b7f26032859c29"},"package":null}
|
|
@ -27,7 +27,7 @@ once_cell = "1.2.0"
|
|||
slab = "0.4"
|
||||
|
||||
[dependencies.audio_thread_priority]
|
||||
version = "0.31"
|
||||
version = "0.32"
|
||||
default-features = false
|
||||
|
||||
[dependencies.audioipc]
|
||||
|
|
|
@ -35,8 +35,8 @@ static G_CUBEB_CONTEXT_PARAMS: Lazy<Mutex<CubebContextParams>> = Lazy::new(|| {
|
|||
});
|
||||
|
||||
#[allow(deprecated)]
|
||||
#[allow(clippy::upper_case_acronyms)]
|
||||
pub mod errors {
|
||||
#![allow(clippy::upper_case_acronyms)]
|
||||
error_chain! {
|
||||
links {
|
||||
AudioIPC(::audioipc::errors::Error, ::audioipc::errors::ErrorKind);
|
||||
|
@ -159,7 +159,7 @@ pub unsafe extern "C" fn audioipc2_server_start(
|
|||
assert!(!init_params.is_null());
|
||||
let mut params = G_CUBEB_CONTEXT_PARAMS.lock().unwrap();
|
||||
if !context_name.is_null() {
|
||||
params.context_name = CStr::from_ptr(context_name).to_owned();
|
||||
CStr::from_ptr(context_name).clone_into(&mut params.context_name);
|
||||
}
|
||||
if !backend_name.is_null() {
|
||||
let backend_string = CStr::from_ptr(backend_name).to_owned();
|
||||
|
|
|
@ -16,7 +16,7 @@ use audioipc::{ipccore, rpccore, sys, PlatformHandle};
|
|||
use cubeb::InputProcessingParams;
|
||||
use cubeb_core as cubeb;
|
||||
use cubeb_core::ffi;
|
||||
use std::convert::{From, TryInto};
|
||||
use std::convert::TryInto;
|
||||
use std::ffi::CStr;
|
||||
use std::mem::size_of;
|
||||
use std::os::raw::{c_long, c_void};
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"files":{"Cargo.toml":"4cdefda1488b3ec6e65d11f02d228b1ccd5e190a802d792e524df99450de4832","benches/serialization.rs":"d56855d868dab6aa22c8b03a61084535351b76c94b68d8b1d20764e352fe473f","build.rs":"65df9a97c6cdaa3faf72581f04ac289197b0b1797d69d22c1796e957ff1089e2","src/codec.rs":"38408b512d935cd7889a03b25dd14b36083ec4e6d2fcabd636182cf45e3d50bc","src/errors.rs":"67a4a994d0724397657581cde153bdfc05ce86e7efc467f23fafc8f64df80fa4","src/ipccore.rs":"db73e916468c54d3497d75ffcab3bf23067771ed7b2e1a23c714429f56f59ec3","src/lib.rs":"a6fcac8b44318435db60313d3ef32ff3fada390bea8978c8414c40744998b98b","src/messages.rs":"f1d5568c3095ee9f557412c2f4c217abfa5696a5035e4f7cb2dbc8cce700f1c4","src/rpccore.rs":"025b6614f1c42b96b0a8e74fd7881032d338c66e0d67ec0af70f910a9e30ebe1","src/shm.rs":"c00d16f4af510d12e704ae865f7348ad64ddef180e42b18e7dd95c4be35a9c80","src/sys/mod.rs":"e6fa1d260abf093e1f7b50185195e2d3aee0eb8c9774c6f253953b5896d838f3","src/sys/unix/cmsg.rs":"6f0236bf6cd66ccd237b268348a826ae1d266073c2adadcfaae703c556230065","src/sys/unix/cmsghdr.c":"d7344b3dc15cdce410c68669b848bb81f7fe36362cd3699668cb613fa05180f8","src/sys/unix/mod.rs":"59835f0d5509940078b1820a54f49fc5514adeb3e45e7d21e3ab917431da2e74","src/sys/unix/msg.rs":"0e297d73bae9414184f85c2209cca0a3fde6d999a3f1d3f42faa3f56b6d57233","src/sys/windows/mod.rs":"7eaabb76e62c6962b636320e2bbf79a78fce61659c799a798f7dd6d56b0be8a1"},"package":null}
|
||||
{"files":{"Cargo.toml":"dff67ba050be15275d357b7f001df6caa6ae1f93b2acd61ac7d6ee269a1f5960","benches/serialization.rs":"d56855d868dab6aa22c8b03a61084535351b76c94b68d8b1d20764e352fe473f","build.rs":"65df9a97c6cdaa3faf72581f04ac289197b0b1797d69d22c1796e957ff1089e2","src/codec.rs":"86068272e220696d8d7e369072326349e7598e5a24223d98179c3251bb7b3ff1","src/errors.rs":"67a4a994d0724397657581cde153bdfc05ce86e7efc467f23fafc8f64df80fa4","src/ipccore.rs":"db73e916468c54d3497d75ffcab3bf23067771ed7b2e1a23c714429f56f59ec3","src/lib.rs":"a6fcac8b44318435db60313d3ef32ff3fada390bea8978c8414c40744998b98b","src/messages.rs":"d4f6d4f41b7fd3cc7deae726657e1100f315f4cd10c5fe6ce8a57c03c8e26ca9","src/rpccore.rs":"025b6614f1c42b96b0a8e74fd7881032d338c66e0d67ec0af70f910a9e30ebe1","src/shm.rs":"c00d16f4af510d12e704ae865f7348ad64ddef180e42b18e7dd95c4be35a9c80","src/sys/mod.rs":"e6fa1d260abf093e1f7b50185195e2d3aee0eb8c9774c6f253953b5896d838f3","src/sys/unix/cmsg.rs":"9529e8f8429db86f7c5df132953d3054e603852270f3c6938cdb5f630b2711f1","src/sys/unix/cmsghdr.c":"d7344b3dc15cdce410c68669b848bb81f7fe36362cd3699668cb613fa05180f8","src/sys/unix/mod.rs":"59835f0d5509940078b1820a54f49fc5514adeb3e45e7d21e3ab917431da2e74","src/sys/unix/msg.rs":"0e297d73bae9414184f85c2209cca0a3fde6d999a3f1d3f42faa3f56b6d57233","src/sys/windows/mod.rs":"7eaabb76e62c6962b636320e2bbf79a78fce61659c799a798f7dd6d56b0be8a1"},"package":null}
|
|
@ -63,7 +63,7 @@ cc = "1.0"
|
|||
ashmem = "0.1.2"
|
||||
|
||||
[target."cfg(target_os = \"linux\")".dependencies.audio_thread_priority]
|
||||
version = "0.31"
|
||||
version = "0.32"
|
||||
default-features = false
|
||||
|
||||
[target."cfg(unix)".dependencies]
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// This should be fixed in Rust 1.68, after which the following `allow` can be deleted.
|
||||
#![allow(clippy::uninlined_format_args)]
|
||||
|
||||
use bincode::{self, Options};
|
||||
use bincode::Options;
|
||||
use byteorder::{ByteOrder, LittleEndian};
|
||||
use bytes::{Buf, BufMut, BytesMut};
|
||||
use serde::de::DeserializeOwned;
|
||||
|
|
|
@ -8,7 +8,7 @@ use crate::PlatformHandleType;
|
|||
use crate::INVALID_HANDLE_VALUE;
|
||||
#[cfg(target_os = "linux")]
|
||||
use audio_thread_priority::RtPriorityThreadInfo;
|
||||
use cubeb::{self, ffi};
|
||||
use cubeb::ffi;
|
||||
use serde_derive::Deserialize;
|
||||
use serde_derive::Serialize;
|
||||
use std::ffi::{CStr, CString};
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
use crate::sys::HANDLE_QUEUE_LIMIT;
|
||||
use bytes::{BufMut, BytesMut};
|
||||
use libc::{self, cmsghdr};
|
||||
use libc::cmsghdr;
|
||||
use std::convert::TryInto;
|
||||
use std::os::unix::io::RawFd;
|
||||
use std::{mem, slice};
|
||||
|
|
|
@ -25,8 +25,8 @@ webrender_bindings = { path = "../../../../gfx/webrender_bindings" }
|
|||
cubeb-coreaudio = { git = "https://github.com/mozilla/cubeb-coreaudio-rs", rev = "d23ab55eab684b46f46e1da177c8814f6103a009", optional = true }
|
||||
cubeb-pulse = { git = "https://github.com/mozilla/cubeb-pulse-rs", rev="8ff972c8e2ec1782ff262ac4071c0415e69b1367", optional = true, features=["pulse-dlopen"] }
|
||||
cubeb-sys = { version = "0.12.0", optional = true, features=["gecko-in-tree"] }
|
||||
audioipc2-client = { git = "https://github.com/mozilla/audioipc", rev = "596bdb7fbb5745ea415726e16bd497e6c850a540", optional = true }
|
||||
audioipc2-server = { git = "https://github.com/mozilla/audioipc", rev = "596bdb7fbb5745ea415726e16bd497e6c850a540", optional = true }
|
||||
audioipc2-client = { git = "https://github.com/mozilla/audioipc", rev = "409e11f8de6288e9ddfe269654523735302e59e6", optional = true }
|
||||
audioipc2-server = { git = "https://github.com/mozilla/audioipc", rev = "409e11f8de6288e9ddfe269654523735302e59e6", optional = true }
|
||||
encoding_glue = { path = "../../../../intl/encoding_glue" }
|
||||
authrs_bridge = { path = "../../../../dom/webauthn/authrs_bridge" }
|
||||
gkrust_utils = { path = "../../../../xpcom/rust/gkrust_utils" }
|
||||
|
@ -44,7 +44,7 @@ bitsdownload = { path = "../../../components/bitsdownload", optional = true }
|
|||
storage = { path = "../../../../storage/rust" }
|
||||
bookmark_sync = { path = "../../../components/places/bookmark_sync", optional = true }
|
||||
chardetng_c = "0.1.1"
|
||||
audio_thread_priority = { version = "0.31", default_features = false }
|
||||
audio_thread_priority = { version = "0.32", default_features = false }
|
||||
mdns_service = { path="../../../../dom/media/webrtc/transport/mdns_service", optional = true }
|
||||
neqo_glue = { path = "../../../../netwerk/socket/neqo_glue" }
|
||||
wgpu_bindings = { path = "../../../../gfx/wgpu_bindings" }
|
||||
|
|
Загрузка…
Ссылка в новой задаче