Bug 1744886 - Update cubeb-sys to 0.9.1. r=kinetik

Differential Revision: https://phabricator.services.mozilla.com/D133853
This commit is contained in:
Mike Hommey 2021-12-15 21:40:22 +00:00
Родитель 7fc0016de5
Коммит 70bda9f038
8 изменённых файлов: 43 добавлений и 31 удалений

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

@ -1089,9 +1089,9 @@ dependencies = [
[[package]]
name = "cubeb-sys"
version = "0.9.0"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaedd862c6194a52c45efc3b5fd43e42e11fe3cd915520add4d1a5d03a818796"
checksum = "fe27afa13cacb7028569922a814f17bb210517b26db67f905a95fd8151ce3794"
dependencies = [
"cmake",
"pkg-config",

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

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

@ -3,16 +3,15 @@
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you believe there's an error in this file please file an
# issue against the rust-lang/cargo repository. If you're
# editing this file be aware that the upstream Cargo.toml
# will likely look very different (and much more reasonable)
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.
[package]
name = "cubeb-sys"
version = "0.9.0"
version = "0.9.1"
authors = ["Dan Glastonbury <dglastonbury@mozilla.com>"]
build = "build.rs"
links = "cubeb"

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

@ -3,7 +3,9 @@
// This program is made available under an ISC-style license. See the
// accompanying file LICENSE for details.
#[cfg(not(feature = "gecko-in-tree"))]
extern crate cmake;
#[cfg(not(feature = "gecko-in-tree"))]
extern crate pkg_config;
use std::env;
@ -12,22 +14,23 @@ use std::path::Path;
use std::process::Command;
macro_rules! t {
($e:expr) => (match $e {
Ok(e) => e,
Err(e) => panic!("{} failed with {}", stringify!($e), e),
})
($e:expr) => {
match $e {
Ok(e) => e,
Err(e) => panic!("{} failed with {}", stringify!($e), e),
}
};
}
fn main() {
let gecko_in_tree = env::var("CARGO_FEATURE_GECKO_IN_TREE").is_ok();
if gecko_in_tree {
return;
}
#[cfg(feature = "gecko-in-tree")]
fn main() {}
if env::var("LIBCUBEB_SYS_USE_PKG_CONFIG").is_ok() {
if pkg_config::find_library("libcubeb").is_ok() {
return;
}
#[cfg(not(feature = "gecko-in-tree"))]
fn main() {
if env::var("LIBCUBEB_SYS_USE_PKG_CONFIG").is_ok()
&& pkg_config::find_library("libcubeb").is_ok()
{
return;
}
if !Path::new("libcubeb/.git").exists() {
@ -37,17 +40,18 @@ fn main() {
}
let target = env::var("TARGET").unwrap();
// let host = env::var("HOST").unwrap();
let windows = target.contains("windows");
let darwin = target.contains("darwin");
let freebsd = target.contains("freebsd");
let android = target.contains("android");
let mut cfg = cmake::Config::new("libcubeb");
let _ = fs::remove_dir_all(env::var("OUT_DIR").unwrap());
t!(fs::create_dir_all(env::var("OUT_DIR").unwrap()));
env::remove_var("DESTDIR");
let dst = cfg.define("BUILD_SHARED_LIBS", "OFF")
let dst = cfg
.define("BUILD_SHARED_LIBS", "OFF")
.define("BUILD_TESTS", "OFF")
.define("BUILD_TOOLS", "OFF")
.build();
@ -66,7 +70,7 @@ fn main() {
println!("cargo:rustc-link-lib=dylib=c++");
println!("cargo:rustc-link-search=native={}/lib", dst.display());
} else {
if freebsd {
if freebsd || android {
println!("cargo:rustc-link-lib=dylib=c++");
} else {
println!("cargo:rustc-link-lib=dylib=stdc++");
@ -79,5 +83,8 @@ fn main() {
let _ = pkg_config::find_library("alsa");
let _ = pkg_config::find_library("libpulse");
let _ = pkg_config::find_library("jack");
if android {
println!("cargo:rustc-link-lib=dylib=OpenSLES");
}
}
}

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

@ -8,8 +8,13 @@ use std::os::raw::{c_long, c_void};
use stream::{cubeb_state, cubeb_stream};
pub type cubeb_data_callback = Option<
unsafe extern "C" fn(*mut cubeb_stream, *mut c_void, *const c_void, *mut c_void, c_long)
-> c_long,
unsafe extern "C" fn(
*mut cubeb_stream,
*mut c_void,
*const c_void,
*mut c_void,
c_long,
) -> c_long,
>;
pub type cubeb_state_callback =
Option<unsafe extern "C" fn(*mut cubeb_stream, *mut c_void, cubeb_state)>;

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

@ -33,7 +33,7 @@ cubeb_enum! {
}
cubeb_enum! {
pub enum cubeb_channel_layout {
pub enum cubeb_channel_layout : c_enum {
CUBEB_LAYOUT_UNDEFINED = 0,
CUBEB_LAYOUT_MONO = CHANNEL_FRONT_CENTER,
CUBEB_LAYOUT_MONO_LFE = CUBEB_LAYOUT_MONO | CHANNEL_LOW_FREQUENCY,

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

@ -5,8 +5,8 @@
use callbacks::cubeb_device_collection_changed_callback;
use context::cubeb;
use std::{fmt, mem};
use std::os::raw::{c_char, c_int, c_uint, c_void};
use std::{fmt, mem};
cubeb_enum! {
pub enum cubeb_device_fmt {

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

@ -7,8 +7,8 @@ use callbacks::cubeb_device_changed_callback;
use channel::cubeb_channel_layout;
use device::cubeb_device;
use format::cubeb_sample_format;
use std::os::raw::{c_char, c_float, c_int, c_uint, c_void};
use std::{fmt, mem};
use std::os::raw::{c_float, c_int, c_uint, c_void, c_char};
cubeb_enum! {
pub enum cubeb_stream_prefs {
@ -65,7 +65,8 @@ extern "C" {
pub fn cubeb_stream_stop(stream: *mut cubeb_stream) -> c_int;
pub fn cubeb_stream_get_position(stream: *mut cubeb_stream, position: *mut u64) -> c_int;
pub fn cubeb_stream_get_latency(stream: *mut cubeb_stream, latency: *mut c_uint) -> c_int;
pub fn cubeb_stream_get_input_latency(stream: *mut cubeb_stream, latency: *mut c_uint) -> c_int;
pub fn cubeb_stream_get_input_latency(stream: *mut cubeb_stream, latency: *mut c_uint)
-> c_int;
pub fn cubeb_stream_set_volume(stream: *mut cubeb_stream, volume: c_float) -> c_int;
pub fn cubeb_stream_set_name(stream: *mut cubeb_stream, name: *const c_char) -> c_int;
pub fn cubeb_stream_get_current_device(