Skip to main content

ReceiverControls

Struct ReceiverControls 

Source
pub struct ReceiverControls<'a, M: ReceiverMode> { /* private fields */ }
Expand description

Exclusive controls for a receiver held by another resource.

FrameSync and AVSync depend on one particular native receiver. Their controls() methods lend this view instead of a mutable receiver, so it cannot be replaced while those resources exist. Allocator owners lend this view too; their registrations independently retain the original receiver core. Ordinary shared controls remain available through the owner’s receiver() method, or Self::receiver.

The view allocates nothing and stays on its borrowing thread (!Send and !Sync). This keeps exclusive stream changes sequenced with split capture; the SDK does not document their overlap across application threads. Its exclusive borrow prevents changing streams or starting a second KVM session while a session is live. Use the synchronizer’s split() method to keep capturing synchronized output during a KVM session.

Implementations§

Source§

impl<'a, M: ReceiverMode> ReceiverControls<'a, M>

Source

pub fn receiver(&self) -> &Receiver<M>

The receiver for shared controls and the capture allowed by its mode. This borrow never permits replacement or recovery of the receiver.

Source

pub fn set_stream_tier(&mut self, tier: StreamTier) -> Result<SettingChange>

Switch between program and preview; see Receiver::set_stream_tier. This makes the same synchronous native call without allocating.

§Errors

As for Receiver::set_stream_tier. A refused or redundant change remains SettingChange::Unchanged.

Source

pub fn set_streams(&mut self, streams: MediaTypes) -> Result<SettingChange>

Choose the enabled media; see Receiver::set_streams. This makes the same synchronous native call without allocating. It does not promise to flush a synchronizer’s cached output or format.

§Errors

As for Receiver::set_streams. A refused or redundant change remains SettingChange::Unchanged.

Source

pub fn kvm(self) -> Result<KvmSession<'a, M>>

Start KVM, retaining this view’s exclusive receiver borrow.

This consumes the view, so a temporary owner.controls() can create a session lasting until it is dropped. Session creation allocates nothing; holding inputs can allocate for tracking. To change source, successfully release all inputs and end the session first. Its restricted receiver view cannot change the connection.

§Errors

As for Receiver::kvm.

Trait Implementations§

Source§

impl<M: ReceiverMode> Debug for ReceiverControls<'_, M>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, M> !Send for ReceiverControls<'a, M>

§

impl<'a, M> !Sync for ReceiverControls<'a, M>

§

impl<'a, M> !UnwindSafe for ReceiverControls<'a, M>

§

impl<'a, M> Freeze for ReceiverControls<'a, M>

§

impl<'a, M> RefUnwindSafe for ReceiverControls<'a, M>
where M: RefUnwindSafe,

§

impl<'a, M> Unpin for ReceiverControls<'a, M>

§

impl<'a, M> UnsafeUnpin for ReceiverControls<'a, M>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.