Backed out 4 changesets (bug 1789547) for causing build bustages in src/cubeb_pulse.c CLOSED TREE

Backed out changeset f4a705068a81 (bug 1789547)
Backed out changeset 2e0a33171e43 (bug 1789547)
Backed out changeset 3d81b7118d30 (bug 1789547)
Backed out changeset f5ad9813b7b7 (bug 1789547)
This commit is contained in:
Sandor Molnar 2022-09-10 01:38:23 +03:00
Родитель ef5c6dc559
Коммит ca9f2118a3
47 изменённых файлов: 220 добавлений и 362 удалений

Просмотреть файл

@ -35,12 +35,12 @@ rev = "e1b4dcb767f9e69afe95a860374aaa9635d81e3d"
[source."https://github.com/mozilla/cubeb-pulse-rs"]
git = "https://github.com/mozilla/cubeb-pulse-rs"
replace-with = "vendored-sources"
rev = "f32b3ef708c0bfb2c414c08971d638527353d376"
rev = "1f1fe1e08e01a9a534ec7f079702a583a0899ce7"
[source."https://github.com/mozilla/cubeb-coreaudio-rs"]
git = "https://github.com/mozilla/cubeb-coreaudio-rs"
replace-with = "vendored-sources"
rev = "ab933e7cbd569f79b37b540412a7990a5352dd66"
rev = "44eca95823bb57e964cf7b6d9791ed2ccb4b2108"
[source."https://github.com/mozilla/audioipc"]
git = "https://github.com/mozilla/audioipc"

26
Cargo.lock сгенерированный
Просмотреть файл

@ -900,7 +900,7 @@ dependencies = [
[[package]]
name = "coreaudio-sys-utils"
version = "0.1.0"
source = "git+https://github.com/mozilla/cubeb-coreaudio-rs?rev=ab933e7cbd569f79b37b540412a7990a5352dd66#ab933e7cbd569f79b37b540412a7990a5352dd66"
source = "git+https://github.com/mozilla/cubeb-coreaudio-rs?rev=44eca95823bb57e964cf7b6d9791ed2ccb4b2108#44eca95823bb57e964cf7b6d9791ed2ccb4b2108"
dependencies = [
"core-foundation-sys",
"coreaudio-sys",
@ -1117,27 +1117,27 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"
[[package]]
name = "cubeb"
version = "0.10.1"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53051f86ed8cf5a6771704e80147266f32bdf05cc09089da304484a1c612bb97"
checksum = "d47c8cc00b8034e996d7dd262956a0d904c1e1d0d521d22c99801420b38484bd"
dependencies = [
"cubeb-core",
]
[[package]]
name = "cubeb-backend"
version = "0.10.1"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ce2d65b509a33ff97b83439dd1df5f50b8253cb14aa5c55794df37a28846724"
checksum = "e3d1cd779dd013686571104bbc98f2bcde1e732764b8ad394efaea86b064227d"
dependencies = [
"cubeb-core",
]
[[package]]
name = "cubeb-core"
version = "0.10.1"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48c0ac573dc2e393c12e4b829d6e17bbb7a1f95b288043ee47ef251097ddb094"
checksum = "04aabcd7fa088330b5f25b2f92cd1c2d80d0232e114e5bdaa682bb65103d57d9"
dependencies = [
"bitflags",
"cubeb-sys",
@ -1146,7 +1146,7 @@ dependencies = [
[[package]]
name = "cubeb-coreaudio"
version = "0.1.0"
source = "git+https://github.com/mozilla/cubeb-coreaudio-rs?rev=ab933e7cbd569f79b37b540412a7990a5352dd66#ab933e7cbd569f79b37b540412a7990a5352dd66"
source = "git+https://github.com/mozilla/cubeb-coreaudio-rs?rev=44eca95823bb57e964cf7b6d9791ed2ccb4b2108#44eca95823bb57e964cf7b6d9791ed2ccb4b2108"
dependencies = [
"atomic",
"audio-mixer",
@ -1164,7 +1164,7 @@ dependencies = [
[[package]]
name = "cubeb-pulse"
version = "0.4.0"
source = "git+https://github.com/mozilla/cubeb-pulse-rs?rev=f32b3ef708c0bfb2c414c08971d638527353d376#f32b3ef708c0bfb2c414c08971d638527353d376"
source = "git+https://github.com/mozilla/cubeb-pulse-rs?rev=1f1fe1e08e01a9a534ec7f079702a583a0899ce7#1f1fe1e08e01a9a534ec7f079702a583a0899ce7"
dependencies = [
"cubeb-backend",
"pulse",
@ -1175,9 +1175,9 @@ dependencies = [
[[package]]
name = "cubeb-sys"
version = "0.10.1"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33b49428acff552b1ba790649ea16a6f3d60cf74e9457a1378771a1acc12d5ee"
checksum = "da8f61339785526e9488f4902ef09d83483fa7fc2c6f6f6f80bb8ae04af03818"
dependencies = [
"cmake",
"pkg-config",
@ -4225,7 +4225,7 @@ dependencies = [
[[package]]
name = "pulse"
version = "0.3.0"
source = "git+https://github.com/mozilla/cubeb-pulse-rs?rev=f32b3ef708c0bfb2c414c08971d638527353d376#f32b3ef708c0bfb2c414c08971d638527353d376"
source = "git+https://github.com/mozilla/cubeb-pulse-rs?rev=1f1fe1e08e01a9a534ec7f079702a583a0899ce7#1f1fe1e08e01a9a534ec7f079702a583a0899ce7"
dependencies = [
"bitflags",
"pulse-ffi",
@ -4234,7 +4234,7 @@ dependencies = [
[[package]]
name = "pulse-ffi"
version = "0.1.0"
source = "git+https://github.com/mozilla/cubeb-pulse-rs?rev=f32b3ef708c0bfb2c414c08971d638527353d376#f32b3ef708c0bfb2c414c08971d638527353d376"
source = "git+https://github.com/mozilla/cubeb-pulse-rs?rev=1f1fe1e08e01a9a534ec7f079702a583a0899ce7#1f1fe1e08e01a9a534ec7f079702a583a0899ce7"
dependencies = [
"libc",
]

Просмотреть файл

@ -9,8 +9,8 @@ origin:
description: "Cross platform audio library"
url: https://github.com/mozilla/cubeb
license: ISC
release: 4783607ecc09e9493677a9c4e3db95f78d87409a (2022-09-06T12:38:56Z).
revision: 4783607ecc09e9493677a9c4e3db95f78d87409a
release: commit 708f52cccffe69ed1d65b52903237c990db860a9 (2022-04-13T15:02:09Z).
revision: 708f52cccffe69ed1d65b52903237c990db860a9
vendoring:
url: https://github.com/mozilla/cubeb

Просмотреть файл

@ -463,11 +463,10 @@ aaudio_destroy(cubeb * ctx)
if (ctx->state.notifier.joinable()) {
ctx->state.notifier.join();
}
#ifndef DISABLE_LIBAAUDIO_DLOPEN
if (ctx->libaaudio) {
dlclose(ctx->libaaudio);
}
#endif
delete ctx;
}

Просмотреть файл

@ -957,11 +957,11 @@ alsa_destroy(cubeb * ctx)
WRAP(snd_config_delete)(ctx->local_config);
pthread_mutex_unlock(&cubeb_alsa_mutex);
}
#ifndef DISABLE_LIBASOUND_DLOPEN
if (ctx->libasound) {
dlclose(ctx->libasound);
}
#endif
free(ctx);
}

Просмотреть файл

@ -788,10 +788,10 @@ cbjack_destroy(cubeb * context)
if (context->jack_client != NULL)
WRAP(jack_client_close)(context->jack_client);
#ifndef DISABLE_LIBJACK_DLOPEN
if (context->libjack)
dlclose(context->libjack);
#endif
free(context);
}

Просмотреть файл

@ -8,7 +8,6 @@
#include "cubeb_log.h"
#include "cubeb_ringbuffer.h"
#include "cubeb_tracing.h"
#include <cstdarg>
#ifdef _WIN32
#include <windows.h>
@ -70,11 +69,10 @@ public:
void run()
{
std::thread([this]() {
CUBEB_REGISTER_THREAD("cubeb_log");
while (true) {
cubeb_log_message msg;
while (msg_queue.dequeue(&msg, 1)) {
LOG_INTERNAL_NO_FORMAT(CUBEB_LOG_NORMAL, "%s", msg.get());
LOGV("%s", msg.get());
}
#ifdef _WIN32
Sleep(CUBEB_LOG_BATCH_PRINT_INTERVAL_MS);
@ -89,7 +87,6 @@ public:
} while (remainder.tv_sec || remainder.tv_nsec);
#endif
}
CUBEB_UNREGISTER_THREAD();
}).detach();
}
// Tell the underlying queue the producer thread has changed, so it does not
@ -126,7 +123,7 @@ cubeb_async_log(char const * fmt, ...)
}
void
cubeb_async_log_reset_threads(void)
cubeb_async_log_reset_threads()
{
if (!g_cubeb_log_callback) {
return;

Просмотреть файл

@ -35,7 +35,7 @@ extern cubeb_log_callback g_cubeb_log_callback PRINTF_FORMAT(1, 2);
void
cubeb_async_log(const char * fmt, ...);
void
cubeb_async_log_reset_threads(void);
cubeb_async_log_reset_threads();
#ifdef __cplusplus
}
@ -44,13 +44,6 @@ cubeb_async_log_reset_threads(void);
#define LOGV(msg, ...) LOG_INTERNAL(CUBEB_LOG_VERBOSE, msg, ##__VA_ARGS__)
#define LOG(msg, ...) LOG_INTERNAL(CUBEB_LOG_NORMAL, msg, ##__VA_ARGS__)
#define LOG_INTERNAL_NO_FORMAT(level, fmt, ...) \
do { \
if (g_cubeb_log_callback && level <= g_cubeb_log_level) { \
g_cubeb_log_callback(fmt, __VA_ARGS__); \
} \
} while (0)
#define LOG_INTERNAL(level, fmt, ...) \
do { \
if (g_cubeb_log_callback && level <= g_cubeb_log_level) { \
@ -59,16 +52,11 @@ cubeb_async_log_reset_threads(void);
} \
} while (0)
#define ALOG_INTERNAL(level, fmt, ...) \
/* Asynchronous verbose logging, to log in real-time callbacks. */
/* Should not be used on android due to the use of global/static variables. */
#define ALOGV(fmt, ...) \
do { \
if (level <= g_cubeb_log_level) { \
cubeb_async_log(fmt, ##__VA_ARGS__); \
} \
cubeb_async_log(fmt, ##__VA_ARGS__); \
} while (0)
/* Asynchronous logging macros to log in real-time callbacks. */
/* Should not be used on android due to the use of global/static variables. */
#define ALOGV(msg, ...) ALOG_INTERNAL(CUBEB_LOG_VERBOSE, msg, ##__VA_ARGS__)
#define ALOG(msg, ...) ALOG_INTERNAL(CUBEB_LOG_NORMAL, msg, ##__VA_ARGS__)
#endif // CUBEB_LOG

Просмотреть файл

@ -91,7 +91,6 @@ public:
uint32_t to_keep = min_buffered_audio_frame(sample_rate);
uint32_t available = samples_to_frames(internal_input_buffer.length());
if (available > to_keep) {
ALOGV("Dropping %u frames", available - to_keep);
internal_input_buffer.pop(nullptr,
frames_to_samples(available - to_keep));
}
@ -326,7 +325,6 @@ public:
uint32_t available = samples_to_frames(resampling_in_buffer.length());
uint32_t to_keep = min_buffered_audio_frame(source_rate);
if (available > to_keep) {
ALOGV("Dropping %u frames", available - to_keep);
resampling_in_buffer.pop(nullptr, frames_to_samples(available - to_keep));
}
}
@ -472,7 +470,6 @@ public:
size_t available = samples_to_frames(delay_input_buffer.length());
uint32_t to_keep = min_buffered_audio_frame(sample_rate);
if (available > to_keep) {
ALOGV("Dropping %u frames", available - to_keep);
delay_input_buffer.pop(nullptr, frames_to_samples(available - to_keep));
}
}

Просмотреть файл

@ -110,8 +110,8 @@ public:
assert_correct_thread(producer_id);
#endif
int rd_idx = read_index_.load(std::memory_order_relaxed);
int wr_idx = write_index_.load(std::memory_order_relaxed);
int rd_idx = read_index_.load(std::memory_order_acquire);
if (full_internal(rd_idx, wr_idx)) {
return 0;
@ -154,8 +154,8 @@ public:
assert_correct_thread(consumer_id);
#endif
int rd_idx = read_index_.load(std::memory_order_relaxed);
int wr_idx = write_index_.load(std::memory_order_acquire);
int rd_idx = read_index_.load(std::memory_order_relaxed);
if (empty_internal(rd_idx, wr_idx)) {
return 0;
@ -172,7 +172,7 @@ public:
}
read_index_.store(increment_index(rd_idx, to_read),
std::memory_order_release);
std::memory_order_relaxed);
return to_read;
}
@ -190,7 +190,7 @@ public:
#endif
return available_read_internal(
read_index_.load(std::memory_order_relaxed),
write_index_.load(std::memory_order_acquire));
write_index_.load(std::memory_order_relaxed));
}
/**
* Get the number of available elements for consuming.
@ -205,7 +205,7 @@ public:
assert_correct_thread(producer_id);
#endif
return available_write_internal(
read_index_.load(std::memory_order_acquire),
read_index_.load(std::memory_order_relaxed),
write_index_.load(std::memory_order_relaxed));
}
/**

Просмотреть файл

@ -362,10 +362,8 @@ static void
sndio_destroy(cubeb * context)
{
DPR("sndio_destroy()\n");
#ifndef DISABLE_LIBSNDIO_DLOPEN
if (context->libsndio)
dlclose(context->libsndio);
#endif
free(context);
}

Просмотреть файл

@ -1,23 +0,0 @@
/*
* Copyright © 2022 Mozilla Foundation
*
* This program is made available under an ISC-style license. See the
* accompanying file LICENSE for details.
*/
#ifndef CUBEB_TRACING_H
#define CUBEB_TRACING_H
/* Empty header to allow hooking up a frame profiler. */
// To be called once on a thread to register for tracing.
#define CUBEB_REGISTER_THREAD(name)
// To be called once before a registered threads exits.
#define CUBEB_UNREGISTER_THREAD()
// Insert a tracing marker, with a particular name.
// Phase can be 'x': instant marker, start time but no duration
// 'b': beginning of a marker with a duration
// 'e': end of a marker with a duration
#define CUBEB_TRACE(name, phase)
#endif // CUBEB_TRACING_H

Просмотреть файл

@ -225,38 +225,6 @@ which is statically guaranteed to be safe. Inputs to the macro have to be
static so there's no uncontrolled input whatsoever.
"""
[[audits.cubeb]]
who = "Matthew Gregan <kinetik@flim.org>"
criteria = "safe-to-deploy"
version = "0.10.1"
notes = """
Mozilla-developed package.
"""
[[audits.cubeb-backend]]
who = "Matthew Gregan <kinetik@flim.org>"
criteria = "safe-to-deploy"
version = "0.10.1"
notes = """
Mozilla-developed package.
"""
[[audits.cubeb-core]]
who = "Matthew Gregan <kinetik@flim.org>"
criteria = "safe-to-deploy"
version = "0.10.1"
notes = """
Mozilla-developed package.
"""
[[audits.cubeb-sys]]
who = "Matthew Gregan <kinetik@flim.org>"
criteria = "safe-to-deploy"
version = "0.10.1"
notes = """
Mozilla-developed package.
"""
[[audits.derive_arbitrary]]
who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-run"

Просмотреть файл

@ -411,6 +411,22 @@ criteria = "safe-to-deploy"
version = "0.1.3"
criteria = "safe-to-deploy"
[[exemptions.cubeb]]
version = "0.10.0"
criteria = "safe-to-deploy"
[[exemptions.cubeb-backend]]
version = "0.10.0"
criteria = "safe-to-deploy"
[[exemptions.cubeb-core]]
version = "0.10.0"
criteria = "safe-to-deploy"
[[exemptions.cubeb-sys]]
version = "0.10.0"
criteria = "safe-to-deploy"
[[exemptions.d3d12]]
version = "0.4.1"
criteria = "safe-to-deploy"

Просмотреть файл

@ -1 +1 @@
{"files":{"Cargo.toml":"e00c08778e781f852e5f23481fe692311fee9ff332e366900064e08077eb8cf1","LICENSE":"8c044baa5d883274736eeece0b955249076c2697b826e576fce59496235b2cf5","src/capi.rs":"edf8a65022d393d0214897986ca49428438b0b32f84e1380c962ecc835290e54","src/lib.rs":"4ce6db20f88487e99057ebeae0615fa1c99e82cfee0ab0825936da2e108fc73e","src/log.rs":"56e4cca1fc1e2bbfb61c61f849f577b2175899139686b1e092e00dba7f6d5273","src/ops.rs":"981866ad12bf07e2f2b887ef9b5810364d2c48101d513879a06a8bf76984dc50","src/traits.rs":"ac35b2124876865b427f0e91026bb1102aadc96f1b763a639c495640cbd92650","tests/test_capi.rs":"27093e582f540c5baf50af5d1e5008c46573792853927b9ecfe62c117bfac303"},"package":"0ce2d65b509a33ff97b83439dd1df5f50b8253cb14aa5c55794df37a28846724"}
{"files":{"Cargo.toml":"76c777e980f3adf5366a019d60683e09f7eb6124130e05c330da7afd3bf702a2","LICENSE":"8c044baa5d883274736eeece0b955249076c2697b826e576fce59496235b2cf5","src/capi.rs":"edf8a65022d393d0214897986ca49428438b0b32f84e1380c962ecc835290e54","src/lib.rs":"94b80747ae1037423a2281f2572fc6d15cd7702417974ae3730adccd71c7a300","src/log.rs":"cf8e3a778f6b72d4cd80c1c56963355aa2224f19fd4fdf07d03f6fb366000899","src/ops.rs":"981866ad12bf07e2f2b887ef9b5810364d2c48101d513879a06a8bf76984dc50","src/traits.rs":"ac35b2124876865b427f0e91026bb1102aadc96f1b763a639c495640cbd92650","tests/test_capi.rs":"3f028589aa4e8cd00469f51451d55c119ec9830df56e248f3ae7e0ddccbbcdd1"},"package":"e3d1cd779dd013686571104bbc98f2bcde1e732764b8ad394efaea86b064227d"}

16
third_party/rust/cubeb-backend/Cargo.toml поставляемый
Просмотреть файл

@ -11,22 +11,18 @@
[package]
name = "cubeb-backend"
version = "0.10.1"
version = "0.10.0"
authors = ["Dan Glastonbury <dglastonbury@mozilla.com>"]
description = """
Bindings to libcubeb internals to facilitate implementing cubeb backends in rust.
"""
homepage = "https://github.com/mozilla/cubeb-rs"
description = "Bindings to libcubeb internals to facilitate implementing cubeb backends in rust.\n"
homepage = "https://github.com/djg/cubeb-rs"
keywords = ["cubeb"]
categories = ["api-bindings"]
license = "ISC"
repository = "https://github.com/mozilla/cubeb-rs"
repository = "https://github.com/djg/cubeb-rs"
[dependencies.cubeb-core]
version = "0.10.1"
version = "0.10.0"
[features]
gecko-in-tree = ["cubeb-core/gecko-in-tree"]
[badges.circle-ci]
repository = "mozilla/cubeb-rs"
repository = "djg/cubeb-rs"

2
third_party/rust/cubeb-backend/src/lib.rs поставляемый
Просмотреть файл

@ -7,7 +7,7 @@ extern crate cubeb_core;
pub mod capi;
#[macro_use]
pub mod log;
mod log;
mod ops;
mod traits;

103
third_party/rust/cubeb-backend/src/log.rs поставляемый
Просмотреть файл

@ -3,98 +3,71 @@
// This program is made available under an ISC-style license. See the
// accompanying file LICENSE for details.
/// Annotates input buffer string with logging information.
/// Returns result as a ffi::CStr for use with native cubeb logging functions.
pub fn cubeb_log_internal_buf_fmt<'a>(
buf: &'a mut [u8; 1024],
file: &str,
line: u32,
msg: &str,
) -> &'a std::ffi::CStr {
use std::io::Write;
let filename = std::path::Path::new(file)
.file_name()
.unwrap()
.to_str()
.unwrap();
// 2 for ':', 1 for ' ', 1 for '\n', and 1 for converting `line!()` to number of digits
let len = filename.len() + ((line as f32).log10().trunc() as usize) + msg.len() + 5;
debug_assert!(len < buf.len(), "log will be truncated");
let _ = writeln!(&mut buf[..], "{}:{}: {}", filename, line, msg);
let last = std::cmp::min(len, buf.len() - 1);
buf[last] = 0;
let cstr = unsafe { std::ffi::CStr::from_bytes_with_nul_unchecked(&buf[..=last]) };
cstr
}
#[macro_export]
macro_rules! cubeb_log_internal {
($log_callback: expr, $level: expr, $fmt: expr, $($arg: expr),+) => {
cubeb_log_internal!($log_callback, $level, format!($fmt, $($arg),*));
};
($log_callback: expr, $level: expr, $msg: expr) => {
($level: expr, $msg: expr) => {
#[allow(unused_unsafe)]
unsafe {
if $level <= $crate::ffi::g_cubeb_log_level.into() {
if let Some(log_callback) = $log_callback {
let mut buf = [0u8; 1024];
log_callback(
$crate::log::cubeb_log_internal_buf_fmt(&mut buf, file!(), line!(), &$msg)
.as_ptr(),
);
}
cubeb_log_internal!(__INTERNAL__ $msg);
}
}
};
}
($level: expr, $fmt: expr, $($arg: expr),+) => {
#[allow(unused_unsafe)]
unsafe {
if $level <= $crate::ffi::g_cubeb_log_level.into() {
cubeb_log_internal!(__INTERNAL__ format!($fmt, $($arg),*));
}
}
};
(__INTERNAL__ $msg: expr) => {
if let Some(log_callback) = $crate::ffi::g_cubeb_log_callback {
use std::io::Write;
#[macro_export]
macro_rules! cubeb_log {
($($arg: expr),+) => (cubeb_log_internal!($crate::ffi::g_cubeb_log_callback, $crate::LogLevel::Normal, $($arg),+));
let mut buf = [0 as u8; 1024];
let filename = std::path::Path::new(file!())
.file_name()
.unwrap()
.to_str()
.unwrap();
// 2 for ':', 1 for ' ', 1 for '\n', and 1 for converting `line!()` to number of digits
let len = filename.len() + ((line!() as f32).log10().trunc() as usize) + $msg.len() + 5;
debug_assert!(len < buf.len(), "log will be truncated");
let _ = write!(&mut buf[..], "{}:{}: {}\n", filename, line!(), $msg);
let last = std::cmp::min(len, buf.len() - 1);
buf[last] = 0;
let cstr = unsafe { std::ffi::CStr::from_bytes_with_nul_unchecked(&buf[..=last]) };
log_callback(cstr.as_ptr());
}
}
}
#[macro_export]
macro_rules! cubeb_logv {
($($arg: expr),+) => (cubeb_log_internal!($crate::ffi::g_cubeb_log_callback, $crate::LogLevel::Verbose, $($arg),+));
($msg: expr) => (cubeb_log_internal!($crate::LogLevel::Verbose, $msg));
($fmt: expr, $($arg: expr),+) => (cubeb_log_internal!($crate::LogLevel::Verbose, $fmt, $($arg),*));
}
#[macro_export]
macro_rules! cubeb_alog {
($($arg: expr),+) => (cubeb_log_internal!($crate::ffi::cubeb_async_log.into(), $crate::LogLevel::Normal, $($arg),+));
}
#[macro_export]
macro_rules! cubeb_alogv {
($($arg: expr),+) => (cubeb_log_internal!($crate::ffi::cubeb_async_log.into(), $crate::LogLevel::Verbose, $($arg),+));
macro_rules! cubeb_log {
($msg: expr) => (cubeb_log_internal!($crate::LogLevel::Normal, $msg));
($fmt: expr, $($arg: expr),+) => (cubeb_log_internal!($crate::LogLevel::Normal, $fmt, $($arg),*));
}
#[cfg(test)]
mod tests {
#[test]
fn test_normal_logging_sync() {
cubeb_log!("This is synchronous log output at normal level");
fn test_normal_logging() {
cubeb_log!("This is log at normal level");
cubeb_log!("{} Formatted log", 1);
cubeb_log!("{} Formatted {} log {}", 1, 2, 3);
}
#[test]
fn test_verbose_logging_sync() {
cubeb_logv!("This is synchronous log output at verbose level");
fn test_verbose_logging() {
cubeb_logv!("This is a log at verbose level");
cubeb_logv!("{} Formatted log", 1);
cubeb_logv!("{} Formatted {} log {}", 1, 2, 3);
}
#[test]
fn test_normal_logging_async() {
cubeb_alog!("This is asynchronous log output at normal level");
cubeb_alog!("{} Formatted log", 1);
cubeb_alog!("{} Formatted {} log {}", 1, 2, 3);
}
#[test]
fn test_verbose_logging_async() {
cubeb_alogv!("This is asynchronous log output at verbose level");
cubeb_alogv!("{} Formatted log", 1);
cubeb_alogv!("{} Formatted {} log {}", 1, 2, 3);
}
}

Просмотреть файл

@ -19,7 +19,6 @@ use std::ptr;
pub const OPS: Ops = capi_new!(TestContext, TestStream);
struct TestContext {
#[allow(dead_code)]
pub ops: *const Ops,
}

Просмотреть файл

@ -1 +1 @@
{"files":{"Cargo.toml":"7b4569f6fffc88f8176064967e26b353db5738c0918dcd0940da47ec1a2fe4a2","LICENSE":"8c044baa5d883274736eeece0b955249076c2697b826e576fce59496235b2cf5","src/builders.rs":"87adbbdd63fde848eeaae4a79a04859ed02ca982fb644f6b8b5fe7c158a8944c","src/call.rs":"cf8949c2cf53f5418d8e5222f570b9301a98a476a18c734fc2ebbc8b53ac0165","src/channel.rs":"676d0cfa733c09ef039ed16138cb78ae6bd10b58d0eb93292e6d8accc69086ff","src/context.rs":"9d7fd770511910e8c416ff47354863f547915ff94fb19ef2dd6796a70c2658cd","src/device.rs":"5fa27f2ba7f108e4ae32ad776b1639b0e8c8ad4c401ce171c512c8126ea5a517","src/device_collection.rs":"f86535ffeee73b889bdbac1c5a3432b01cca86df819a7cc26eaa0c983d30cbbe","src/error.rs":"3693bf575e9504b9b1ab114de3e2ce7132039acf27ec68967dae66c2ce1581aa","src/ffi_types.rs":"71948d0949675df876e18c4340f4e693fc6a14c4de9d63a3885450c95577596b","src/format.rs":"7162c1550be53f5fe94b0bba4c71fea2f0304462108657c62a20ea47207ca413","src/lib.rs":"57ecf793ab1cc052c021ccbf9ad011ea52d1303e2dbc54adea90a95b5d7a36cf","src/log.rs":"c46bae3472043fd076df3229c3421d948a87fae8495c1524b41ab2d8608f612a","src/stream.rs":"d34a66ee11fc3818a9685923c7211b96544cd2bb6b72f5fa4b2727c57d84d929","src/util.rs":"308cfbaacd615ff600e74415c52daeef007fff34a4a0648a73c0042f6067f84f"},"package":"48c0ac573dc2e393c12e4b829d6e17bbb7a1f95b288043ee47ef251097ddb094"}
{"files":{"Cargo.toml":"0bcfe4fb7ffdc555520121b9165b4727b34671e6fdeddfad8da7aa94031d057d","LICENSE":"8c044baa5d883274736eeece0b955249076c2697b826e576fce59496235b2cf5","src/builders.rs":"87adbbdd63fde848eeaae4a79a04859ed02ca982fb644f6b8b5fe7c158a8944c","src/channel.rs":"676d0cfa733c09ef039ed16138cb78ae6bd10b58d0eb93292e6d8accc69086ff","src/context.rs":"a5796ffbced8cc3c48bea8e19c4fabb8b9bd1ff3a7d0ead635ba5b2a27618672","src/device.rs":"5fa27f2ba7f108e4ae32ad776b1639b0e8c8ad4c401ce171c512c8126ea5a517","src/device_collection.rs":"37e4f46fc1ec3c88b71aad94aea1a5b2a1eb85aa9df63d7bcc251638078709a6","src/error.rs":"5e276e3256bec8f042ba9c4dfc6ea96cadd39f905b877261fb48629b779b9c4e","src/ffi_types.rs":"71948d0949675df876e18c4340f4e693fc6a14c4de9d63a3885450c95577596b","src/format.rs":"7162c1550be53f5fe94b0bba4c71fea2f0304462108657c62a20ea47207ca413","src/lib.rs":"6010a5e20b836b8e5c9fba382fde819e6f3c18c0ec2016e6e7e118eabedbcd51","src/log.rs":"c46bae3472043fd076df3229c3421d948a87fae8495c1524b41ab2d8608f612a","src/stream.rs":"c370616448ae972295a272cc7561e0b8fe0c48558e2c1449e5ee7090a32c5564","src/try_call.rs":"4ee0b4bdce7740a78bea76c67d8f6a31e6f8ff615acb05cbe67e00683d1b69a6","src/util.rs":"308cfbaacd615ff600e74415c52daeef007fff34a4a0648a73c0042f6067f84f"},"package":"04aabcd7fa088330b5f25b2f92cd1c2d80d0232e114e5bdaa682bb65103d57d9"}

16
third_party/rust/cubeb-core/Cargo.toml поставляемый
Просмотреть файл

@ -11,25 +11,21 @@
[package]
name = "cubeb-core"
version = "0.10.1"
version = "0.10.0"
authors = ["Dan Glastonbury <dglastonbury@mozilla.com>"]
description = """
Common types and definitions for cubeb rust and C bindings. Not intended for direct use.
"""
homepage = "https://github.com/mozilla/cubeb-rs"
description = "Common types and definitions for cubeb rust and C bindings. Not intended for direct use.\n"
homepage = "https://github.com/djg/cubeb-rs"
keywords = ["cubeb"]
categories = ["api-bindings"]
license = "ISC"
repository = "https://github.com/mozilla/cubeb-rs"
repository = "https://github.com/djg/cubeb-rs"
[dependencies.bitflags]
version = "1.2.0"
[dependencies.cubeb-sys]
version = "0.10.1"
version = "0.10.0"
[features]
gecko-in-tree = ["cubeb-sys/gecko-in-tree"]
[badges.circle-ci]
repository = "mozilla/cubeb-rs"
repository = "djg/cubeb-rs"

26
third_party/rust/cubeb-core/src/context.rs поставляемый
Просмотреть файл

@ -29,7 +29,7 @@ impl Context {
let context_name = as_ptr!(context_name);
let backend_name = as_ptr!(backend_name);
unsafe {
call!(ffi::cubeb_init(&mut context, context_name, backend_name))?;
try_call!(ffi::cubeb_init(&mut context, context_name, backend_name));
Ok(Context::from_ptr(context))
}
}
@ -47,10 +47,10 @@ impl ContextRef {
pub fn max_channel_count(&self) -> Result<u32> {
let mut channel_count = 0u32;
unsafe {
call!(ffi::cubeb_get_max_channel_count(
let _ = try_call!(ffi::cubeb_get_max_channel_count(
self.as_ptr(),
&mut channel_count
))?;
));
}
Ok(channel_count)
}
@ -58,11 +58,11 @@ impl ContextRef {
pub fn min_latency(&self, params: &StreamParamsRef) -> Result<u32> {
let mut latency = 0u32;
unsafe {
call!(ffi::cubeb_get_min_latency(
let _ = try_call!(ffi::cubeb_get_min_latency(
self.as_ptr(),
params.as_ptr(),
&mut latency
))?;
));
}
Ok(latency)
}
@ -70,10 +70,10 @@ impl ContextRef {
pub fn preferred_sample_rate(&self) -> Result<u32> {
let mut rate = 0u32;
unsafe {
call!(ffi::cubeb_get_preferred_sample_rate(
let _ = try_call!(ffi::cubeb_get_preferred_sample_rate(
self.as_ptr(),
&mut rate
))?;
));
}
Ok(rate)
}
@ -101,7 +101,7 @@ impl ContextRef {
let input_stream_params = as_ptr!(input_stream_params);
let output_stream_params = as_ptr!(output_stream_params);
call!(ffi::cubeb_stream_init(
let _ = try_call!(ffi::cubeb_stream_init(
self.as_ptr(),
&mut stm,
stream_name,
@ -113,18 +113,18 @@ impl ContextRef {
data_callback,
state_callback,
user_ptr
))?;
));
Ok(Stream::from_ptr(stm))
}
pub fn enumerate_devices(&self, devtype: DeviceType) -> Result<DeviceCollection> {
let mut coll = ffi::cubeb_device_collection::default();
unsafe {
call!(ffi::cubeb_enumerate_devices(
let _ = try_call!(ffi::cubeb_enumerate_devices(
self.as_ptr(),
devtype.bits(),
&mut coll
))?;
));
}
Ok(DeviceCollection::init_with_ctx(self, coll))
}
@ -139,12 +139,12 @@ impl ContextRef {
callback: ffi::cubeb_device_collection_changed_callback,
user_ptr: *mut c_void,
) -> Result<()> {
call!(ffi::cubeb_register_device_collection_changed(
let _ = try_call!(ffi::cubeb_register_device_collection_changed(
self.as_ptr(),
devtype.bits(),
callback,
user_ptr
))?;
));
Ok(())
}

Просмотреть файл

@ -48,7 +48,7 @@ impl<'ctx> ::std::ops::Deref for DeviceCollection<'ctx> {
impl<'ctx> ::std::convert::AsRef<DeviceCollectionRef> for DeviceCollection<'ctx> {
#[inline]
fn as_ref(&self) -> &DeviceCollectionRef {
self
&**self
}
}

2
third_party/rust/cubeb-core/src/error.rs поставляемый
Просмотреть файл

@ -20,7 +20,7 @@ pub enum ErrorCode {
DeviceUnavailable,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct Error {
code: ErrorCode,
}

2
third_party/rust/cubeb-core/src/lib.rs поставляемый
Просмотреть файл

@ -10,7 +10,7 @@ extern crate cubeb_sys;
#[macro_use]
mod ffi_types;
mod call;
mod try_call;
mod builders;
mod channel;

12
third_party/rust/cubeb-core/src/stream.rs поставляемый
Просмотреть файл

@ -123,7 +123,7 @@ impl StreamRef {
pub fn position(&self) -> Result<u64> {
let mut position = 0u64;
unsafe {
call!(ffi::cubeb_stream_get_position(self.as_ptr(), &mut position))?;
let _ = try_call!(ffi::cubeb_stream_get_position(self.as_ptr(), &mut position));
}
Ok(position)
}
@ -134,7 +134,7 @@ impl StreamRef {
pub fn latency(&self) -> Result<u32> {
let mut latency = 0u32;
unsafe {
call!(ffi::cubeb_stream_get_latency(self.as_ptr(), &mut latency))?;
let _ = try_call!(ffi::cubeb_stream_get_latency(self.as_ptr(), &mut latency));
}
Ok(latency)
}
@ -145,10 +145,10 @@ impl StreamRef {
pub fn input_latency(&self) -> Result<u32> {
let mut latency = 0u32;
unsafe {
call!(ffi::cubeb_stream_get_input_latency(
let _ = try_call!(ffi::cubeb_stream_get_input_latency(
self.as_ptr(),
&mut latency
))?;
));
}
Ok(latency)
}
@ -167,10 +167,10 @@ impl StreamRef {
pub fn current_device(&self) -> Result<&DeviceRef> {
let mut device: *mut ffi::cubeb_device = ptr::null_mut();
unsafe {
call!(ffi::cubeb_stream_get_current_device(
let _ = try_call!(ffi::cubeb_stream_get_current_device(
self.as_ptr(),
&mut device
))?;
));
Ok(DeviceRef::from_ptr(device))
}
}

Просмотреть файл

@ -16,6 +16,12 @@ pub fn cvt_r(ret: c_int) -> Result<(), Error> {
macro_rules! call {
(ffi::$p:ident ($($e:expr),*)) => ({
::call::cvt_r(ffi::$p($($e),*))
::try_call::cvt_r(ffi::$p($($e),*))
})
}
macro_rules! try_call {
(ffi::$p:ident ($($e:expr),*)) => ({
::try_call::cvt_r(ffi::$p($($e),*))?
})
}

Просмотреть файл

@ -1 +1 @@
{"files":{".circleci/config.yml":"7f3dc865105ca8f33965a7958b1fe2e627ae2d5a703f3b2a4ab6e2e796018597",".editorconfig":"4e53b182bcc78b83d7e1b5c03efa14d22d4955c4ed2514d1ba4e99c1eb1a50ba",".githooks/pre-push":"8b8b26544cd56f54c0c33812551f786bb25cb08c86dbfeb6bf3daad881c826a1",".github/workflows/test.yml":"aa1998a3b104ad131805ca3513832cef3f65300192824f8b1efc9a5a0cc108f6",".travis.yml":"dc07bac53f70f16c9bdf52264bdc58500ae6018c1b4c567bc7642f6b4ca3cc35","Cargo.toml":"24d952cc7a852ea8675683d6b4332254eac0d64ba60749d3797381bbf4d32ad9","LICENSE":"6e6f56aff5bbf3cbc60747e152fb1a719bd0716aaf6d711c554f57d92e96297c","README.md":"0007782a05a5330f739ad789c19c82562c82e32386b0447000fc72c0d48405bc","build-audiounit-rust-in-cubeb.sh":"d228a05985dcd02ec1ecac66a2b64dae5a530804a25a7054ccc95905aedfb7ef","install_git_hook.sh":"d38c8e51e636f6b90b489621ac34ccd1d1b1f40dccce3d178ed1da1c5068f16d","install_rustfmt_clippy.sh":"4ae90d8dcb9757cb3ae4ae142ef80e5377c0dde61c63f4a3c32418646e80ca7b","run_device_tests.sh":"cac9a7d588c2be0efa842c15d24c8cf0573bc9f9d73011662ba764dc9f6245e8","run_sanitizers.sh":"8828c73439dfd540cd21fc713c4a1011ec05baca6f282f285743f310ace39563","run_tests.sh":"916a7ae4a406d2274417d6eca939a878db5adcb6144e5680d9d148bf90178f1c","src/backend/aggregate_device.rs":"e822b4496e2ea5c6e1a288c6e92f57e598abf67cb0bdff813f859d57c63be5f9","src/backend/auto_release.rs":"050fdcee74cf46b9a8a85a877e166d72a853d33220f59cf734cbb6ea09daa441","src/backend/buffer_manager.rs":"c32bff1f05c47afc5472d2ebdd321c1186bffcf676ba03751c0962277963ffcc","src/backend/device_property.rs":"2a63837b98b9b6bfb314b4aa6dce919412b71e13e18c7b8f3477aa1482f70b29","src/backend/mixer.rs":"ed299d3954e2a823060c870a8244673a7d4bca530830cb66b964d047a80ee3af","src/backend/mod.rs":"280da1670b87c776ee1f63aa89ba55277ef0839fa6ef4bd21672826c4c87872b","src/backend/resampler.rs":"8641c672d00f77be287d64f6cd4a2b2cd36f8630e2ded1eff6b39834b1b7ddc3","src/backend/tests/aggregate_device.rs":"7542cbb1c82398d00a5cba5b335842c517af2cda887946ebb5aaf512fd06b527","src/backend/tests/api.rs":"6eafca24d61729cad108b34c01e339130f9c479ebbe1026dc9c65778c1d9cfe0","src/backend/tests/backlog.rs":"3b189a7e036543c467cc242af0ed3332721179ee2b1c8847a6db563546f1ac52","src/backend/tests/device_change.rs":"97555244a8081251f1447c6a677609d1e91f33c9c0f4fb3f8a4082005c68ae0c","src/backend/tests/device_property.rs":"373f76d3bee83b263db3f02be3b94b408bdf852d84e4b5153273fda34b11a374","src/backend/tests/interfaces.rs":"9ed857625147c3d13c1458e630db8a78362612e6ef679d918bfdafa6e927fe75","src/backend/tests/manual.rs":"8d485a6666a3f4518b03e39dab80bf2acfd760af2d2f43bad99023cb135b38ca","src/backend/tests/mod.rs":"8dba770023d7f9c4228f0e11915347f0e07da5fd818e3ee4478c4b197af9aa2a","src/backend/tests/parallel.rs":"f9e1883660d6146b6e5075806561f5f689810e25c5e7764dfd28c9b939821a49","src/backend/tests/tone.rs":"779cc14fc2a362bf7f26ce66ad70c0639501176175655a99b7fefb3c59d56c7a","src/backend/tests/utils.rs":"3c430e519c0e7a17dda6b57c110fab725a846da39606fd99274bad20a637cf35","src/backend/utils.rs":"6c3ffbcd602e6cc9f56deb9ecb07b2eef2e6f074ef924178e466f380aae5c595","src/capi.rs":"21b66b70545bf04ec719928004d1d9adb45b24ced51288f5b2993d79aaf78f5f","src/lib.rs":"5e586d45cd6b3722f0a6736d9252593299269817a153eef1930a5fb9bfbb56f5","todo.md":"efc1f012eb9a331a040cad4ac03aa79307f25885f71b6fb38f3ad7af8d7d515c"},"package":null}
{"files":{".circleci/config.yml":"7f3dc865105ca8f33965a7958b1fe2e627ae2d5a703f3b2a4ab6e2e796018597",".editorconfig":"4e53b182bcc78b83d7e1b5c03efa14d22d4955c4ed2514d1ba4e99c1eb1a50ba",".githooks/pre-push":"8b8b26544cd56f54c0c33812551f786bb25cb08c86dbfeb6bf3daad881c826a1",".github/workflows/test.yml":"aa1998a3b104ad131805ca3513832cef3f65300192824f8b1efc9a5a0cc108f6",".travis.yml":"dc07bac53f70f16c9bdf52264bdc58500ae6018c1b4c567bc7642f6b4ca3cc35","Cargo.toml":"4671b9a0fbf47773cf01e40592ac5b5fe5cd93722f425f249e6c8b432ce3871c","LICENSE":"6e6f56aff5bbf3cbc60747e152fb1a719bd0716aaf6d711c554f57d92e96297c","README.md":"0007782a05a5330f739ad789c19c82562c82e32386b0447000fc72c0d48405bc","build-audiounit-rust-in-cubeb.sh":"d228a05985dcd02ec1ecac66a2b64dae5a530804a25a7054ccc95905aedfb7ef","install_git_hook.sh":"d38c8e51e636f6b90b489621ac34ccd1d1b1f40dccce3d178ed1da1c5068f16d","install_rustfmt_clippy.sh":"4ae90d8dcb9757cb3ae4ae142ef80e5377c0dde61c63f4a3c32418646e80ca7b","run_device_tests.sh":"cac9a7d588c2be0efa842c15d24c8cf0573bc9f9d73011662ba764dc9f6245e8","run_sanitizers.sh":"8828c73439dfd540cd21fc713c4a1011ec05baca6f282f285743f310ace39563","run_tests.sh":"916a7ae4a406d2274417d6eca939a878db5adcb6144e5680d9d148bf90178f1c","src/backend/aggregate_device.rs":"e822b4496e2ea5c6e1a288c6e92f57e598abf67cb0bdff813f859d57c63be5f9","src/backend/auto_release.rs":"050fdcee74cf46b9a8a85a877e166d72a853d33220f59cf734cbb6ea09daa441","src/backend/buffer_manager.rs":"7aa294ef26ee68ff6a131b892a97ea65571f1fe0dedaef2cc6c966d1e135d89d","src/backend/device_property.rs":"2a63837b98b9b6bfb314b4aa6dce919412b71e13e18c7b8f3477aa1482f70b29","src/backend/mixer.rs":"949c34927ba72b3365bc733a63b2f7950aef707ee08363f97242a4de6b7d4818","src/backend/mod.rs":"41d103a20b72ddf1b45315dc5230722762b16b192dfafe146279447230a21272","src/backend/resampler.rs":"8641c672d00f77be287d64f6cd4a2b2cd36f8630e2ded1eff6b39834b1b7ddc3","src/backend/tests/aggregate_device.rs":"7542cbb1c82398d00a5cba5b335842c517af2cda887946ebb5aaf512fd06b527","src/backend/tests/api.rs":"6eafca24d61729cad108b34c01e339130f9c479ebbe1026dc9c65778c1d9cfe0","src/backend/tests/backlog.rs":"3b189a7e036543c467cc242af0ed3332721179ee2b1c8847a6db563546f1ac52","src/backend/tests/device_change.rs":"97555244a8081251f1447c6a677609d1e91f33c9c0f4fb3f8a4082005c68ae0c","src/backend/tests/device_property.rs":"373f76d3bee83b263db3f02be3b94b408bdf852d84e4b5153273fda34b11a374","src/backend/tests/interfaces.rs":"b48d646b6ea06ca1bf7ce4b0ada59a164bc094e40b0cd66bb63b269f9032b022","src/backend/tests/manual.rs":"8d485a6666a3f4518b03e39dab80bf2acfd760af2d2f43bad99023cb135b38ca","src/backend/tests/mod.rs":"8dba770023d7f9c4228f0e11915347f0e07da5fd818e3ee4478c4b197af9aa2a","src/backend/tests/parallel.rs":"f9e1883660d6146b6e5075806561f5f689810e25c5e7764dfd28c9b939821a49","src/backend/tests/tone.rs":"779cc14fc2a362bf7f26ce66ad70c0639501176175655a99b7fefb3c59d56c7a","src/backend/tests/utils.rs":"3c430e519c0e7a17dda6b57c110fab725a846da39606fd99274bad20a637cf35","src/backend/utils.rs":"6c3ffbcd602e6cc9f56deb9ecb07b2eef2e6f074ef924178e466f380aae5c595","src/capi.rs":"21b66b70545bf04ec719928004d1d9adb45b24ced51288f5b2993d79aaf78f5f","src/lib.rs":"5e586d45cd6b3722f0a6736d9252593299269817a153eef1930a5fb9bfbb56f5","todo.md":"efc1f012eb9a331a040cad4ac03aa79307f25885f71b6fb38f3ad7af8d7d515c"},"package":null}

2
third_party/rust/cubeb-coreaudio/Cargo.toml поставляемый
Просмотреть файл

@ -11,7 +11,7 @@ crate-type = ["staticlib", "rlib"]
atomic = "0.4"
bitflags = "1.0"
coreaudio-sys-utils = { path = "coreaudio-sys-utils" }
cubeb-backend = "0.10.1"
cubeb-backend = "0.10"
float-cmp = "0.6"
libc = "0.2"
lazy_static = "1.2"

Просмотреть файл

@ -208,7 +208,7 @@ impl BufferManager {
};
assert!(pushed <= to_push, "We don't support upmix");
if pushed != to_push {
cubeb_alog!(
cubeb_log!(
"Input ringbuffer full, could only push {} instead of {}",
pushed,
to_push
@ -222,11 +222,6 @@ impl BufferManager {
unsafe { slice::from_raw_parts_mut::<i16>(data as *mut i16, needed_samples) };
let read = p.pop_slice(input);
if read < needed_samples {
cubeb_alog!(
"Underrun during input data pull: (needed: {}, available: {})",
needed_samples,
read
);
for i in 0..(needed_samples - read) {
input[read + i] = 0;
}
@ -237,11 +232,6 @@ impl BufferManager {
unsafe { slice::from_raw_parts_mut::<f32>(data as *mut f32, needed_samples) };
let read = p.pop_slice(input);
if read < needed_samples {
cubeb_alog!(
"Underrun during input data pull: (needed: {}, available: {})",
needed_samples,
read
);
for i in 0..(needed_samples - read) {
input[read + i] = 0.0;
}

Просмотреть файл

@ -180,7 +180,7 @@ impl Mixer {
assert!(out_channel_count > 0);
cubeb_log!(
"Creating a mixer with input channel count: {}, input layout: {:?},\
"Create a mixer with input channel count: {}, input layout: {:?}, \
out channel count: {}, output channels: {:?}",
in_channel_count,
input_layout,
@ -189,9 +189,7 @@ impl Mixer {
);
let input_channels = if in_channel_count as u32 != input_layout.bits().count_ones() {
cubeb_log!(
"Mismatch between input channels and layout. Applying default layout instead"
);
cubeb_log!("Mismatch between input channels and layout. Apply default layout instead");
get_default_channel_order(in_channel_count)
} else {
get_channel_order(input_layout)

Просмотреть файл

@ -199,7 +199,7 @@ fn create_device_info(devid: AudioDeviceID, devtype: DeviceType) -> Option<devic
};
if devid == kAudioObjectUnknown {
cubeb_log!("Using the system default device");
cubeb_log!("Use the system default device");
flags |= device_flags::DEV_SELECTED_DEFAULT;
get_default_device(devtype).map(|id| device_info { id, flags })
} else {
@ -390,7 +390,7 @@ extern "C" fn audiounit_input_callback(
// output device is no longer valid and must be reset.
// For now state that no error occurred and feed silence, stream will be
// resumed once reinit has completed.
cubeb_alog!(
cubeb_logv!(
"({:p}) input: reinit pending, output will pull silence instead",
stm.core_stream_data.stm_ptr
);
@ -402,7 +402,7 @@ extern "C" fn audiounit_input_callback(
ErrorHandle::Return(status)
};
cubeb_alogv!(
cubeb_logv!(
"({:p}) input: buffers {}, size {}, channels {}, rendered frames {}, total frames {}.",
stm.core_stream_data.stm_ptr,
input_buffer_list.mNumberBuffers,
@ -530,7 +530,7 @@ extern "C" fn audiounit_output_callback(
};
if stm.stopped.load(Ordering::SeqCst) {
cubeb_alog!("({:p}) output stopped.", stm as *const AudioUnitStream);
cubeb_log!("({:p}) output stopped.", stm as *const AudioUnitStream);
audiounit_make_silent(&mut buffers[0]);
return NO_ERR;
}
@ -554,7 +554,7 @@ extern "C" fn audiounit_output_callback(
.store(output_latency_frames, Ordering::SeqCst);
}
cubeb_alogv!(
cubeb_logv!(
"({:p}) output: buffers {}, size {}, channels {}, frames {}.",
stm as *const AudioUnitStream,
buffers.len(),
@ -599,7 +599,7 @@ extern "C" fn audiounit_output_callback(
if prev_frames_written == 0 && buffered_input_frames > input_frames_needed as usize {
input_buffer_manager.trim(input_frames_needed);
let popped_frames = buffered_input_frames - input_frames_needed as usize;
cubeb_alog!("Dropping {} frames in input buffer.", popped_frames);
cubeb_log!("Dropping {} frames in input buffer.", popped_frames);
}
let input_frames = if input_frames_needed > buffered_input_frames
@ -609,7 +609,7 @@ extern "C" fn audiounit_output_callback(
{
// The silent frames will be inserted in `get_linear_data` below.
let silent_frames_to_push = input_frames_needed - buffered_input_frames;
cubeb_alog!(
cubeb_log!(
"({:p}) Missing Frames: {} will append {} frames of input silence.",
stm.core_stream_data.stm_ptr,
if stm.frames_read.load(Ordering::SeqCst) == 0 {
@ -716,7 +716,7 @@ extern "C" fn audiounit_property_listener_callback(
let addrs = unsafe { slice::from_raw_parts(addresses, address_count as usize) };
if stm.switching_device.load(Ordering::SeqCst) {
cubeb_log!(
"Switching is already taking place. Skipping event for device {}",
"Switching is already taking place. Skip Events for device {}",
id
);
return NO_ERR;
@ -725,8 +725,9 @@ extern "C" fn audiounit_property_listener_callback(
let mut input_device_dead = false;
// Log the events
cubeb_log!(
"({:p}) Handling {} device changed events for device {}",
"({:p}) Handle {} device changed events for device {}",
stm as *const AudioUnitStream,
address_count,
id
@ -742,7 +743,7 @@ extern "C" fn audiounit_property_listener_callback(
// Handle the events
if input_device_dead {
cubeb_log!("The user-selected input device is dead, entering error state");
cubeb_log!("The user-selected input device is dead, enter error state");
stm.stopped.store(true, Ordering::SeqCst);
stm.core_stream_data.stop_audiounits();
stm.close_on_error();
@ -802,7 +803,7 @@ fn audiounit_convert_channel_layout(layout: &AudioChannelLayout) -> Vec<mixer::C
// kAudioChannelLayoutTag_Mono
// kAudioChannelLayoutTag_Stereo
// ....
cubeb_log!("Only handling UseChannelDescriptions for now.\n");
cubeb_log!("Only handle UseChannelDescriptions for now.\n");
return Vec::new();
}
@ -961,7 +962,7 @@ fn create_audiounit(device: &device_info) -> Result<AudioUnit> {
set_device_to_audiounit(unit, device.id).map_err(|e| {
cubeb_log!(
"Failed to set device {} to the created audiounit. Error: {}",
"Fail to set device {} to the created audiounit. Error: {}",
device.id,
e
);
@ -1157,7 +1158,7 @@ fn set_buffer_size_sync(unit: AudioUnit, devtype: DeviceType, frames: u32) -> Re
set_buffer_size(unit, devtype, frames).map_err(|e| {
cubeb_log!(
"Failed to set buffer size for AudioUnit {:?} for {:?}. Error: {}",
"Fail to set buffer size for AudioUnit {:?} for {:?}. Error: {}",
unit,
devtype,
e
@ -1171,7 +1172,7 @@ fn set_buffer_size_sync(unit: AudioUnit, devtype: DeviceType, frames: u32) -> Re
let (chg, timeout_res) = cvar.wait_timeout(changed, waiting_time).unwrap();
if timeout_res.timed_out() {
cubeb_log!(
"Timed out for waiting the buffer frame size setting of AudioUnit {:?} for {:?}",
"Time out for waiting the buffer frame size setting of AudioUnit {:?} for {:?}",
unit,
devtype
);
@ -1302,7 +1303,7 @@ fn get_fixed_latency(devid: AudioObjectID, devtype: DeviceType) -> u32 {
let stream_latency = get_device_streams(devid, devtype).and_then(|streams| {
if streams.is_empty() {
cubeb_log!(
"No stream on device {} in {:?} scope!",
"No any stream on device {} in {:?} scope!",
devid,
devtype
);
@ -1337,13 +1338,13 @@ fn get_device_group_id(
match get_custom_group_id(id, devtype) {
Some(id) => return Ok(id),
None => {
cubeb_log!("Getting model UID instead.");
cubeb_log!("Get model uid instead.");
}
};
}
Ok(trans_type) => {
cubeb_log!(
"The transport type is {:?}. Getting model UID instead.",
"The transport type is {:?}. Get model uid instead.",
convert_uint32_into_string(trans_type)
);
}
@ -1372,7 +1373,7 @@ fn get_custom_group_id(id: AudioDeviceID, devtype: DeviceType) -> Option<CString
s @ Ok(IMIC) | s @ Ok(ISPK) => {
const GROUP_ID: &str = "builtin-internal-mic|spk";
cubeb_log!(
"Using hardcode group id: {} when source is: {:?}.",
"Use hardcode group id: {} when source is: {:?}.",
GROUP_ID,
convert_uint32_into_string(s.unwrap())
);
@ -1381,7 +1382,7 @@ fn get_custom_group_id(id: AudioDeviceID, devtype: DeviceType) -> Option<CString
s @ Ok(EMIC) | s @ Ok(HDPN) => {
const GROUP_ID: &str = "builtin-external-mic|hdpn";
cubeb_log!(
"Using hardcode group id: {} when source is: {:?}.",
"Use hardcode group id: {} when source is: {:?}.",
GROUP_ID,
convert_uint32_into_string(s.unwrap())
);
@ -1443,7 +1444,7 @@ fn create_cubeb_device_info(
}
Err(e) => {
cubeb_log!(
"Cannot get the UID for device {} in {:?} scope. Error: {}",
"Cannot get the uid for device {} in {:?} scope. Error: {}",
devid,
devtype,
e
@ -1457,7 +1458,7 @@ fn create_cubeb_device_info(
}
Err(e) => {
cubeb_log!(
"Cannot get the model UID for device {} in {:?} scope. Error: {}",
"Cannot get the model uid for device {} in {:?} scope. Error: {}",
devid,
devtype,
e
@ -1546,7 +1547,7 @@ fn create_cubeb_device_info(
latency + range.mMaximum as u32,
),
Err(e) => {
cubeb_log!("Cannot get the buffer frame size for device {} in {:?} scope. Using default value instead. Error: {}", devid, devtype, e);
cubeb_log!("Cannot get the buffer frame size for device {} in {:?} scope. Use default value instead. Error: {}", devid, devtype, e);
(
10 * dev_info.default_rate / 1000,
100 * dev_info.default_rate / 1000,
@ -1658,7 +1659,7 @@ fn audiounit_get_devices_of_type(devtype: DeviceType) -> Vec<AudioObjectID> {
let info = format!("{} ({})", device, label);
if let Ok(channels) = get_channel_count(device, devtype) {
cubeb_log!("Device {} has {} {:?}-channels", info, channels, devtype);
cubeb_log!("device {} has {} {:?}-channels", info, channels, devtype);
if channels > 0 {
devices_in_scope.push(device);
}
@ -1754,9 +1755,7 @@ impl DevicesData {
}
fn is_empty(&self) -> bool {
self.changed_callback.is_none()
&& self.callback_user_ptr.is_null()
&& self.devices.is_empty()
self.changed_callback == None && self.callback_user_ptr.is_null() && self.devices.is_empty()
}
}
@ -2351,32 +2350,17 @@ impl<'ctx> CoreStreamData<'ctx> {
// It's impossible to create an aggregate device from an aggregate device, and it's
// unnecessary to create an aggregate device when opening the same device input/output. In
// all other cases, use an aggregate device.
let mut either_already_aggregate = false;
if self.has_input() {
let input_is_aggregate =
either_already_aggregate |=
get_device_transport_type(self.input_device.id, DeviceType::INPUT).unwrap_or(0)
== kAudioDeviceTransportTypeAggregate;
if input_is_aggregate {
either_already_aggregate = true;
}
cubeb_log!(
"Input device ID: {} (aggregate: {:?})",
self.input_device.id,
input_is_aggregate
);
}
if self.has_output() {
let output_is_aggregate =
either_already_aggregate |=
get_device_transport_type(self.output_device.id, DeviceType::OUTPUT).unwrap_or(0)
== kAudioDeviceTransportTypeAggregate;
if output_is_aggregate {
either_already_aggregate = true;
}
cubeb_log!(
"Output device ID: {} (aggregate: {:?})",
self.input_device.id,
output_is_aggregate
);
}
// Only use an aggregate device when the device are different.
self.has_input()
@ -2453,15 +2437,15 @@ impl<'ctx> CoreStreamData<'ctx> {
out_dev_info.flags = device_flags::DEV_OUTPUT;
self.aggregate_device = Some(device);
cubeb_log!(
"({:p}) Using an aggregate device {} for input and output.",
"({:p}) Use aggregate device {} for input and output.",
self.stm_ptr,
self.aggregate_device.as_ref().unwrap().get_device_id()
);
}
Err(e) => {
cubeb_log!(
"({:p}) Creation of aggregate devices failed. Error: {}.\
Using assigned devices directly instead.",
"({:p}) Create aggregate devices failed. Error: {}.\
Use assigned devices directly instead.",
self.stm_ptr,
e
);
@ -2477,7 +2461,7 @@ impl<'ctx> CoreStreamData<'ctx> {
// Configure I/O stream
if self.has_input() {
cubeb_log!(
"({:p}) Initializing input by device info: {:?}",
"({:p}) Initialize input by device info: {:?}",
self.stm_ptr,
in_dev_info
);

Просмотреть файл

@ -574,14 +574,11 @@ fn test_ops_stream_current_device() {
println!("stream_get_current_device only works when the machine has both input and output devices");
return;
}
let mut device: *mut ffi::cubeb_device = ptr::null_mut();
if unsafe { OPS.stream_get_current_device.unwrap()(stream, &mut device) } != ffi::CUBEB_OK {
// It can happen when we fail to get the device source.
println!("stream_get_current_device fails. Skip this test.");
return;
}
assert_eq!(
unsafe { OPS.stream_get_current_device.unwrap()(stream, &mut device) },
ffi::CUBEB_OK
);
assert!(!device.is_null());
// Uncomment the below to print out the results.
// let deviceref = unsafe { DeviceRef::from_ptr(device) };

Просмотреть файл

@ -1 +1 @@
{"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}
{"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}

2
third_party/rust/cubeb-pulse/Cargo.toml поставляемый
Просмотреть файл

@ -12,7 +12,7 @@ pulse-dlopen = ["pulse-ffi/dlopen"]
crate-type = ["staticlib", "rlib"]
[dependencies]
cubeb-backend = "0.10.1"
cubeb-backend = "0.10"
pulse-ffi = { path = "pulse-ffi" }
pulse = { path = "pulse-rs" }
semver = "1.0"

Просмотреть файл

@ -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();
@ -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();
@ -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);
@ -524,7 +524,7 @@ impl ContextOps for PulseContext {
user_ptr: *mut c_void,
) -> Result<Stream> {
if self.error {
self.context_init()?;
let _ = self.context_init()?;
}
let stm = PulseStream::new(

Просмотреть файл

@ -319,7 +319,7 @@ impl<'ctx> PulseStream<'ctx> {
readable_size
}
cubeb_alogv!("Input callback buffer size {}", nbytes);
cubeb_logv!("Input callback buffer size {}", nbytes);
let stm = unsafe { &mut *(u as *mut PulseStream) };
if stm.shutdown {
return;
@ -380,7 +380,7 @@ impl<'ctx> PulseStream<'ctx> {
}
fn write_data(_: &pulse::Stream, nbytes: usize, u: *mut c_void) {
cubeb_alogv!("Output callback to be written buffer size {}", nbytes);
cubeb_logv!("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;
@ -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_alog!("Dropping {} frames in input buffer.", popped_frames);
cubeb_log!("Dropping {} frames in input buffer.", popped_frames);
}
}
@ -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_alog!(
cubeb_log!(
"Output buffer attributes maxlength {}, tlength {}, \
prebuf {}, minreq {}, fragsize {}",
output_att.maxlength,
@ -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_alog!(
cubeb_log!(
"Input buffer attributes maxlength {}, tlength {}, \
prebuf {}, minreq {}, fragsize {}",
input_att.maxlength,
@ -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_alog!("Stream stop: waiting for drain");
cubeb_log!("Stream stop: waiting for drain");
while !self.drain_timer.load(Ordering::Acquire).is_null() {
self.context.mainloop.wait();
}
cubeb_alog!("Stream stop: waited for drain");
cubeb_log!("Stream stop: waited for drain");
self.context.mainloop.unlock();
}
self.cork(CorkState::cork() | CorkState::notify());
@ -1025,7 +1025,7 @@ impl<'ctx> PulseStream<'ctx> {
true
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cognitive_complexity))]
#[cfg_attr(feature = "cargo-clippy", allow(cyclomatic_complexity))]
fn trigger_user_callback(&mut self, input_data: *const c_void, nbytes: usize) {
fn drained_cb(
a: &pulse::MainloopApi,
@ -1033,7 +1033,7 @@ impl<'ctx> PulseStream<'ctx> {
_tv: &pulse::TimeVal,
u: *mut c_void,
) {
cubeb_alogv!("Drain finished callback.");
cubeb_logv!("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);
@ -1060,7 +1060,7 @@ impl<'ctx> PulseStream<'ctx> {
debug_assert!(size > 0);
debug_assert_eq!(size % frame_size, 0);
cubeb_alogv!(
cubeb_logv!(
"Trigger user callback with output buffer size={}, read_offset={}",
size,
read_offset
@ -1135,7 +1135,7 @@ impl<'ctx> PulseStream<'ctx> {
got += (padding_bytes / frame_size) as i64;
}
} else {
cubeb_alogv!(
cubeb_logv!(
"Not enough room to pad up to prebuf when prebuffering."
)
}
@ -1149,7 +1149,7 @@ impl<'ctx> PulseStream<'ctx> {
);
if should_drain {
cubeb_alogv!("Draining {} < {}", got, size / frame_size);
cubeb_logv!("Draining {} < {}", got, size / frame_size);
let latency = match stm.get_latency() {
Ok(StreamLatency::Positive(l)) => l,
Ok(_) => {

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

8
third_party/rust/cubeb-sys/Cargo.toml поставляемый
Просмотреть файл

@ -11,14 +11,13 @@
[package]
name = "cubeb-sys"
version = "0.10.1"
version = "0.10.0"
authors = ["Dan Glastonbury <dglastonbury@mozilla.com>"]
build = "build.rs"
links = "cubeb"
description = "Native bindings to the cubeb library"
license = "ISC"
repository = "https://github.com/mozilla/cubeb-rs"
repository = "https://github.com/djg/cubeb-rs"
[build-dependencies.cmake]
version = "0.1.2"
@ -27,6 +26,5 @@ version = "0.3"
[features]
gecko-in-tree = []
[badges.circle-ci]
repository = "mozilla/cubeb-rs"
repository = "djg/cubeb-rs"

12
third_party/rust/cubeb-sys/build.rs поставляемый
Просмотреть файл

@ -46,17 +46,6 @@ fn main() {
let android = target.contains("android");
let mut cfg = cmake::Config::new("libcubeb");
if darwin {
let cmake_osx_arch = if target.contains("aarch64") {
// Apple Silicon
"arm64"
} else {
// Assuming Intel (x86_64)
"x86_64"
};
cfg.define("CMAKE_OSX_ARCHITECTURES", cmake_osx_arch);
}
let _ = fs::remove_dir_all(env::var("OUT_DIR").unwrap());
t!(fs::create_dir_all(env::var("OUT_DIR").unwrap()));
@ -95,7 +84,6 @@ fn main() {
let _ = pkg_config::find_library("alsa");
let _ = pkg_config::find_library("libpulse");
let _ = pkg_config::find_library("jack");
let _ = pkg_config::find_library("speexdsp");
if android {
println!("cargo:rustc-link-lib=dylib=OpenSLES");
}

Просмотреть файл

@ -2,12 +2,12 @@
You must have CMake v3.1 or later installed.
1. `git clone --recursive https://github.com/mozilla/cubeb.git`
1. `git clone --recursive https://github.com/kinetiknz/cubeb.git`
2. `mkdir cubeb-build`
3. `cd cubeb-build`
4. `cmake ../cubeb`
5. `cmake --build .`
6. `ctest`
3. `cmake ../cubeb`
4. `cmake --build .`
5. `ctest`
# Windows build notes
@ -41,6 +41,6 @@ To build with MinGW-w64, install the following items:
- Download and install MinGW-w64 with Win32 threads.
- Download and install CMake.
- Run MinGW-w64 Terminal from the Start Menu.
- Follow the build steps at the top of this file, but at step 4 run:
`cmake -G "MinGW Makefiles" ../cubeb`
- Follow the build steps at the top of this file, but at step 3 run:
`cmake -G "MinGW Makefiles" ..`
- Continue the build steps at the top of this file.

Просмотреть файл

@ -2,6 +2,6 @@
See INSTALL.md for build instructions.
See [Backend Support](https://github.com/mozilla/cubeb/wiki/Backend-Support) in the wiki for the support level of each backend.
See [Backend Support](https://github.com/kinetiknz/cubeb/wiki/Backend-Support) in the wiki for the support level of each backend.
Licensed under an ISC-style license. See LICENSE for details.

5
third_party/rust/cubeb-sys/src/log.rs поставляемый
Просмотреть файл

@ -3,7 +3,7 @@
// This program is made available under an ISC-style license. See the
// accompanying file LICENSE for details.
use std::os::raw::{c_char, c_int, c_void};
use std::os::raw::{c_char, c_int};
cubeb_enum! {
pub enum cubeb_log_level {
@ -23,7 +23,4 @@ extern "C" {
pub static g_cubeb_log_level: cubeb_log_level;
pub static g_cubeb_log_callback: cubeb_log_callback;
pub fn cubeb_async_log_reset_threads(_: c_void) -> c_void;
pub fn cubeb_async_log(msg: *const c_char, ...) -> c_void;
}

2
third_party/rust/cubeb/.cargo-checksum.json поставляемый
Просмотреть файл

@ -1 +1 @@
{"files":{"Cargo.lock":"b5619b3fbd40526e5ca797cc26134375b4fe94b476428f34aed791ffe9f07ee2","Cargo.toml":"42c32a8a24c2ed9c317ee83c73597080c029f1084d9a7924cc3f37d498c16056","LICENSE":"8c044baa5d883274736eeece0b955249076c2697b826e576fce59496235b2cf5","README.md":"408c573ec240927cf5b9c036098e94e374ec41f71991415422586f450586b214","examples/common/mod.rs":"3363405f3d21ad120617473a0288c337a7b15eb79f5bb1035cfd258bd9bedf2b","examples/devices.rs":"ff5dcd588e7036165c4b4c20ec355d036e0ae90cf88b3b0f5cd86621fe2ce61d","examples/tone.rs":"8f5f9851b6d99f6f16c597fcb9312e3ef81769cbfb89341d2ea2522ca2e2214e","src/context.rs":"2d29d9704af311996bf9702519ef5bb0e9d3ada032d22070db7dbb6e8987859e","src/frame.rs":"649cedaa2e9e1c5d2c3146bd0d66fd28bb230e68142493a9ea7dbab4a15f5adc","src/lib.rs":"c86f594be459cbef72b05d60f4124d0844ba13d5d07fbe11b3d7438cd52a5a5e","src/log.rs":"704faeb31934dad6bc6d02e01caa85118754209bd559d30d03fcfa5cb8c1603c","src/sample.rs":"0d4645cc1d6ac26f198f6f59a44e193422e5646ecef0de46224653bef79d1a10","src/stream.rs":"32c4169de7b6f5d5c5016c1cb6c70fbb20bc9155979630b1fc4c57636950dfe6"},"package":"53051f86ed8cf5a6771704e80147266f32bdf05cc09089da304484a1c612bb97"}
{"files":{"Cargo.lock":"d0e184467544d2ccf8bef8d6bd0d5423e26e74c7cd002267965b10197b641988","Cargo.toml":"fd477b36c03358d1c0a94851a4a07284c688e5bcc7bc0cf0967af958b5f0910d","LICENSE":"8c044baa5d883274736eeece0b955249076c2697b826e576fce59496235b2cf5","README.md":"408c573ec240927cf5b9c036098e94e374ec41f71991415422586f450586b214","examples/common/mod.rs":"3363405f3d21ad120617473a0288c337a7b15eb79f5bb1035cfd258bd9bedf2b","examples/devices.rs":"ff5dcd588e7036165c4b4c20ec355d036e0ae90cf88b3b0f5cd86621fe2ce61d","examples/tone.rs":"8f5f9851b6d99f6f16c597fcb9312e3ef81769cbfb89341d2ea2522ca2e2214e","src/context.rs":"2d29d9704af311996bf9702519ef5bb0e9d3ada032d22070db7dbb6e8987859e","src/frame.rs":"649cedaa2e9e1c5d2c3146bd0d66fd28bb230e68142493a9ea7dbab4a15f5adc","src/lib.rs":"c86f594be459cbef72b05d60f4124d0844ba13d5d07fbe11b3d7438cd52a5a5e","src/log.rs":"704faeb31934dad6bc6d02e01caa85118754209bd559d30d03fcfa5cb8c1603c","src/sample.rs":"0d4645cc1d6ac26f198f6f59a44e193422e5646ecef0de46224653bef79d1a10","src/stream.rs":"32c4169de7b6f5d5c5016c1cb6c70fbb20bc9155979630b1fc4c57636950dfe6"},"package":"d47c8cc00b8034e996d7dd262956a0d904c1e1d0d521d22c99801420b38484bd"}

14
third_party/rust/cubeb/Cargo.lock сгенерированный поставляемый
Просмотреть файл

@ -25,16 +25,16 @@ dependencies = [
[[package]]
name = "cubeb"
version = "0.10.1"
version = "0.10.0"
dependencies = [
"cubeb-core",
]
[[package]]
name = "cubeb-core"
version = "0.10.1"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48c0ac573dc2e393c12e4b829d6e17bbb7a1f95b288043ee47ef251097ddb094"
checksum = "04aabcd7fa088330b5f25b2f92cd1c2d80d0232e114e5bdaa682bb65103d57d9"
dependencies = [
"bitflags",
"cubeb-sys",
@ -42,9 +42,9 @@ dependencies = [
[[package]]
name = "cubeb-sys"
version = "0.10.1"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33b49428acff552b1ba790649ea16a6f3d60cf74e9457a1378771a1acc12d5ee"
checksum = "da8f61339785526e9488f4902ef09d83483fa7fc2c6f6f6f80bb8ae04af03818"
dependencies = [
"cmake",
"pkg-config",
@ -52,6 +52,6 @@ dependencies = [
[[package]]
name = "pkg-config"
version = "0.3.25"
version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae"
checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe"

16
third_party/rust/cubeb/Cargo.toml поставляемый
Просмотреть файл

@ -11,23 +11,19 @@
[package]
name = "cubeb"
version = "0.10.1"
version = "0.10.0"
authors = ["Dan Glastonbury <dglastonbury@mozilla.com>"]
description = """
Bindings to libcubeb for interacting with system audio from rust.
"""
homepage = "https://github.com/mozilla/cubeb-rs"
description = "Bindings to libcubeb for interacting with system audio from rust.\n"
homepage = "https://github.com/djg/cubeb-rs"
readme = "README.md"
keywords = ["cubeb"]
categories = ["api-bindings"]
license = "ISC"
repository = "https://github.com/mozilla/cubeb-rs"
repository = "https://github.com/djg/cubeb-rs"
[dependencies.cubeb-core]
version = "0.10.1"
version = "0.10.0"
[features]
gecko-in-tree = ["cubeb-core/gecko-in-tree"]
[badges.circle-ci]
repository = "mozilla/cubeb-rs"
repository = "djg/cubeb-rs"

Просмотреть файл

@ -22,9 +22,9 @@ static_prefs = { path = "../../../../modules/libpref/init/static_prefs" }
profiler_helper = { path = "../../../../tools/profiler/rust-helper", optional = true }
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="f32b3ef708c0bfb2c414c08971d638527353d376", optional = true, features=["pulse-dlopen"] }
cubeb-sys = { version = "0.10.1", optional = true, features=["gecko-in-tree"] }
cubeb-coreaudio = { git = "https://github.com/mozilla/cubeb-coreaudio-rs", rev = "44eca95823bb57e964cf7b6d9791ed2ccb4b2108", optional = true }
cubeb-pulse = { git = "https://github.com/mozilla/cubeb-pulse-rs", rev="1f1fe1e08e01a9a534ec7f079702a583a0899ce7", optional = true, features=["pulse-dlopen"] }
cubeb-sys = { version = "0.10", 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
audioipc-client = { git = "https://github.com/mozilla/audioipc", rev = "fb7a2b12ced3b43e6a268621989c6191d1ed7e39", optional = true }