pub struct FrameTransform { /* private fields */ }Expand description
A callback over encoded frames, to be attached to a transceiver’s sender/receiver; see the module docs.
This is a registration, not a native object. Attaching it does not take
libwebrtc’s single SetFrameTransformer slot — the crate owns one transformer
per sender and per receiver, and composes this callback with its own
frame-metadata step (see crate::metadata). That is what lets a caller use
encoded-frame access and per-frame metadata on the same transceiver, which a
single slot cannot express.
Attaching the same FrameTransform to more than one sender/receiver shares one
callback, serialised by its mutex.
Implementations§
Source§impl FrameTransform
impl FrameTransform
Sourcepub fn new(
cb: impl for<'a> FnMut(&EncodedFrame<'a>) -> FrameAction + Send + 'static,
) -> Self
pub fn new( cb: impl for<'a> FnMut(&EncodedFrame<'a>) -> FrameAction + Send + 'static, ) -> Self
Create a transform running cb per encoded frame. The closure runs on a
WebRTC thread and must not block it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FrameTransform
impl RefUnwindSafe for FrameTransform
impl Send for FrameTransform
impl Sync for FrameTransform
impl Unpin for FrameTransform
impl UnsafeUnpin for FrameTransform
impl UnwindSafe for FrameTransform
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