Struct cubeb_backend::StreamRef
source · [−]pub struct StreamRef(_);Implementations
sourceimpl StreamRef
impl StreamRef
sourcepub unsafe fn from_ptr<'a>(ptr: *mut cubeb_stream) -> &'a StreamRef
pub unsafe fn from_ptr<'a>(ptr: *mut cubeb_stream) -> &'a StreamRef
Safety
This function is unsafe because it dereferences the given ptr pointer.
The caller should ensure that pointer is valid.
sourcepub unsafe fn from_ptr_mut<'a>(ptr: *mut cubeb_stream) -> &'a mut StreamRef
pub unsafe fn from_ptr_mut<'a>(ptr: *mut cubeb_stream) -> &'a mut StreamRef
Safety
This function is unsafe because it dereferences the given ptr pointer.
The caller should ensure that pointer is valid.
pub fn as_ptr(&self) -> *mut cubeb_stream
sourceimpl StreamRef
impl StreamRef
sourcepub fn latency(&self) -> Result<u32, Error>
pub fn latency(&self) -> Result<u32, Error>
Get the latency for this stream, in frames. This is the number of frames between the time cubeb acquires the data in the callback and the listener can hear the sound.
sourcepub fn input_latency(&self) -> Result<u32, Error>
pub fn input_latency(&self) -> Result<u32, Error>
Get the input latency for this stream, in frames. This is the number of frames between the time the audio input device records the audio, and the cubeb callback delivers it. This returns an error if the stream is output-only.
sourcepub fn current_device(&self) -> Result<&DeviceRef, Error>
pub fn current_device(&self) -> Result<&DeviceRef, Error>
Get the current output device for this stream.
sourcepub fn device_destroy(&self, device: DeviceRef) -> Result<(), Error>
pub fn device_destroy(&self, device: DeviceRef) -> Result<(), Error>
Destroy a cubeb_device structure.
sourcepub fn register_device_changed_callback(
&self,
callback: Option<unsafe extern "C" fn(*mut c_void)>
) -> Result<(), Error>
pub fn register_device_changed_callback(
&self,
callback: Option<unsafe extern "C" fn(*mut c_void)>
) -> Result<(), Error>
Set a callback to be notified when the output device changes.
pub fn user_ptr(&self) -> *mut c_void
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for StreamRef
impl Send for StreamRef
impl !Sync for StreamRef
impl Unpin for StreamRef
impl UnwindSafe for StreamRef
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more