pub struct ZcosmicScreencopyFrameV2 { /* private fields */ }
Expand description
screen capture frame
This object represents a screen capture frame.
The client should attach a buffer, damage the buffer, and then send a capture request.
If the screen capture is successful, the compositor will send the frame metadata (transform, damage, presentation_time in any order) followed by the ready event.
If the screen capture fails, the compositor will send the failed event.
See also the Request enum for this interface.
Implementations§
Source§impl ZcosmicScreencopyFrameV2
impl ZcosmicScreencopyFrameV2
Sourcepub fn transform(&self, transform: Transform)
pub fn transform(&self, transform: Transform)
buffer transform
This event is sent before the ready event and holds the transform of the source buffer.
Sourcepub fn damage(&self, x: i32, y: i32, width: i32, height: i32)
pub fn damage(&self, x: i32, y: i32, width: i32, height: i32)
buffer damaged region
This event is sent before the ready event. It may be generated multiple times to describe a region.
The first captured frame in a session will always carry full damage. Subsequent frames’ damaged regions describe which parts of the buffer have changed since the last ready event.
These coordinates originate in the upper left corner of the buffer.
Sourcepub fn presentation_time(&self, tv_sec_hi: u32, tv_sec_lo: u32, tv_nsec: u32)
pub fn presentation_time(&self, tv_sec_hi: u32, tv_sec_lo: u32, tv_nsec: u32)
presentation time of the frame
This event indicates the time at which the frame is presented to the output in system monotonic time. This event is sent before the ready event.
The timestamp is expressed as tv_sec_hi, tv_sec_lo, tv_nsec triples, each component being an unsigned 32-bit value. Whole seconds are in tv_sec which is a 64-bit value combined from tv_sec_hi and tv_sec_lo, and the additional fractional part in tv_nsec as nanoseconds. Hence, for valid timestamps tv_nsec must be in [0, 999999999].
Sourcepub fn ready(&self)
pub fn ready(&self)
frame is available for reading
Called as soon as the frame is copied, indicating it is available for reading.
The buffer may be re-used by the client after this event.
After receiving this event, the client must destroy the object.
Sourcepub fn failed(&self, reason: FailureReason)
pub fn failed(&self, reason: FailureReason)
capture failed
This event indicates that the attempted frame copy has failed.
After receiving this event, the client must destroy the object.
Trait Implementations§
Source§impl Borrow<ObjectId> for ZcosmicScreencopyFrameV2
impl Borrow<ObjectId> for ZcosmicScreencopyFrameV2
Source§impl Clone for ZcosmicScreencopyFrameV2
impl Clone for ZcosmicScreencopyFrameV2
Source§fn clone(&self) -> ZcosmicScreencopyFrameV2
fn clone(&self) -> ZcosmicScreencopyFrameV2
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ZcosmicScreencopyFrameV2
impl Debug for ZcosmicScreencopyFrameV2
Source§impl Hash for ZcosmicScreencopyFrameV2
impl Hash for ZcosmicScreencopyFrameV2
Source§impl PartialEq<Weak<ZcosmicScreencopyFrameV2>> for ZcosmicScreencopyFrameV2
impl PartialEq<Weak<ZcosmicScreencopyFrameV2>> for ZcosmicScreencopyFrameV2
Source§impl PartialEq for ZcosmicScreencopyFrameV2
impl PartialEq for ZcosmicScreencopyFrameV2
Source§impl Resource for ZcosmicScreencopyFrameV2
impl Resource for ZcosmicScreencopyFrameV2
Source§fn object_data(&self) -> Option<&Arc<dyn Any + Send + Sync>>
fn object_data(&self) -> Option<&Arc<dyn Any + Send + Sync>>
Source§fn handle(&self) -> &WeakHandle
fn handle(&self) -> &WeakHandle
Source§fn from_id(conn: &DisplayHandle, id: ObjectId) -> Result<Self, InvalidId>
fn from_id(conn: &DisplayHandle, id: ObjectId) -> Result<Self, InvalidId>
Source§fn send_event(&self, evt: Self::Event<'_>) -> Result<(), InvalidId>
fn send_event(&self, evt: Self::Event<'_>) -> Result<(), InvalidId>
Source§fn parse_request(
conn: &DisplayHandle,
msg: Message<ObjectId, OwnedFd>,
) -> Result<(Self, Self::Request), DispatchError>
fn parse_request( conn: &DisplayHandle, msg: Message<ObjectId, OwnedFd>, ) -> Result<(Self, Self::Request), DispatchError>
Source§fn write_event<'a>(
&self,
conn: &DisplayHandle,
msg: Self::Event<'a>,
) -> Result<Message<ObjectId, BorrowedFd<'a>>, InvalidId>
fn write_event<'a>( &self, conn: &DisplayHandle, msg: Self::Event<'a>, ) -> Result<Message<ObjectId, BorrowedFd<'a>>, InvalidId>
Source§fn is_alive(&self) -> bool
fn is_alive(&self) -> bool
impl Eq for ZcosmicScreencopyFrameV2
Auto Trait Implementations§
impl Freeze for ZcosmicScreencopyFrameV2
impl !RefUnwindSafe for ZcosmicScreencopyFrameV2
impl Send for ZcosmicScreencopyFrameV2
impl Sync for ZcosmicScreencopyFrameV2
impl Unpin for ZcosmicScreencopyFrameV2
impl !UnwindSafe for ZcosmicScreencopyFrameV2
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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
.Source§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
.Source§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.Source§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.