pub struct StreamRef(/* private fields */);
Implementations§
source§impl StreamRef
impl StreamRef
pub fn as_raw(&self) -> &pw_stream
pub fn as_raw_ptr(&self) -> *mut pw_stream
sourcepub fn add_local_listener_with_user_data<D>(
&self,
user_data: D
) -> ListenerLocalBuilder<'_, D>
pub fn add_local_listener_with_user_data<D>( &self, user_data: D ) -> ListenerLocalBuilder<'_, D>
Add a local listener builder
sourcepub fn add_local_listener<D: Default>(&self) -> ListenerLocalBuilder<'_, D>
pub fn add_local_listener<D: Default>(&self) -> ListenerLocalBuilder<'_, D>
Add a local listener builder. User data is initialized with its default value
sourcepub fn connect(
&self,
direction: Direction,
id: Option<u32>,
flags: StreamFlags,
params: &mut [&Pod]
) -> Result<(), Error>
pub fn connect( &self, direction: Direction, id: Option<u32>, flags: StreamFlags, params: &mut [&Pod] ) -> Result<(), Error>
Connect the stream
Tries to connect to the node id
in the given direction
. If no node
is provided then any suitable node will be used.
sourcepub fn update_params(&self, params: &mut [&Pod]) -> Result<(), Error>
pub fn update_params(&self, params: &mut [&Pod]) -> Result<(), Error>
Update Parameters
Call from the param_changed
callback to negotiate a new set of
parameters for the stream.
sourcepub unsafe fn dequeue_raw_buffer(&self) -> *mut pw_buffer
pub unsafe fn dequeue_raw_buffer(&self) -> *mut pw_buffer
Take a Buffer from the Stream
Removes a buffer from the stream. If this is an input stream the buffer will contain data ready to process. If this is an output stream it can be filled.
§Safety
The pointer returned could be NULL if no buffer is available. The buffer should be returned to the stream once processing is complete.
pub fn dequeue_buffer(&self) -> Option<Buffer<'_>>
sourcepub unsafe fn queue_raw_buffer(&self, buffer: *mut pw_buffer)
pub unsafe fn queue_raw_buffer(&self, buffer: *mut pw_buffer)
Return a Buffer to the Stream
Give back a buffer once processing is complete. Use this to queue up a frame for an output stream, or return the buffer to the pool ready to receive new data for an input stream.
§Safety
The buffer pointer should be one obtained from this stream instance by a call to StreamRef::dequeue_raw_buffer().
sourcepub fn disconnect(&self) -> Result<(), Error>
pub fn disconnect(&self) -> Result<(), Error>
Disconnect the stream
sourcepub fn set_error_cstr(&mut self, res: i32, error: &CStr)
pub fn set_error_cstr(&mut self, res: i32, error: &CStr)
sourcepub fn flush(&self, drain: bool) -> Result<(), Error>
pub fn flush(&self, drain: bool) -> Result<(), Error>
Flush the stream. When drain
is true
, the drained
callback will
be called when all data is played or recorded.
pub fn set_control(&self, id: u32, values: &[f32]) -> Result<(), Error>
sourcepub fn state(&self) -> StreamState
pub fn state(&self) -> StreamState
Get the current state of the stream.
sourcepub fn properties(&self) -> &PropertiesRef
pub fn properties(&self) -> &PropertiesRef
Get the properties of the stream.