wlr-screencopy.xml
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> 4Copyright © 2018 Simon Ser 5Copyright © 2019 Andri Yngvason 6 7Permission is hereby granted, free of charge, to any person obtaining a 8copy of this software and associated documentation files (the "Software"), 9to deal in the Software without restriction, including without limitation 10the rights to use, copy, modify, merge, publish, distribute, sublicense, 11and/or sell copies of the Software, and to permit persons to whom the 12Software is furnished to do so, subject to the following conditions: 13 14The above copyright notice and this permission notice (including the next 15paragraph) shall be included in all copies or substantial portions of the 16Software. 17 18THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 21THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 24DEALINGS IN THE SOFTWARE. 25</copyright> 26 27<description summary="screen content capturing on client buffers"> 28This protocol allows clients to ask the compositor to copy part of the 29screen content to a client buffer. 30 31Warning! The protocol described in this file is experimental and 32backward incompatible changes may be made. Backward compatible changes 33may be added together with the corresponding interface version bump. 34Backward incompatible changes are done by bumping the version number in 35the protocol and interface names and resetting the interface version. 36Once the protocol is to be declared stable, the 'z' prefix and the 37version number in the protocol and interface names are removed and the 38interface 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"> 43This object is a manager which offers requests to start capturing from a 44source. 45</description> 46 47<request name="capture_output"> 48<description summary="capture an output"> 49Capture 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" 53summary="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"> 59Capture the next frame of an output's region. 60 61The region is given in output logical coordinates, see 62xdg_output.logical_size. The region will be clipped to the output's 63extents. 64</description> 65<arg name="frame" type="new_id" interface="zwlr_screencopy_frame_v1"/> 66<arg name="overlay_cursor" type="int" 67summary="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"> 77All objects created by the manager will still remain valid, until their 78appropriate 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"> 85This object represents a single frame. 86 87When created, a series of buffer events will be sent, each representing a 88supported buffer type. The "buffer_done" event is sent afterwards to 89indicate that all supported buffer types have been enumerated. The client 90will then be able to send a "copy" request. If the capture is successful, 91the compositor will send a "flags" event followed by a "ready" event. 92 93For objects version 2 or lower, wl_shm buffers are always supported, ie. 94the "buffer" event is guaranteed to be sent. 95 96If the capture failed, the "failed" event is sent. This can happen anytime 97before the "ready" event. 98 99Once either a "ready" or a "failed" event is received, the client should 100destroy the frame. 101</description> 102 103<event name="buffer"> 104<description summary="wl_shm buffer information"> 105Provides information about wl_shm buffer parameters that need to be 106used for this frame. This event is sent once after the frame is created 107if 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"> 117Copy the frame to the supplied buffer. The buffer must have the 118correct size, see zwlr_screencopy_frame_v1.buffer and 119zwlr_screencopy_frame_v1.linux_dmabuf. The buffer needs to have a 120supported format. 121 122If the frame is successfully copied, "flags" and "ready" events are 123sent. 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" 130summary="the object has already been used to copy a wl_buffer"/> 131<entry name="invalid_buffer" value="1" 132summary="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"> 141Provides 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"> 149Called as soon as the frame is copied, indicating it is available 150for reading. This event includes the time at which the presentation took place. 151 152The timestamp is expressed as tv_sec_hi, tv_sec_lo, tv_nsec triples, 153each component being an unsigned 32-bit value. Whole seconds are in 154tv_sec which is a 64-bit value combined from tv_sec_hi and tv_sec_lo, 155and the additional fractional part in tv_nsec as nanoseconds. Hence, 156for valid timestamps tv_nsec must be in [0, 999999999]. The seconds part 157may have an arbitrary offset at start. 158 159After receiving this event, the client should destroy the object. 160</description> 161<arg name="tv_sec_hi" type="uint" 162summary="high 32 bits of the seconds part of the timestamp"/> 163<arg name="tv_sec_lo" type="uint" 164summary="low 32 bits of the seconds part of the timestamp"/> 165<arg name="tv_nsec" type="uint" 166summary="nanoseconds part of the timestamp"/> 167</event> 168 169<event name="failed"> 170<description summary="frame copy failed"> 171This event indicates that the attempted frame copy has failed. 172 173After 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"> 179Destroys 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"> 186Same 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"> 193This event is sent right before the ready event when copy_with_damage is 194requested. It may be generated multiple times for each copy_with_damage 195request. 196 197The arguments describe a box around an area that has changed since the 198last copy request that was derived from the current screencopy manager 199instance. 200 201The union of all regions received between the call to copy_with_damage 202and 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"> 213Provides information about linux-dmabuf buffer parameters that need to 214be used for this frame. This event is sent once after the frame is 215created 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"> 224This event is sent once after all buffer events have been sent. 225 226The client should proceed to create a buffer of one of the supported 227types, and send a "copy" request. 228</description> 229</event> 230</interface> 231</protocol> 232