Skip to content

ext_image_copy_capture_session_v1¤

wayland.ext_image_copy_capture_session_v1 ¤

Image copy capture session

This object represents an active image copy capture session.

After a capture 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.

To 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 capture session using the attach_buffer request, set the buffer damage using the damage_buffer request and then send the capture request.

Methods:

error ¤

events

buffer_size ¤

buffer_size(width: int, height: int) -> None

Image capture source dimensions

Provides the dimensions of the source image in buffer pixel coordinates.

The client must attach buffers that match this size.

Parameters:

  • width ¤

    (int) –

    Buffer width

  • height ¤

    (int) –

    Buffer height

shm_format ¤

shm_format(format: format) -> None

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.

Parameters:

dmabuf_device ¤

dmabuf_device(device: list) -> None

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.

Parameters:

  • device ¤

    (list) –

    Device dev_t value

dmabuf_format ¤

dmabuf_format(format: int, modifiers: list) -> None

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.

Parameters:

  • format ¤

    (int) –

    Drm format code

  • modifiers ¤

    (list) –

    Drm format modifiers

done ¤

done() -> None

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.

stopped ¤

stopped() -> None

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 image capture, or if an unrecoverable runtime error has occurred.

The client should destroy the session after receiving this event.

create_frame ¤

Create a frame

Create a capture frame for this session.

At most one frame object can exist for a given session at any time. If a client sends a create_frame request before a previous frame object has been destroyed, the duplicate_frame protocol error is raised.

Returns:

destroy ¤

destroy() -> None

Delete this object

Destroys the session. This request can be sent at any time by the client.

This request doesn't affect ext_image_copy_capture_frame_v1 objects created by this object.

on_buffer_size ¤

on_buffer_size(width: int, height: int) -> None

Image capture source dimensions.

Override to handle wayland.ext_image_copy_capture_session_v1.events.buffer_size.

on_shm_format ¤

on_shm_format(format: format) -> None

Shm buffer format.

Override to handle wayland.ext_image_copy_capture_session_v1.events.shm_format.

on_dmabuf_device ¤

on_dmabuf_device(device: list) -> None

on_dmabuf_format ¤

on_dmabuf_format(format: int, modifiers: list) -> None

on_done ¤

on_done() -> None

All constraints have been sent.

Override to handle wayland.ext_image_copy_capture_session_v1.events.done.

on_stopped ¤

on_stopped() -> None

Session is no longer available.

Override to handle wayland.ext_image_copy_capture_session_v1.events.stopped.