pub struct ZwlrScreencopyFrameV1 { /* private fields */ }
server
only.Expand description
a frame ready for copy
This object represents a single frame.
When created, a series of buffer events will be sent, each representing a supported buffer type. The “buffer_done” event is sent afterwards to indicate that all supported buffer types have been enumerated. The client will then be able to send a “copy” request. If the capture is successful, the compositor will send a “flags” followed by a “ready” event.
For objects version 2 or lower, wl_shm buffers are always supported, ie. the “buffer” event is guaranteed to be sent.
If the capture failed, the “failed” event is sent. This can happen anytime before the “ready” event.
Once either a “ready” or a “failed” event is received, the client should destroy the frame.
See also the Request enum for this interface.
Implementations§
source§impl ZwlrScreencopyFrameV1
impl ZwlrScreencopyFrameV1
sourcepub fn buffer(&self, format: Format, width: u32, height: u32, stride: u32)
pub fn buffer(&self, format: Format, width: u32, height: u32, stride: u32)
wl_shm buffer information
Provides information about wl_shm buffer parameters that need to be used for this frame. This event is sent once after the frame is created if wl_shm buffers are supported.
sourcepub fn flags(&self, flags: Flags)
pub fn flags(&self, flags: Flags)
frame flags
Provides flags about the frame. This event is sent once before the “ready” event.
sourcepub fn ready(&self, tv_sec_hi: u32, tv_sec_lo: u32, tv_nsec: u32)
pub fn ready(&self, tv_sec_hi: u32, tv_sec_lo: u32, tv_nsec: u32)
indicates frame is available for reading
Called as soon as the frame is copied, indicating it is available for reading. This event includes the time at which presentation happened at.
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]. The seconds part may have an arbitrary offset at start.
After receiving this event, the client should destroy the object.
sourcepub fn failed(&self)
pub fn failed(&self)
frame copy failed
This event indicates that the attempted frame copy has failed.
After receiving this event, the client should destroy the object.
sourcepub fn damage(&self, x: u32, y: u32, width: u32, height: u32)
pub fn damage(&self, x: u32, y: u32, width: u32, height: u32)
carries the coordinates of the damaged region
This event is sent right before the ready event when copy_with_damage is requested. It may be generated multiple times for each copy_with_damage request.
The arguments describe a box around an area that has changed since the last copy request that was derived from the current screencopy manager instance.
The union of all regions received between the call to copy_with_damage and a ready event is the total damage since the prior ready event.
sourcepub fn linux_dmabuf(&self, format: u32, width: u32, height: u32)
pub fn linux_dmabuf(&self, format: u32, width: u32, height: u32)
linux-dmabuf buffer information
Provides information about linux-dmabuf buffer parameters that need to be used for this frame. This event is sent once after the frame is created if linux-dmabuf buffers are supported.
sourcepub fn buffer_done(&self)
pub fn buffer_done(&self)
all buffer types reported
This event is sent once after all buffer events have been sent.
The client should proceed to create a buffer of one of the supported types, and send a “copy” request.
Trait Implementations§
source§impl Borrow<ObjectId> for ZwlrScreencopyFrameV1
impl Borrow<ObjectId> for ZwlrScreencopyFrameV1
source§impl Clone for ZwlrScreencopyFrameV1
impl Clone for ZwlrScreencopyFrameV1
source§fn clone(&self) -> ZwlrScreencopyFrameV1
fn clone(&self) -> ZwlrScreencopyFrameV1
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ZwlrScreencopyFrameV1
impl Debug for ZwlrScreencopyFrameV1
source§impl Hash for ZwlrScreencopyFrameV1
impl Hash for ZwlrScreencopyFrameV1
source§impl PartialEq for ZwlrScreencopyFrameV1
impl PartialEq for ZwlrScreencopyFrameV1
source§impl Resource for ZwlrScreencopyFrameV1
impl Resource for ZwlrScreencopyFrameV1
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 ZwlrScreencopyFrameV1
Auto Trait Implementations§
impl Freeze for ZwlrScreencopyFrameV1
impl !RefUnwindSafe for ZwlrScreencopyFrameV1
impl Send for ZwlrScreencopyFrameV1
impl Sync for ZwlrScreencopyFrameV1
impl Unpin for ZwlrScreencopyFrameV1
impl !UnwindSafe for ZwlrScreencopyFrameV1
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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.