capture_messages.go RawHistoryFolder
1package ports
2
3import (
4 "image"
5 "time"
6)
7
8// CaptureRequest transfers ownership of Dst.File to the output goroutine.
9type CaptureRequest struct {
10 ID uint64
11 Output string
12 Region image.Rectangle // clipped output buffer coordinates
13 Cursor bool
14 Dst SHMBuffer
15 Width, Height, Stride int
16 Format uint32
17 // Session is the registered capture session (CaptureSessionOpen) the
18 // request belongs to, 0 for wlr-screencopy. It is informational, except
19 // with Exclude.
20 Session uint64
21 // Exclude asks for a capture without the exclusion's HUD layers and
22 // popups (SceneCapture.Excluded). Wayland sets it, with Session and
23 // CaptureRevision, only on requests of the session that owns the
24 // exclusion. A renderer fails such a request unless its scene's
25 // Capture.Session is Session and Capture.Revision at least
26 // CaptureRevision (CaptureSessionState).
27 Exclude bool
28 CaptureRevision uint64
29 // Workspace is not 0 for the capture of a workspace's frame. On screen
30 // (OffScreen false) it is an ordinary region of the displayed frame, and
31 // fails unless the scene's Capture.Shown is Workspace. OffScreen is set
32 // when the workspace was not on screen when the request was made: it is
33 // served from Scene.CaptureScene, whole (Region is the whole child
34 // image), and fails unless the scene's Capture.Workspace is Workspace.
35 // Either way a workspace that moved since fails instead of returning
36 // another crop.
37 Workspace uint64
38 OffScreen bool
39 // Indicate is set by wayland on every capture it requests: core shows the
40 // capture indicator for it (CaptureFrameTaken), and the output owner
41 // serves the request only from a scene that shows the mark it needs (a
42 // pill for OffScreen, else a border covering Region), so the indicator is
43 // on screen in the same frame as the capture or an earlier one. It holds
44 // the request for a bounded time, then fails it.
45 Indicate bool
46 // Since is when the output owner took the request (monotonic), to bound
47 // that wait. Only the output owner sets it.
48 Since time.Time
49}
50
51// CaptureDone is attempted once after the output closes the destination.
52// Time holds CLOCK_MONOTONIC seconds and nanoseconds since boot, not wall time.
53type CaptureDone struct {
54 ID uint64
55 Output string
56 Err error
57 Time time.Time
58}