#[repr(C)]
pub struct spa_device_methods { pub version: u32, pub add_listener: Option<unsafe extern "C" fn(object: *mut c_void, listener: *mut spa_hook, events: *const spa_device_events, data: *mut c_void) -> c_int>, pub sync: Option<unsafe extern "C" fn(object: *mut c_void, seq: c_int) -> c_int>, pub enum_params: Option<unsafe extern "C" fn(object: *mut c_void, seq: c_int, id: u32, index: u32, max: u32, filter: *const spa_pod) -> c_int>, pub set_param: Option<unsafe extern "C" fn(object: *mut c_void, id: u32, flags: u32, param: *const spa_pod) -> c_int>, }
Expand description

spa_device_methods:

Fields§

§version: u32§add_listener: Option<unsafe extern "C" fn(object: *mut c_void, listener: *mut spa_hook, events: *const spa_device_events, data: *mut c_void) -> c_int>

Set events to receive asynchronous notifications from the device.

Setting the events will trigger the info event and an object_info event for each managed object on the new listener.

\param object a \ref spa_device \param listener a listener \param events a struct \ref spa_device_events \param data data passed as first argument in functions of \a events \return 0 on success < 0 errno on error

§sync: Option<unsafe extern "C" fn(object: *mut c_void, seq: c_int) -> c_int>

Perform a sync operation.

This method will emit the result event with the given sequence number synchronously or with the returned async return value asynchronously.

Because all methods are serialized in the device, this can be used to wait for completion of all previous method calls.

\param seq a sequence number \return 0 on success -EINVAL when node is NULL an async result

§enum_params: Option<unsafe extern "C" fn(object: *mut c_void, seq: c_int, id: u32, index: u32, max: u32, filter: *const spa_pod) -> c_int>

Enumerate the parameters of a device.

Parameters are identified with an \a id. Some parameters can have multiple values, see the documentation of the parameter id.

Parameters can be filtered by passing a non-NULL \a filter.

The result callback will be called at most \a max times with a struct spa_result_device_params as the result.

This function must be called from the main thread.

\param device a \ref spa_device \param seq a sequence number to pass to the result function \param id the param id to enumerate \param index the index of enumeration, pass 0 for the first item. \param max the maximum number of items to iterate \param filter and optional filter to use \return 0 when there are no more parameters to enumerate -EINVAL when invalid arguments are given -ENOENT the parameter \a id is unknown -ENOTSUP when there are no parameters implemented on \a device

§set_param: Option<unsafe extern "C" fn(object: *mut c_void, id: u32, flags: u32, param: *const spa_pod) -> c_int>

Set the configurable parameter in \a device.

Usually, \a param will be obtained from enum_params and then modified but it is also possible to set another spa_pod as long as its keys and types match a supported object.

Objects with property keys that are not known are ignored.

This function must be called from the main thread.

\param object \ref spa_device \param id the parameter id to configure \param flags additional flags \param param the parameter to configure

\return 0 on success -EINVAL when invalid arguments are given -ENOTSUP when there are no parameters implemented on \a device -ENOENT the parameter is unknown

Trait Implementations§

source§

impl Clone for spa_device_methods

source§

fn clone(&self) -> spa_device_methods

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for spa_device_methods

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for spa_device_methods

source§

fn eq(&self, other: &spa_device_methods) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for spa_device_methods

source§

impl Eq for spa_device_methods

source§

impl StructuralPartialEq for spa_device_methods

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.