swc_snap

swc_snap

version 2
raw screen capture into client buffers

gives a screen capture capability where the client supplies a wl_shm buffer and the compositor fills it with a raw frame.

destroy
Type: destructor
destroy()
destroy the capture object
capture(buffer: object<wl_buffer>, flags: uint)
Argument
Type
Description
bufferobject<wl_buffer>
client-provided wl_shm buffer to fill
flagsuint
bitmask of swc_snap.flags
capture a frame into a client buffer

captures the current primary screen into the supplied wl_shm buffer. The compositor writes raw pixels and reports ready or failed state

buffer(width: uint, height: uint, format: uint)
Argument
Type
Description
widthuint
heightuint
formatuint
swc_snap.pixel_format value
current capture frame metadata

describes the current frame geometry and pixel format expected by the capture stream

ready(tv_sec: uint, tv_nsec: uint)
Argument
Type
Description
tv_secuint
CLOCK_MONOTONIC seconds
tv_nsecuint
CLOCK_MONOTONIC nanoseconds
capture complete

the requested buffer has been filled and is ready for client

failed(reason: uint)
Argument
Type
Description
reasonuint
swc_snap.failure_reason value
capture failed

the capture request failed, the object still usable and the client may retry with another buffer or after a mode change

flags { overlay_cursor } 
Argument
Value
Description
overlay_cursor1
composite the current cursor into the frame
pixel_format { xrgb8888, argb8888 } 
Argument
Value
Description
xrgb88880
WL_SHM_FORMAT_XRGB8888
argb88881
WL_SHM_FORMAT_ARGB8888
Argument
Value
Description
no_screen0
no captureable screen is available
unsupported_buffer1
buffer is not a wl_shm xrgb/argb8888 buffer
size_mismatch2
buffer dimensions are too small for the screen
internal3
compositor capture failed

Compositor Support

No compositor support found