pub(crate) struct FramebufferGrab {
pub fb: SharedFramebuffer,
pending: Vec<Vec<u64>>,
drawn: Vec<u64>,
carry: Vec<u64>,
}Expand description
The capture’s watch, the tiles each pool surface is missing (module docblock), and those
drawn since the last frame said where it changed (changed).
A frame’s change is the tiles its read took from the watch: a read takes them before it
copies, and again before each copy it repeats, so every tile it took is in the surface. A
tile the server draws after the read is left in the watch for the frame that will hold it,
since a change named with a frame that does not hold it is never named with the one that
does, and an encoder told the tile held still then keeps the stale picture until the tile
is drawn again. A surface grabbed through XShm instead (Self::grabbed) takes the watch
after the server answered, so a tile drawn in between is named with that frame and the
next, which is the first that holds it.
Fields§
§fb: SharedFramebuffer§pending: Vec<Vec<u64>>§drawn: Vec<u64>§carry: Vec<u64>The tiles the last XShm grab took, named again with the frame after it.
Implementations§
Source§impl FramebufferGrab
impl FramebufferGrab
Sourcepub(crate) fn new(fb: SharedFramebuffer, surfaces: usize) -> Self
pub(crate) fn new(fb: SharedFramebuffer, surfaces: usize) -> Self
A grab for surfaces pool surfaces, each missing the whole screen.
Sourcefn take(&mut self)
fn take(&mut self)
Take the tiles drawn since the last take into every surface’s and into drawn.
Sourcepub(crate) fn changed(
&mut self,
(x, y, width, height): (u32, u32, u32, u32),
) -> Vec<Rectangle<i32, Physical>>
pub(crate) fn changed( &mut self, (x, y, width, height): (u32, u32, u32, u32), ) -> Vec<Rectangle<i32, Physical>>
Where the frame just read differs from the one before, within the region at (x, y)
of width x height, in its coordinates: a rectangle a run of tiles along a row of
them. The tiles are those the reads since the last call took (the type’s docblock), so
this is called once after each frame’s read.
Sourcepub(crate) fn invalidate(&mut self)
pub(crate) fn invalidate(&mut self)
Mark the whole screen missing from every surface and drawn since the last frame (a region moved, the surfaces were recreated): the next frame differs from the one before wherever it lies, which no drawing reported.
Sourcepub(crate) fn overlaid(
&mut self,
idx: usize,
x: i32,
y: i32,
width: i32,
height: i32,
)
pub(crate) fn overlaid( &mut self, idx: usize, x: i32, y: i32, width: i32, height: i32, )
Mark the area at (x, y), width x height, in screen coordinates, missing from
surface idx: an overlay drawn onto it.
Sourcepub(crate) fn read(
&mut self,
idx: usize,
dst: &mut [u8],
dst_stride: usize,
region: (u32, u32, u32, u32),
) -> bool
pub(crate) fn read( &mut self, idx: usize, dst: &mut [u8], dst_stride: usize, region: (u32, u32, u32, u32), ) -> bool
Bring surface idx (dst, dst_stride bytes a row) up to the screen over the region at
(x, y) of width x height: false where no whole read came in READ_ATTEMPTS, or
the region runs past the framebuffer (a resize the capture has not followed yet), the
surface left to an XShm grab, which Self::grabbed then records.
Sourcepub(crate) fn convert(
&mut self,
idx: usize,
planes: &mut Nv12Planes,
region: (u32, u32, u32, u32),
bands: usize,
) -> bool
pub(crate) fn convert( &mut self, idx: usize, planes: &mut Nv12Planes, region: (u32, u32, u32, u32), bands: usize, ) -> bool
Self::read into the planes of surface idx (planes) instead of its pixels: the
tiles it misses converted from the screen under the same drawing count, false where no
whole conversion came in READ_ATTEMPTS or the region is not one the planes can hold
(an odd edge, planes of another size, past the framebuffer, or a last row that starts
inside it and so ends short of a whole stride).
Auto Trait Implementations§
impl !Send for FramebufferGrab
impl !Sync for FramebufferGrab
impl Freeze for FramebufferGrab
impl RefUnwindSafe for FramebufferGrab
impl Unpin for FramebufferGrab
impl UnsafeUnpin for FramebufferGrab
impl UnwindSafe for FramebufferGrab
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