Struct cubeb_core::ContextRef
source · pub struct ContextRef(/* private fields */);
Implementations§
source§impl ContextRef
impl ContextRef
sourcepub unsafe fn from_ptr<'a>(ptr: *mut cubeb) -> &'a Self
pub unsafe fn from_ptr<'a>(ptr: *mut cubeb) -> &'a Self
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) -> &'a mut Self
pub unsafe fn from_ptr_mut<'a>(ptr: *mut cubeb) -> &'a mut Self
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
source§impl ContextRef
impl ContextRef
pub fn backend_id(&self) -> &str
pub fn backend_id_bytes(&self) -> &[u8] ⓘ
pub fn max_channel_count(&self) -> Result<u32>
pub fn min_latency(&self, params: &StreamParamsRef) -> Result<u32>
pub fn preferred_sample_rate(&self) -> Result<u32>
pub fn supported_input_processing_params(&self) -> Result<InputProcessingParams>
sourcepub unsafe fn stream_init(
&self,
stream_name: Option<&CStr>,
input_device: DeviceId,
input_stream_params: Option<&StreamParamsRef>,
output_device: DeviceId,
output_stream_params: Option<&StreamParamsRef>,
latency_frames: u32,
data_callback: cubeb_data_callback,
state_callback: cubeb_state_callback,
user_ptr: *mut c_void
) -> Result<Stream>
pub unsafe fn stream_init( &self, stream_name: Option<&CStr>, input_device: DeviceId, input_stream_params: Option<&StreamParamsRef>, output_device: DeviceId, output_stream_params: Option<&StreamParamsRef>, latency_frames: u32, data_callback: cubeb_data_callback, state_callback: cubeb_state_callback, user_ptr: *mut c_void ) -> Result<Stream>
Safety
This function is unsafe because it dereferences the given data_callback
, state_callback
, and user_ptr
pointers.
The caller should ensure those pointers are valid.
pub fn enumerate_devices( &self, devtype: DeviceType ) -> Result<DeviceCollection<'_>>
sourcepub unsafe fn register_device_collection_changed(
&self,
devtype: DeviceType,
callback: cubeb_device_collection_changed_callback,
user_ptr: *mut c_void
) -> Result<()>
pub unsafe fn register_device_collection_changed( &self, devtype: DeviceType, callback: cubeb_device_collection_changed_callback, user_ptr: *mut c_void ) -> Result<()>
Safety
This function is unsafe because it dereferences the given callback
and user_ptr
pointers.
The caller should ensure those pointers are valid.
Trait Implementations§
source§impl AsRef<ContextRef> for Context
impl AsRef<ContextRef> for Context
source§fn as_ref(&self) -> &ContextRef
fn as_ref(&self) -> &ContextRef
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Borrow<ContextRef> for Context
impl Borrow<ContextRef> for Context
source§fn borrow(&self) -> &ContextRef
fn borrow(&self) -> &ContextRef
Immutably borrows from an owned value. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ContextRef
impl Send for ContextRef
impl !Sync for ContextRef
impl Unpin for ContextRef
impl UnwindSafe for ContextRef
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more