pub struct AppSourceHandle { /* private fields */ }Expand description
A cheaply-cloneable handle for pushing buffers into an AppSource
from any thread — Clone is just two refcount bumps (name and the
channel sender are both cheap to share).
Implementations§
Source§impl AppSourceHandle
impl AppSourceHandle
pub fn name(&self) -> Arc<str> ⓘ
Sourcepub fn push(&self, buf: MediaBuffer) -> Result<()>
pub fn push(&self, buf: MediaBuffer) -> Result<()>
Blocks until there’s room in the channel, or AppSource (every
clone of it, e.g. after its Pipeline finished) is gone.
Sourcepub fn try_push(&self, buf: MediaBuffer) -> Result<bool>
pub fn try_push(&self, buf: MediaBuffer) -> Result<bool>
Non-blocking push, for a live producer where falling behind
matters more than losing a buffer — e.g. a camera callback that
can’t afford to stall. Ok(false) (not an error) means the
channel was full and buf was not sent; Err only means
AppSource itself is gone.
Trait Implementations§
Source§impl Clone for AppSourceHandle
impl Clone for AppSourceHandle
Source§fn clone(&self) -> AppSourceHandle
fn clone(&self) -> AppSourceHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AppSourceHandle
impl RefUnwindSafe for AppSourceHandle
impl Send for AppSourceHandle
impl Sync for AppSourceHandle
impl Unpin for AppSourceHandle
impl UnsafeUnpin for AppSourceHandle
impl UnwindSafe for AppSourceHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more