1<?xml version="1.0" encoding="UTF-8"?>
2<protocol name="wlr_screencopy_unstable_v1">
3 <copyright>
4 Copyright © 2018 Simon Ser
5 Copyright © 2019 Andri Yngvason
6
7 Permission is hereby granted, free of charge, to any person obtaining a
8 copy of this software and associated documentation files (the "Software"),
9 to deal in the Software without restriction, including without limitation
10 the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 and/or sell copies of the Software, and to permit persons to whom the
12 Software is furnished to do so, subject to the following conditions:
13
14 The above copyright notice and this permission notice (including the next
15 paragraph) shall be included in all copies or substantial portions of the
16 Software.
17
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24 DEALINGS IN THE SOFTWARE.
25 </copyright>
26
27 <description summary="screen content capturing on client buffers">
28 This protocol allows clients to ask the compositor to copy part of the
29 screen content to a client buffer.
30
31 Warning! The protocol described in this file is experimental and
32 backward incompatible changes may be made. Backward compatible changes
33 may be added together with the corresponding interface version bump.
34 Backward incompatible changes are done by bumping the version number in
35 the protocol and interface names and resetting the interface version.
36 Once the protocol is to be declared stable, the 'z' prefix and the
37 version number in the protocol and interface names are removed and the
38 interface version number is reset.
39
40 Note! This protocol is deprecated and not intended for production use.
41 The ext-image-copy-capture-v1 protocol should be used instead.
42 </description>
43
44 <interface name="zwlr_screencopy_manager_v1" version="3">
45 <description summary="manager to inform clients and begin capturing">
46 This object is a manager which offers requests to start capturing from a
47 source.
48 </description>
49
50 <request name="capture_output">
51 <description summary="capture an output">
52 Capture the next frame of an entire output.
53 </description>
54 <arg name="frame" type="new_id" interface="zwlr_screencopy_frame_v1"/>
55 <arg name="overlay_cursor" type="int"
56 summary="composite cursor onto the frame"/>
57 <arg name="output" type="object" interface="wl_output"/>
58 </request>
59
60 <request name="capture_output_region">
61 <description summary="capture an output's region">
62 Capture the next frame of an output's region.
63
64 The region is given in output logical coordinates, see
65 xdg_output.logical_size. The region will be clipped to the output's
66 extents.
67 </description>
68 <arg name="frame" type="new_id" interface="zwlr_screencopy_frame_v1"/>
69 <arg name="overlay_cursor" type="int"
70 summary="composite cursor onto the frame"/>
71 <arg name="output" type="object" interface="wl_output"/>
72 <arg name="x" type="int"/>
73 <arg name="y" type="int"/>
74 <arg name="width" type="int"/>
75 <arg name="height" type="int"/>
76 </request>
77
78 <request name="destroy" type="destructor">
79 <description summary="destroy the manager">
80 All objects created by the manager will still remain valid, until their
81 appropriate destroy request has been called.
82 </description>
83 </request>
84 </interface>
85
86 <interface name="zwlr_screencopy_frame_v1" version="3">
87 <description summary="a frame ready for copy">
88 This object represents a single frame.
89
90 When created, a series of buffer events will be sent, each representing a
91 supported buffer type. The "buffer_done" event is sent afterwards to
92 indicate that all supported buffer types have been enumerated. The client
93 will then be able to send a "copy" request. If the capture is successful,
94 the compositor will send a "flags" event followed by a "ready" event.
95
96 For objects version 2 or lower, wl_shm buffers are always supported, ie.
97 the "buffer" event is guaranteed to be sent.
98
99 If the capture failed, the "failed" event is sent. This can happen anytime
100 before the "ready" event.
101
102 Once either a "ready" or a "failed" event is received, the client should
103 destroy the frame.
104 </description>
105
106 <event name="buffer">
107 <description summary="wl_shm buffer information">
108 Provides information about wl_shm buffer parameters that need to be
109 used for this frame. This event is sent once after the frame is created
110 if wl_shm buffers are supported.
111 </description>
112 <arg name="format" type="uint" enum="wl_shm.format" summary="buffer format"/>
113 <arg name="width" type="uint" summary="buffer width"/>
114 <arg name="height" type="uint" summary="buffer height"/>
115 <arg name="stride" type="uint" summary="buffer stride"/>
116 </event>
117
118 <request name="copy">
119 <description summary="copy the frame">
120 Copy the frame to the supplied buffer. The buffer must have the
121 correct size, see zwlr_screencopy_frame_v1.buffer and
122 zwlr_screencopy_frame_v1.linux_dmabuf. The buffer needs to have a
123 supported format.
124
125 If the frame is successfully copied, "flags" and "ready" events are
126 sent. Otherwise, a "failed" event is sent.
127 </description>
128 <arg name="buffer" type="object" interface="wl_buffer"/>
129 </request>
130
131 <enum name="error">
132 <entry name="already_used" value="0"
133 summary="the object has already been used to copy a wl_buffer"/>
134 <entry name="invalid_buffer" value="1"
135 summary="buffer attributes are invalid"/>
136 </enum>
137
138 <enum name="flags" bitfield="true">
139 <entry name="y_invert" value="1" summary="contents are y-inverted"/>
140 </enum>
141
142 <event name="flags">
143 <description summary="frame flags">
144 Provides flags about the frame. This event is sent once before the
145 "ready" event.
146 </description>
147 <arg name="flags" type="uint" enum="flags" summary="frame flags"/>
148 </event>
149
150 <event name="ready">
151 <description summary="indicates frame is available for reading">
152 Called as soon as the frame is copied, indicating it is available
153 for reading. This event includes the time at which the presentation took place.
154
155 The timestamp is expressed as tv_sec_hi, tv_sec_lo, tv_nsec triples,
156 each component being an unsigned 32-bit value. Whole seconds are in
157 tv_sec which is a 64-bit value combined from tv_sec_hi and tv_sec_lo,
158 and the additional fractional part in tv_nsec as nanoseconds. Hence,
159 for valid timestamps tv_nsec must be in [0, 999999999]. The seconds part
160 may have an arbitrary offset at start.
161
162 After receiving this event, the client should destroy the object.
163 </description>
164 <arg name="tv_sec_hi" type="uint"
165 summary="high 32 bits of the seconds part of the timestamp"/>
166 <arg name="tv_sec_lo" type="uint"
167 summary="low 32 bits of the seconds part of the timestamp"/>
168 <arg name="tv_nsec" type="uint"
169 summary="nanoseconds part of the timestamp"/>
170 </event>
171
172 <event name="failed">
173 <description summary="frame copy failed">
174 This event indicates that the attempted frame copy has failed.
175
176 After receiving this event, the client should destroy the object.
177 </description>
178 </event>
179
180 <request name="destroy" type="destructor">
181 <description summary="delete this object, used or not">
182 Destroys the frame. This request can be sent at any time by the client.
183 </description>
184 </request>
185
186 <!-- Version 2 additions -->
187 <request name="copy_with_damage" since="2">
188 <description summary="copy the frame when it's damaged">
189 Same as copy, except it waits until there is damage to copy.
190 </description>
191 <arg name="buffer" type="object" interface="wl_buffer"/>
192 </request>
193
194 <event name="damage" since="2">
195 <description summary="carries the coordinates of the damaged region">
196 This event is sent right before the ready event when copy_with_damage is
197 requested. It may be generated multiple times for each copy_with_damage
198 request.
199
200 The arguments describe a box around an area that has changed since the
201 last copy request that was derived from the current screencopy manager
202 instance.
203
204 The union of all regions received between the call to copy_with_damage
205 and a ready event is the total damage since the prior ready event.
206 </description>
207 <arg name="x" type="uint" summary="damaged x coordinates"/>
208 <arg name="y" type="uint" summary="damaged y coordinates"/>
209 <arg name="width" type="uint" summary="current width"/>
210 <arg name="height" type="uint" summary="current height"/>
211 </event>
212
213 <!-- Version 3 additions -->
214 <event name="linux_dmabuf" since="3">
215 <description summary="linux-dmabuf buffer information">
216 Provides information about linux-dmabuf buffer parameters that need to
217 be used for this frame. This event is sent once after the frame is
218 created if linux-dmabuf buffers are supported.
219 </description>
220 <arg name="format" type="uint" summary="fourcc pixel format"/>
221 <arg name="width" type="uint" summary="buffer width"/>
222 <arg name="height" type="uint" summary="buffer height"/>
223 </event>
224
225 <event name="buffer_done" since="3">
226 <description summary="all buffer types reported">
227 This event is sent once after all buffer events have been sent.
228
229 The client should proceed to create a buffer of one of the supported
230 types, and send a "copy" request.
231 </description>
232 </event>
233 </interface>
234</protocol>