pub struct ZcosmicScreencopySessionV2 { /* private fields */ }
Expand description
screen capture session
This object represents an active screencopy session.
After a screencopy session is created, buffer constraint events will be emitted from the compositor to tell the client which buffer types and formats are supported for reading from the session. The compositor may re-send buffer constraint events whenever they change.
The advertise buffer constraints, the compositor must send in no particular order: zero or more shm_format and dmabuf_format events, zero or one dmabuf_device event, and exactly one buffer_size event. Then the compositor must send a done event.
When the client has received all the buffer constraints, it can create a buffer accordingly, attach it to the screencopy session using the attach_buffer request, set the buffer damage using the damage_buffer request and then send the capture request.
See also the Request enum for this interface.
Implementations§
Source§impl ZcosmicScreencopySessionV2
impl ZcosmicScreencopySessionV2
Sourcepub fn buffer_size(&self, width: u32, height: u32)
pub fn buffer_size(&self, width: u32, height: u32)
image source dimensions
Provides the dimensions of the source image in buffer pixel coordinates.
The client must attach buffers that match this size.
Sourcepub fn shm_format(&self, format: u32)
pub fn shm_format(&self, format: u32)
shm buffer format
Provides the format that must be used for shared-memory buffers.
This event may be emitted multiple times, in which case the client may choose any given format.
Sourcepub fn dmabuf_device(&self, device: Vec<u8>)
pub fn dmabuf_device(&self, device: Vec<u8>)
dma-buf device
This event advertises the device buffers must be allocated on for dma-buf buffers.
In general the device is a DRM node. The DRM node type (primary vs. render) is unspecified. Clients must not rely on the compositor sending a particular node type. Clients cannot check two devices for equality by comparing the dev_t value.
Sourcepub fn dmabuf_format(&self, format: u32, modifiers: Vec<u8>)
pub fn dmabuf_format(&self, format: u32, modifiers: Vec<u8>)
dma-buf format
Provides the format that must be used for dma-buf buffers.
The client may choose any of the modifiers advertised in the array of 64-bit unsigned integers.
This event may be emitted multiple times, in which case the client may choose any given format.
Sourcepub fn done(&self)
pub fn done(&self)
all constraints have been sent
This event is sent once when all buffer constraint events have been sent.
The compositor must always end a batch of buffer constraint events with this event, regardless of whether it sends the initial constraints or an update.
Sourcepub fn stopped(&self)
pub fn stopped(&self)
session is no longer available
This event indicates that the capture session has stopped and is no longer available. This can happen in a number of cases, e.g. when the underlying source is destroyed, if the user decides to end the screen capture, or if an unrecoverable runtime error has occurred.
The client should destroy the session after receiving this event.
Trait Implementations§
Source§impl Borrow<ObjectId> for ZcosmicScreencopySessionV2
impl Borrow<ObjectId> for ZcosmicScreencopySessionV2
Source§impl Clone for ZcosmicScreencopySessionV2
impl Clone for ZcosmicScreencopySessionV2
Source§fn clone(&self) -> ZcosmicScreencopySessionV2
fn clone(&self) -> ZcosmicScreencopySessionV2
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ZcosmicScreencopySessionV2
impl Debug for ZcosmicScreencopySessionV2
Source§impl Hash for ZcosmicScreencopySessionV2
impl Hash for ZcosmicScreencopySessionV2
Source§impl PartialEq<Weak<ZcosmicScreencopySessionV2>> for ZcosmicScreencopySessionV2
impl PartialEq<Weak<ZcosmicScreencopySessionV2>> for ZcosmicScreencopySessionV2
Source§impl Resource for ZcosmicScreencopySessionV2
impl Resource for ZcosmicScreencopySessionV2
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 ZcosmicScreencopySessionV2
Auto Trait Implementations§
impl Freeze for ZcosmicScreencopySessionV2
impl !RefUnwindSafe for ZcosmicScreencopySessionV2
impl Send for ZcosmicScreencopySessionV2
impl Sync for ZcosmicScreencopySessionV2
impl Unpin for ZcosmicScreencopySessionV2
impl !UnwindSafe for ZcosmicScreencopySessionV2
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.