Struct StreamRc

Source
pub struct StreamRc { /* private fields */ }

Implementations§

Source§

impl StreamRc

Source

pub fn new( core: CoreRc, name: &str, properties: PropertiesBox, ) -> Result<StreamRc, Error>

Source

pub fn new_cstr( core: CoreRc, name: &CStr, properties: PropertiesBox, ) -> Result<StreamRc, Error>

Initialises a new stream with the given name as C String and properties.

Source

pub fn downgrade(&self) -> StreamWeak

Methods from Deref<Target = Stream>§

Source

pub fn as_raw(&self) -> &pw_stream

Source

pub fn as_raw_ptr(&self) -> *mut pw_stream

Source

pub fn add_local_listener_with_user_data<D>( &self, user_data: D, ) -> ListenerLocalBuilder<'_, D>

Add a local listener builder

Source

pub fn add_local_listener<D: Default>(&self) -> ListenerLocalBuilder<'_, D>

Add a local listener builder. User data is initialized with its default value

Source

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.

Source

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.

Source

pub fn set_active(&self, active: bool) -> Result<(), Error>

Activate or deactivate the stream

Source

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.

Source

pub fn dequeue_buffer(&self) -> Option<Buffer<'_>>

Source

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 Self::dequeue_raw_buffer().

Source

pub fn disconnect(&self) -> Result<(), Error>

Disconnect the stream

Source

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.

Source

pub fn set_control(&self, id: u32, values: &[f32]) -> Result<(), Error>

Source

pub fn name(&self) -> String

Get the name of the stream.

Source

pub fn state(&self) -> StreamState

Get the current state of the stream.

Source

pub fn properties(&self) -> &Properties

Get the properties of the stream.

Source

pub fn node_id(&self) -> u32

Get the node ID of the stream.

Trait Implementations§

Source§

impl AsRef<Stream> for StreamRc

Source§

fn as_ref(&self) -> &Stream

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for StreamRc

Source§

fn clone(&self) -> StreamRc

Returns a duplicate 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 StreamRc

Source§

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

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

impl Deref for StreamRc

Source§

type Target = Stream

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

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>,

Source§

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>,

Source§

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.