Struct pipewire_wrapper::filter::FilterRef
source · #[repr(transparent)]pub struct FilterRef<T> { /* private fields */ }
Expand description
Wrapper for the external pw_sys::pw_filter value. The filter object provides a convenient way to implement processing filters.
Implementations§
source§impl<T> FilterRef<T>
impl<T> FilterRef<T>
pub fn get_state_and_error(&self) -> (FilterState, Option<CString>)
pub fn get_state(&self) -> FilterState
pub fn get_error(&self) -> Option<CString>
pub fn get_name(&self) -> Option<&CStr>
pub fn get_core(&self) -> &CoreRef
sourcepub fn connect(&self, flags: FilterFlags, params: &[&PodRef]) -> Result<()>
pub fn connect(&self, flags: FilterFlags, params: &[&PodRef]) -> Result<()>
Connect a filter for processing.
pub fn get_node_id(&self) -> u32
sourcepub fn disconnect(&self) -> Result<()>
pub fn disconnect(&self) -> Result<()>
Disconnect the filter and stop processing.
sourcepub unsafe fn add_port(
&self,
direction: Direction,
flags: PortFlags,
props: Properties,
params: Option<&[&PodRef]>
) -> Result<*mut *mut T>
pub unsafe fn add_port( &self, direction: Direction, flags: PortFlags, props: Properties, params: Option<&[&PodRef]> ) -> Result<*mut *mut T>
sourcepub unsafe fn get_properties(&self, port: *mut *mut T) -> &PropertiesRef
pub unsafe fn get_properties(&self, port: *mut *mut T) -> &PropertiesRef
Get port properties or global properties when port
is null
Safety
port
is a pointer to the port structure and it should not be modified.
sourcepub unsafe fn update_properties(
&self,
port: *mut *mut T,
properties: &DictRef
) -> i32
pub unsafe fn update_properties( &self, port: *mut *mut T, properties: &DictRef ) -> i32
Update port properties or global properties when port
is null
.
Safety
port
is a pointer to the port structure and it should not be modified.
pub fn set_error(&self, res: i32, error: &CStr)
sourcepub unsafe fn update_params(
&self,
port: *mut *mut T,
params: &[&PodRef]
) -> Result<()>
pub unsafe fn update_params( &self, port: *mut *mut T, params: &[&PodRef] ) -> Result<()>
Update port parameters or global parameters when port
is null
.
Safety
port
is a pointer to the port structure and it should not be modified.
sourcepub unsafe fn dequeue_buffer(&self, port: *mut *mut T) -> Option<&mut BufferRef>
pub unsafe fn dequeue_buffer(&self, port: *mut *mut T) -> Option<&mut BufferRef>
Get a buffer that can be filled for output ports or consumed for input ports.
Safety
port
is a pointer to the port structure and it should not be modified.
sourcepub unsafe fn queue_buffer(
&self,
port: *mut *mut T,
buffer: &BufferRef
) -> Result<()>
pub unsafe fn queue_buffer( &self, port: *mut *mut T, buffer: &BufferRef ) -> Result<()>
Submit a buffer for playback or recycle a buffer for capture.
Safety
port
is a pointer to the port structure and it should not be modified.
sourcepub unsafe fn get_dsp_buffer<S: Sized>(
&self,
port: *mut *mut T,
n_samples: u32
) -> Result<&mut [S]>
pub unsafe fn get_dsp_buffer<S: Sized>( &self, port: *mut *mut T, n_samples: u32 ) -> Result<&mut [S]>
Get a data pointer to the buffer data.
Safety
port
is a pointer to the port structure and it should not be modified.
sourcepub fn set_active(&self, active: bool) -> Result<()>
pub fn set_active(&self, active: bool) -> Result<()>
Activate or deactivate the filter