struct RawFrame {
idx: usize,
ptr: *mut u8,
len: usize,
width: u16,
height: u16,
stride: usize,
generation: u64,
captured_ns: i64,
changed: Vec<Rectangle<i32, Physical>>,
complete: bool,
planes: Option<*const Nv12Planes>,
}Expand description
A captured raw BGRA frame held in a pooled shm surface, ready to encode.
It carries the surface pointer plus geometry so the encode thread reads the pixels directly (no
copy) and can rebuild its pipeline when the capture size changed (auto-adjust). It also carries
the pool’s surface generation, so a rebuild is still triggered when the surfaces were recreated
at the SAME size (a resize flap) and the new segments happen to reuse the old virtual addresses.
Fields§
§idx: usize§ptr: *mut u8§len: usize§width: u16§height: u16§stride: usize§generation: u64§captured_ns: i64CLOCK_MONOTONIC nanoseconds at which the pixels were in hand.
changed: Vec<Rectangle<i32, Physical>>Where the frame changed since the one before, in its own coordinates, as the server reported it and the overlays moved; empty where the server cannot say.
complete: boolWhether changed holds every change: the shared framebuffer’s watch, which the server
fills as it draws (X11Pipeline::process_reported), where XDamage can miss directly
rendered GL.
planes: Option<*const Nv12Planes>The frame’s picture where the capture converted it from the shared framebuffer instead of
copying its pixels (the Nv12Planes of the surface’s index), which ptr then does not
hold.
Trait Implementations§
impl Send for RawFrame
RawFrame is Send: its raw pointer addresses a pooled shm surface that the pool
guarantees is not reused until the encode thread recycles this frame, so the handle is safe to
move across the capture -> encode thread boundary.
Auto Trait Implementations§
impl !Sync for RawFrame
impl Freeze for RawFrame
impl RefUnwindSafe for RawFrame
impl Unpin for RawFrame
impl UnsafeUnpin for RawFrame
impl UnwindSafe for RawFrame
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more