summaryrefslogtreecommitdiffstats
path: root/third_party/rust/cubeb-sys/src/context.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /third_party/rust/cubeb-sys/src/context.rs
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/cubeb-sys/src/context.rs')
-rw-r--r--third_party/rust/cubeb-sys/src/context.rs41
1 files changed, 41 insertions, 0 deletions
diff --git a/third_party/rust/cubeb-sys/src/context.rs b/third_party/rust/cubeb-sys/src/context.rs
new file mode 100644
index 0000000000..b7f6e1193e
--- /dev/null
+++ b/third_party/rust/cubeb-sys/src/context.rs
@@ -0,0 +1,41 @@
+// Copyright © 2017-2018 Mozilla Foundation
+//
+// This program is made available under an ISC-style license. See the
+// accompanying file LICENSE for details.
+
+use callbacks::{cubeb_data_callback, cubeb_state_callback};
+use device::cubeb_devid;
+use std::os::raw::{c_char, c_int, c_uint, c_void};
+use stream::{cubeb_stream, cubeb_stream_params};
+
+pub enum cubeb {}
+
+extern "C" {
+ pub fn cubeb_init(
+ context: *mut *mut cubeb,
+ context_name: *const c_char,
+ backend_name: *const c_char,
+ ) -> c_int;
+ pub fn cubeb_get_backend_id(context: *mut cubeb) -> *const c_char;
+ pub fn cubeb_get_max_channel_count(context: *mut cubeb, max_channels: *mut c_uint) -> c_int;
+ pub fn cubeb_get_min_latency(
+ context: *mut cubeb,
+ params: *mut cubeb_stream_params,
+ latency_frames: *mut c_uint,
+ ) -> c_int;
+ pub fn cubeb_get_preferred_sample_rate(context: *mut cubeb, rate: *mut c_uint) -> c_int;
+ pub fn cubeb_destroy(context: *mut cubeb);
+ pub fn cubeb_stream_init(
+ context: *mut cubeb,
+ stream: *mut *mut cubeb_stream,
+ stream_name: *const c_char,
+ input_device: cubeb_devid,
+ input_stream_params: *mut cubeb_stream_params,
+ output_device: cubeb_devid,
+ output_stream_params: *mut cubeb_stream_params,
+ latency_frames: c_uint,
+ data_callback: cubeb_data_callback,
+ state_callback: cubeb_state_callback,
+ user_ptr: *mut c_void,
+ ) -> c_int;
+}