By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

 wlr-screencopy.xml

View raw Download
text/xml • 9.92 kiB
XML 1.0 document, Unicode text, UTF-8 text
        
            
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
</description>
40
41
<interface name="zwlr_screencopy_manager_v1" version="3">
42
<description summary="manager to inform clients and begin capturing">
43
This object is a manager which offers requests to start capturing from a
44
source.
45
</description>
46
47
<request name="capture_output">
48
<description summary="capture an output">
49
Capture the next frame of an entire output.
50
</description>
51
<arg name="frame" type="new_id" interface="zwlr_screencopy_frame_v1"/>
52
<arg name="overlay_cursor" type="int"
53
summary="composite cursor onto the frame"/>
54
<arg name="output" type="object" interface="wl_output"/>
55
</request>
56
57
<request name="capture_output_region">
58
<description summary="capture an output's region">
59
Capture the next frame of an output's region.
60
61
The region is given in output logical coordinates, see
62
xdg_output.logical_size. The region will be clipped to the output's
63
extents.
64
</description>
65
<arg name="frame" type="new_id" interface="zwlr_screencopy_frame_v1"/>
66
<arg name="overlay_cursor" type="int"
67
summary="composite cursor onto the frame"/>
68
<arg name="output" type="object" interface="wl_output"/>
69
<arg name="x" type="int"/>
70
<arg name="y" type="int"/>
71
<arg name="width" type="int"/>
72
<arg name="height" type="int"/>
73
</request>
74
75
<request name="destroy" type="destructor">
76
<description summary="destroy the manager">
77
All objects created by the manager will still remain valid, until their
78
appropriate destroy request has been called.
79
</description>
80
</request>
81
</interface>
82
83
<interface name="zwlr_screencopy_frame_v1" version="3">
84
<description summary="a frame ready for copy">
85
This object represents a single frame.
86
87
When created, a series of buffer events will be sent, each representing a
88
supported buffer type. The "buffer_done" event is sent afterwards to
89
indicate that all supported buffer types have been enumerated. The client
90
will then be able to send a "copy" request. If the capture is successful,
91
the compositor will send a "flags" event followed by a "ready" event.
92
93
For objects version 2 or lower, wl_shm buffers are always supported, ie.
94
the "buffer" event is guaranteed to be sent.
95
96
If the capture failed, the "failed" event is sent. This can happen anytime
97
before the "ready" event.
98
99
Once either a "ready" or a "failed" event is received, the client should
100
destroy the frame.
101
</description>
102
103
<event name="buffer">
104
<description summary="wl_shm buffer information">
105
Provides information about wl_shm buffer parameters that need to be
106
used for this frame. This event is sent once after the frame is created
107
if wl_shm buffers are supported.
108
</description>
109
<arg name="format" type="uint" enum="wl_shm.format" summary="buffer format"/>
110
<arg name="width" type="uint" summary="buffer width"/>
111
<arg name="height" type="uint" summary="buffer height"/>
112
<arg name="stride" type="uint" summary="buffer stride"/>
113
</event>
114
115
<request name="copy">
116
<description summary="copy the frame">
117
Copy the frame to the supplied buffer. The buffer must have the
118
correct size, see zwlr_screencopy_frame_v1.buffer and
119
zwlr_screencopy_frame_v1.linux_dmabuf. The buffer needs to have a
120
supported format.
121
122
If the frame is successfully copied, "flags" and "ready" events are
123
sent. Otherwise, a "failed" event is sent.
124
</description>
125
<arg name="buffer" type="object" interface="wl_buffer"/>
126
</request>
127
128
<enum name="error">
129
<entry name="already_used" value="0"
130
summary="the object has already been used to copy a wl_buffer"/>
131
<entry name="invalid_buffer" value="1"
132
summary="buffer attributes are invalid"/>
133
</enum>
134
135
<enum name="flags" bitfield="true">
136
<entry name="y_invert" value="1" summary="contents are y-inverted"/>
137
</enum>
138
139
<event name="flags">
140
<description summary="frame flags">
141
Provides flags about the frame. This event is sent once before the
142
"ready" event.
143
</description>
144
<arg name="flags" type="uint" enum="flags" summary="frame flags"/>
145
</event>
146
147
<event name="ready">
148
<description summary="indicates frame is available for reading">
149
Called as soon as the frame is copied, indicating it is available
150
for reading. This event includes the time at which the presentation took place.
151
152
The timestamp is expressed as tv_sec_hi, tv_sec_lo, tv_nsec triples,
153
each component being an unsigned 32-bit value. Whole seconds are in
154
tv_sec which is a 64-bit value combined from tv_sec_hi and tv_sec_lo,
155
and the additional fractional part in tv_nsec as nanoseconds. Hence,
156
for valid timestamps tv_nsec must be in [0, 999999999]. The seconds part
157
may have an arbitrary offset at start.
158
159
After receiving this event, the client should destroy the object.
160
</description>
161
<arg name="tv_sec_hi" type="uint"
162
summary="high 32 bits of the seconds part of the timestamp"/>
163
<arg name="tv_sec_lo" type="uint"
164
summary="low 32 bits of the seconds part of the timestamp"/>
165
<arg name="tv_nsec" type="uint"
166
summary="nanoseconds part of the timestamp"/>
167
</event>
168
169
<event name="failed">
170
<description summary="frame copy failed">
171
This event indicates that the attempted frame copy has failed.
172
173
After receiving this event, the client should destroy the object.
174
</description>
175
</event>
176
177
<request name="destroy" type="destructor">
178
<description summary="delete this object, used or not">
179
Destroys the frame. This request can be sent at any time by the client.
180
</description>
181
</request>
182
183
<!-- Version 2 additions -->
184
<request name="copy_with_damage" since="2">
185
<description summary="copy the frame when it's damaged">
186
Same as copy, except it waits until there is damage to copy.
187
</description>
188
<arg name="buffer" type="object" interface="wl_buffer"/>
189
</request>
190
191
<event name="damage" since="2">
192
<description summary="carries the coordinates of the damaged region">
193
This event is sent right before the ready event when copy_with_damage is
194
requested. It may be generated multiple times for each copy_with_damage
195
request.
196
197
The arguments describe a box around an area that has changed since the
198
last copy request that was derived from the current screencopy manager
199
instance.
200
201
The union of all regions received between the call to copy_with_damage
202
and a ready event is the total damage since the prior ready event.
203
</description>
204
<arg name="x" type="uint" summary="damaged x coordinates"/>
205
<arg name="y" type="uint" summary="damaged y coordinates"/>
206
<arg name="width" type="uint" summary="current width"/>
207
<arg name="height" type="uint" summary="current height"/>
208
</event>
209
210
<!-- Version 3 additions -->
211
<event name="linux_dmabuf" since="3">
212
<description summary="linux-dmabuf buffer information">
213
Provides information about linux-dmabuf buffer parameters that need to
214
be used for this frame. This event is sent once after the frame is
215
created if linux-dmabuf buffers are supported.
216
</description>
217
<arg name="format" type="uint" summary="fourcc pixel format"/>
218
<arg name="width" type="uint" summary="buffer width"/>
219
<arg name="height" type="uint" summary="buffer height"/>
220
</event>
221
222
<event name="buffer_done" since="3">
223
<description summary="all buffer types reported">
224
This event is sent once after all buffer events have been sent.
225
226
The client should proceed to create a buffer of one of the supported
227
types, and send a "copy" request.
228
</description>
229
</event>
230
</interface>
231
</protocol>
232