Skip to main content

FramebufferGrab

Struct FramebufferGrab 

Source
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

Source

pub(crate) fn new(fb: SharedFramebuffer, surfaces: usize) -> Self

A grab for surfaces pool surfaces, each missing the whole screen.

Source

fn take(&mut self)

Take the tiles drawn since the last take into every surface’s and into drawn.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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).

Source

pub(crate) fn grabbed(&mut self, idx: usize)

Surface idx was grabbed whole through XShm: it misses nothing drawn before the server answered. The tiles taken here may have been drawn after that answer, so they stay missing from the surface and are named with the next frame as well (carry).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more