pub struct AdaptedSource<S: SceneSource> { /* private fields */ }Expand description
Source wrapper that converts every emitted frame to a target pixel format.
Overrides the reported SourceFormat so the downstream sink’s
init() sees the adapted canvas, not the scene’s native one.
Cheap when the formats already match (the adapter short-circuits
in adapt_frame_to).
Implementations§
Source§impl<S: SceneSource> AdaptedSource<S>
impl<S: SceneSource> AdaptedSource<S>
Sourcepub fn new(inner: S, target: PixelFormat) -> Self
pub fn new(inner: S, target: PixelFormat) -> Self
Wrap inner, converting every pulled frame to target. Use
this when a sink accepts a specific pixel format that differs
from the scene’s canvas (e.g. RGB24 for a JPEG writer while
the scene composes in YUV420P).
Trait Implementations§
Source§impl<S: SceneSource> SceneSource for AdaptedSource<S>
impl<S: SceneSource> SceneSource for AdaptedSource<S>
Source§fn format(&self) -> SourceFormat
fn format(&self) -> SourceFormat
Declared format. Constant across a session.
Auto Trait Implementations§
impl<S> Freeze for AdaptedSource<S>where
S: Freeze,
impl<S> RefUnwindSafe for AdaptedSource<S>where
S: RefUnwindSafe,
impl<S> Send for AdaptedSource<S>where
S: Send,
impl<S> Sync for AdaptedSource<S>where
S: Sync,
impl<S> Unpin for AdaptedSource<S>where
S: Unpin,
impl<S> UnsafeUnpin for AdaptedSource<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for AdaptedSource<S>where
S: UnwindSafe,
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