Skip to content

Commit

Permalink
Bug 1789547 - Update cubeb-pulse to 0.10.1 r=cubeb-reviewers,kinetik
Browse files Browse the repository at this point in the history
Depends on D156632

Differential Revision: https://phabricator.services.mozilla.com/D156633
  • Loading branch information
ashleyz committed Sep 11, 2022
1 parent d304d6d commit abade63
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ rev = "e1b4dcb767f9e69afe95a860374aaa9635d81e3d"
[source."https://github.com/mozilla/cubeb-pulse-rs"]
git = "https://github.com/mozilla/cubeb-pulse-rs"
replace-with = "vendored-sources"
rev = "1f1fe1e08e01a9a534ec7f079702a583a0899ce7"
rev = "f32b3ef708c0bfb2c414c08971d638527353d376"

[source."https://github.com/mozilla/cubeb-coreaudio-rs"]
git = "https://github.com/mozilla/cubeb-coreaudio-rs"
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion third_party/rust/cubeb-pulse/.cargo-checksum.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"files":{".editorconfig":"bf047bd1da10cabb99eea666d1e57c321eba4716dccb3e4ed0e2c5fe3ca53858",".github/workflows/build.yml":"95d0d2542c04f0c932f58591b92c3051db5c95657bf5f24b6a6110f7b667568d","AUTHORS":"0e0ac930a68ce2f6b876126b195add177f0d3886facb9260f4d9b69f1988f0cc","Cargo.toml":"13fe95ad27f37b8423958d78093ecff3ade9fffb28c5980604b624c2b617e5a7","LICENSE":"44c6b5ae5ec3fe2fbc608b00e6f4896f4d2d5c7e525fcbaa3eaa3cf2f3d5a983","README.md":"0079450bb4b013bac065ed1750851e461a3710ebad1f323817da1cb82db0bc4f","src/backend/context.rs":"839fbbd90e501c9e455e6b46729f8c3cc03b368b6b45d02c82399660b7cf8289","src/backend/cork_state.rs":"4a0f1afc7d9f333dac89218cc56d7d32fbffb487cd48c1c9a4e03d79cb3b5e28","src/backend/intern.rs":"11ca424e4eb77f8eb9fd5a6717d1e791facf9743156a8534f0016fcf64d57b0f","src/backend/mod.rs":"d5da05348bf1a7f65c85b14372964a49dc4849f0aee96c75e2c18b51fb03fcaf","src/backend/stream.rs":"e88a04ab7094b9df1bcdd07628369ec70ecb2062b91b0bd86f2642962814405c","src/capi.rs":"fa0fa020f0d0efe55aa0fc3596405e8407bbe2cbe6c7a558345304e6da87994e","src/lib.rs":"b41bbdc562cbfb130ed7c1e53fe69944774f515705341d8ce48a2f82c8c0c2c5"},"package":null}
{"files":{".editorconfig":"bf047bd1da10cabb99eea666d1e57c321eba4716dccb3e4ed0e2c5fe3ca53858",".github/workflows/build.yml":"95d0d2542c04f0c932f58591b92c3051db5c95657bf5f24b6a6110f7b667568d","AUTHORS":"0e0ac930a68ce2f6b876126b195add177f0d3886facb9260f4d9b69f1988f0cc","Cargo.toml":"b7e94a87ad51a63a6b9e4f623aa22881467aca5a0fe68531283d1e18538ec1fb","LICENSE":"44c6b5ae5ec3fe2fbc608b00e6f4896f4d2d5c7e525fcbaa3eaa3cf2f3d5a983","README.md":"0079450bb4b013bac065ed1750851e461a3710ebad1f323817da1cb82db0bc4f","src/backend/context.rs":"55799e094a0b2380d468996217707272ddc3b780404c0fa9ba45091930785e84","src/backend/cork_state.rs":"4a0f1afc7d9f333dac89218cc56d7d32fbffb487cd48c1c9a4e03d79cb3b5e28","src/backend/intern.rs":"11ca424e4eb77f8eb9fd5a6717d1e791facf9743156a8534f0016fcf64d57b0f","src/backend/mod.rs":"d5da05348bf1a7f65c85b14372964a49dc4849f0aee96c75e2c18b51fb03fcaf","src/backend/stream.rs":"6ad691eb4d11bda5e391f13ab86506cbdfbd10719c88e7ef655d171a55442166","src/capi.rs":"fa0fa020f0d0efe55aa0fc3596405e8407bbe2cbe6c7a558345304e6da87994e","src/lib.rs":"b41bbdc562cbfb130ed7c1e53fe69944774f515705341d8ce48a2f82c8c0c2c5"},"package":null}
2 changes: 1 addition & 1 deletion third_party/rust/cubeb-pulse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pulse-dlopen = ["pulse-ffi/dlopen"]
crate-type = ["staticlib", "rlib"]

[dependencies]
cubeb-backend = "0.10"
cubeb-backend = "0.10.1"
pulse-ffi = { path = "pulse-ffi" }
pulse = { path = "pulse-rs" }
semver = "1.0"
Expand Down
8 changes: 4 additions & 4 deletions third_party/rust/cubeb-pulse/src/backend/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ impl ContextOps for PulseContext {
user_data: *mut c_void,
) {
let list_data = unsafe { &mut *(user_data as *mut PulseDevListData) };
let ctx = &(*list_data.context);
let ctx = list_data.context;

if eol != 0 {
ctx.mainloop.signal();
Expand Down Expand Up @@ -366,7 +366,7 @@ impl ContextOps for PulseContext {
user_data: *mut c_void,
) {
let list_data = unsafe { &mut *(user_data as *mut PulseDevListData) };
let ctx = &(*list_data.context);
let ctx = list_data.context;

if eol != 0 {
ctx.mainloop.signal();
Expand Down Expand Up @@ -437,7 +437,7 @@ impl ContextOps for PulseContext {
.unwrap_or_default();
}

(*list_data.context).mainloop.signal();
list_data.context.mainloop.signal();
}

let mut user_data = PulseDevListData::new(self);
Expand Down Expand Up @@ -524,7 +524,7 @@ impl ContextOps for PulseContext {
user_ptr: *mut c_void,
) -> Result<Stream> {
if self.error {
let _ = self.context_init()?;
self.context_init()?;
}

let stm = PulseStream::new(
Expand Down
24 changes: 12 additions & 12 deletions third_party/rust/cubeb-pulse/src/backend/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ impl<'ctx> PulseStream<'ctx> {
readable_size
}

cubeb_logv!("Input callback buffer size {}", nbytes);
cubeb_alogv!("Input callback buffer size {}", nbytes);
let stm = unsafe { &mut *(u as *mut PulseStream) };
if stm.shutdown {
return;
Expand Down Expand Up @@ -380,7 +380,7 @@ impl<'ctx> PulseStream<'ctx> {
}

fn write_data(_: &pulse::Stream, nbytes: usize, u: *mut c_void) {
cubeb_logv!("Output callback to be written buffer size {}", nbytes);
cubeb_alogv!("Output callback to be written buffer size {}", nbytes);
let stm = unsafe { &mut *(u as *mut PulseStream) };
if stm.shutdown || stm.state != ffi::CUBEB_STATE_STARTED {
return;
Expand All @@ -400,7 +400,7 @@ impl<'ctx> PulseStream<'ctx> {
let popped_frames = buffered_input_frames - nframes;
input_buffer_manager
.trim(nframes * stm.input_sample_spec.channels as usize);
cubeb_log!("Dropping {} frames in input buffer.", popped_frames);
cubeb_alog!("Dropping {} frames in input buffer.", popped_frames);
}
}

Expand Down Expand Up @@ -552,7 +552,7 @@ impl<'ctx> PulseStream<'ctx> {
if log_enabled() {
if let Some(ref output_stream) = stm.output_stream {
let output_att = output_stream.get_buffer_attr();
cubeb_log!(
cubeb_alog!(
"Output buffer attributes maxlength {}, tlength {}, \
prebuf {}, minreq {}, fragsize {}",
output_att.maxlength,
Expand All @@ -565,7 +565,7 @@ impl<'ctx> PulseStream<'ctx> {

if let Some(ref input_stream) = stm.input_stream {
let input_att = input_stream.get_buffer_attr();
cubeb_log!(
cubeb_alog!(
"Input buffer attributes maxlength {}, tlength {}, \
prebuf {}, minreq {}, fragsize {}",
input_att.maxlength,
Expand Down Expand Up @@ -650,11 +650,11 @@ impl<'ctx> StreamOps for PulseStream<'ctx> {
self.context.mainloop.lock();
self.shutdown = true;
// If draining is taking place wait to finish
cubeb_log!("Stream stop: waiting for drain");
cubeb_alog!("Stream stop: waiting for drain");
while !self.drain_timer.load(Ordering::Acquire).is_null() {
self.context.mainloop.wait();
}
cubeb_log!("Stream stop: waited for drain");
cubeb_alog!("Stream stop: waited for drain");
self.context.mainloop.unlock();
}
self.cork(CorkState::cork() | CorkState::notify());
Expand Down Expand Up @@ -1025,15 +1025,15 @@ impl<'ctx> PulseStream<'ctx> {
true
}

#[cfg_attr(feature = "cargo-clippy", allow(cyclomatic_complexity))]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cognitive_complexity))]
fn trigger_user_callback(&mut self, input_data: *const c_void, nbytes: usize) {
fn drained_cb(
a: &pulse::MainloopApi,
e: *mut pa_time_event,
_tv: &pulse::TimeVal,
u: *mut c_void,
) {
cubeb_logv!("Drain finished callback.");
cubeb_alogv!("Drain finished callback.");
let stm = unsafe { &mut *(u as *mut PulseStream) };
let drain_timer = stm.drain_timer.load(Ordering::Acquire);
debug_assert_eq!(drain_timer, e);
Expand All @@ -1060,7 +1060,7 @@ impl<'ctx> PulseStream<'ctx> {
debug_assert!(size > 0);
debug_assert_eq!(size % frame_size, 0);

cubeb_logv!(
cubeb_alogv!(
"Trigger user callback with output buffer size={}, read_offset={}",
size,
read_offset
Expand Down Expand Up @@ -1135,7 +1135,7 @@ impl<'ctx> PulseStream<'ctx> {
got += (padding_bytes / frame_size) as i64;
}
} else {
cubeb_logv!(
cubeb_alogv!(
"Not enough room to pad up to prebuf when prebuffering."
)
}
Expand All @@ -1149,7 +1149,7 @@ impl<'ctx> PulseStream<'ctx> {
);

if should_drain {
cubeb_logv!("Draining {} < {}", got, size / frame_size);
cubeb_alogv!("Draining {} < {}", got, size / frame_size);
let latency = match stm.get_latency() {
Ok(StreamLatency::Positive(l)) => l,
Ok(_) => {
Expand Down
2 changes: 1 addition & 1 deletion toolkit/library/rust/shared/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ profiler_helper = { path = "../../../../tools/profiler/rust-helper", optional =
mozurl = { path = "../../../../netwerk/base/mozurl" }
webrender_bindings = { path = "../../../../gfx/webrender_bindings" }
cubeb-coreaudio = { git = "https://github.com/mozilla/cubeb-coreaudio-rs", rev = "ab933e7cbd569f79b37b540412a7990a5352dd66", optional = true }
cubeb-pulse = { git = "https://github.com/mozilla/cubeb-pulse-rs", rev="1f1fe1e08e01a9a534ec7f079702a583a0899ce7", optional = true, features=["pulse-dlopen"] }
cubeb-pulse = { git = "https://github.com/mozilla/cubeb-pulse-rs", rev="f32b3ef708c0bfb2c414c08971d638527353d376", optional = true, features=["pulse-dlopen"] }
cubeb-sys = { version = "0.10.1", optional = true, features=["gecko-in-tree"] }
audioipc2-client = { git = "https://github.com/kinetiknz/audioipc-2", rev = "ea7cabf8c9dc051a52ffb6cd7d2564b29b7428eb", optional = true } # macos (v2) branch
audioipc2-server = { git = "https://github.com/kinetiknz/audioipc-2", rev = "ea7cabf8c9dc051a52ffb6cd7d2564b29b7428eb", optional = true } # macos (v2) branch
Expand Down

0 comments on commit abade63

Please sign in to comment.