2018-05-22 18:38:05 +02:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<protocol name="wlr_export_dmabuf_unstable_v1">
|
|
|
|
|
|
|
|
<copyright>
|
|
|
|
Copyright © 2018 Rostislav Pehlivanov
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
copy of this software and associated documentation files (the "Software"),
|
|
|
|
to deal in the Software without restriction, including without limitation
|
|
|
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
Software is furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice (including the next
|
|
|
|
paragraph) shall be included in all copies or substantial portions of the
|
|
|
|
Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
DEALINGS IN THE SOFTWARE.
|
|
|
|
</copyright>
|
|
|
|
|
2018-05-23 23:11:45 +02:00
|
|
|
<description summary="a protocol for low overhead screen content capturing">
|
2018-05-22 18:38:05 +02:00
|
|
|
An interface to capture surfaces in an efficient way.
|
|
|
|
Overall usage:
|
|
|
|
|
|
|
|
1.) client registers with zwlr_screencontent_manager_v1
|
|
|
|
2.) server sends client info about surfaces via "receive_surface_info"
|
|
|
|
3.) client subscribes to capture a surface via the "capture" requests
|
|
|
|
4.) server sends client events via the "zwlr_screencontent_frame" interface
|
|
|
|
5.) client finishes and informs server via the "frame_destroy" event
|
|
|
|
6.) client optionally resubscribes via repeating steps 3.) through 5.)
|
|
|
|
</description>
|
|
|
|
|
|
|
|
<interface name="zwlr_export_dmabuf_frame_v1" version="1">
|
|
|
|
<description summary="a frame ready for readout">
|
|
|
|
This object represents a frame which is ready to have its resources
|
|
|
|
fetched and used.
|
|
|
|
|
2018-05-23 23:11:45 +02:00
|
|
|
The receive callback shall be called first, followed by the "object"
|
2018-05-26 09:15:49 +02:00
|
|
|
callback once per dmabuf object or the "plane" callback, once per dmabuf
|
|
|
|
plane. The "ready" event is called last to indicate that all the data has
|
2018-05-23 23:11:45 +02:00
|
|
|
been made available for readout, as well as the time at which presentation
|
|
|
|
happened at. The ownership of the frame is passed to the client, who's
|
2018-05-26 09:15:49 +02:00
|
|
|
responsible for destroying it via the "destroy" event once finished and
|
|
|
|
by calling close() on the file descriptors received.
|
2018-05-22 18:38:05 +02:00
|
|
|
All frames are read-only and may not be written into or altered.
|
|
|
|
</description>
|
|
|
|
|
2018-05-23 23:11:45 +02:00
|
|
|
<enum name="flags">
|
2018-05-22 18:38:05 +02:00
|
|
|
<description summary="frame flags">
|
2018-05-26 09:15:49 +02:00
|
|
|
Special flags that should be respected by the client.
|
2018-05-22 18:38:05 +02:00
|
|
|
</description>
|
2018-05-26 09:15:49 +02:00
|
|
|
<entry name="transient" value="0x1" since="1"
|
|
|
|
summary="clients should copy frame before processing"/>
|
2018-05-22 18:38:05 +02:00
|
|
|
</enum>
|
|
|
|
|
|
|
|
<event name="frame">
|
|
|
|
<description summary="main callback">
|
|
|
|
Main callback supplying the client with information about the frame,
|
|
|
|
as well as an object to serve as context for destruction. Always called
|
|
|
|
first before any other events.
|
|
|
|
|
|
|
|
The "transform" argument describes the orientation needed to be applied
|
|
|
|
to correctly orient the buffer. For example, a buffer rotated by 90
|
|
|
|
degrees will have a value of "3" here, corresponding to the need to
|
|
|
|
apply a 270 degree transpose to correctly present the buffer.
|
|
|
|
</description>
|
|
|
|
<arg name="width" type="uint"
|
|
|
|
summary="frame width, scaling factor included"/>
|
|
|
|
<arg name="height" type="uint"
|
|
|
|
summary="frame height, scaling factor included"/>
|
2018-05-26 09:15:49 +02:00
|
|
|
<arg name="offset_x" type="uint"
|
|
|
|
summary="crop offset for the x axis"/>
|
|
|
|
<arg name="offset_y" type="uint"
|
|
|
|
summary="crop offset for the y axis"/>
|
2018-05-23 23:11:45 +02:00
|
|
|
<arg name="buffer_flags" type="uint"
|
2018-05-22 18:38:05 +02:00
|
|
|
summary="flags which indicate properties (invert, interlacing),
|
|
|
|
has the same values as zwp_linux_buffer_params_v1:flags"/>
|
2018-05-23 23:11:45 +02:00
|
|
|
<arg name="flags" type="uint" enum="flags"
|
2018-05-22 18:38:05 +02:00
|
|
|
summary="indicates special frame features"/>
|
2018-05-26 09:15:49 +02:00
|
|
|
<arg name="format" type="uint"
|
|
|
|
summary="format of the frame (DRM_FORMAT_*)"/>
|
2018-05-22 18:38:05 +02:00
|
|
|
<arg name="mod_high" type="uint"
|
|
|
|
summary="drm format modifier, high"/>
|
|
|
|
<arg name="mod_low" type="uint"
|
|
|
|
summary="drm format modifier, low"/>
|
|
|
|
<arg name="num_objects" type="uint"
|
|
|
|
summary="indicates how many objects (FDs) the frame has (max 4)"/>
|
2018-05-26 09:15:49 +02:00
|
|
|
<arg name="num_planes" type="uint"
|
|
|
|
summary="indicates how many planes the frame has (max 4)"/>
|
2018-05-22 18:38:05 +02:00
|
|
|
</event>
|
2018-05-23 23:11:45 +02:00
|
|
|
<event name="object">
|
2018-05-22 18:38:05 +02:00
|
|
|
<description summary="object receiving callback">
|
|
|
|
Callback which serves to supply the client with the file descriptors
|
|
|
|
containing the data for each object.
|
|
|
|
</description>
|
|
|
|
<arg name="index" type="uint"
|
|
|
|
summary="index of the current object"/>
|
|
|
|
<arg name="fd" type="fd"
|
|
|
|
summary="fd of the current object"/>
|
|
|
|
<arg name="size" type="uint"
|
|
|
|
summary="size in bytes for the current object"/>
|
|
|
|
</event>
|
2018-05-23 23:11:45 +02:00
|
|
|
<event name="plane">
|
2018-05-22 18:38:05 +02:00
|
|
|
<description summary="plane info receiving callback">
|
|
|
|
Callback which supplies the client with plane information for each
|
2018-05-26 09:15:49 +02:00
|
|
|
plane.
|
2018-05-22 18:38:05 +02:00
|
|
|
</description>
|
|
|
|
<arg name="index" type="uint"
|
|
|
|
summary="index of the current plane"/>
|
|
|
|
<arg name="object_index" type="uint"
|
|
|
|
summary="index of the object the plane applies to"/>
|
|
|
|
<arg name="offset" type="uint"
|
|
|
|
summary="starting point for the data in the object's fd"/>
|
|
|
|
<arg name="stride" type="uint"
|
|
|
|
summary="line size in bytes"/>
|
|
|
|
</event>
|
|
|
|
<event name="ready">
|
|
|
|
<description summary="indicates frame is available for reading">
|
|
|
|
Called as soon as the frame is presented, indicating it is available
|
|
|
|
for reading.
|
|
|
|
The timestamp is expressed as tv_sec_hi, tv_sec_lo, tv_nsec triples,
|
|
|
|
each component being an unsigned 32-bit value. Whole seconds are in
|
|
|
|
tv_sec which is a 64-bit value combined from tv_sec_hi and tv_sec_lo,
|
|
|
|
and the additional fractional part in tv_nsec as nanoseconds. Hence,
|
|
|
|
for valid timestamps tv_nsec must be in [0, 999999999].
|
|
|
|
The seconds part may have an arbitrary offset at start.
|
|
|
|
</description>
|
|
|
|
<arg name="tv_sec_hi" type="uint"
|
|
|
|
summary="high 32 bits of the seconds part of the timestamp"/>
|
|
|
|
<arg name="tv_sec_lo" type="uint"
|
|
|
|
summary="low 32 bits of the seconds part of the timestamp"/>
|
|
|
|
<arg name="tv_nsec" type="uint"
|
|
|
|
summary="nanoseconds part of the timestamp"/>
|
|
|
|
</event>
|
2018-05-23 23:11:45 +02:00
|
|
|
|
2018-05-26 09:15:49 +02:00
|
|
|
<enum name="cancel_reason">
|
|
|
|
<description summary="cancel reason">
|
|
|
|
Indicates reason for cancelling the frame.
|
2018-05-23 23:11:45 +02:00
|
|
|
</description>
|
2018-05-26 09:15:49 +02:00
|
|
|
<entry name="temporary" value="0" since="1"
|
|
|
|
summary="temporary error, source will produce more frames"/>
|
|
|
|
<entry name="pernament" value="1" since="1"
|
|
|
|
summary="fatal error, source will not produce frames"/>
|
|
|
|
<entry name="resizing" value="2" since="1"
|
|
|
|
summary="temporary error, source will produce frames"/>
|
2018-05-23 23:11:45 +02:00
|
|
|
</enum>
|
|
|
|
|
2018-05-26 09:15:49 +02:00
|
|
|
<event name="cancel">
|
2018-05-22 18:38:05 +02:00
|
|
|
<description summary="indicates the frame is no longer valid">
|
|
|
|
If the frame is no longer valid after the "frame" event has been called,
|
|
|
|
this callback will be used to inform the client to scrap the frame.
|
|
|
|
Source is still valid for as long as the subscription function does not
|
|
|
|
return NULL.
|
|
|
|
This may get called if for instance the surface is in the process of
|
|
|
|
resizing.
|
|
|
|
</description>
|
2018-05-26 09:15:49 +02:00
|
|
|
<arg name="reason" type="uint" enum="cancel_reason"
|
|
|
|
summary="indicates a reason for cancelling this frame capture"/>
|
2018-05-22 18:38:05 +02:00
|
|
|
</event>
|
|
|
|
|
|
|
|
<request name="destroy" type="destructor">
|
|
|
|
<description summary="delete this object, used or not">
|
|
|
|
Unreferences the frame, allowing it to be reused. Must be called as soon
|
|
|
|
as its no longer used.
|
2018-05-26 09:15:49 +02:00
|
|
|
Can be called at any time by the client after the "frame" event, after
|
|
|
|
which the compositor will not call any other events unless the client
|
|
|
|
resubscribes to capture more. The client will still have to close any
|
|
|
|
FDs it has been given.
|
2018-05-22 18:38:05 +02:00
|
|
|
</description>
|
|
|
|
</request>
|
|
|
|
</interface>
|
|
|
|
|
|
|
|
<interface name="zwlr_export_dmabuf_manager_v1" version="1">
|
|
|
|
<description summary="manager to inform clients and begin capturing">
|
2018-05-26 09:15:49 +02:00
|
|
|
This object is a manager with which to start capturing from sources.
|
2018-05-22 18:38:05 +02:00
|
|
|
</description>
|
|
|
|
|
|
|
|
<request name="capture_output">
|
|
|
|
<description summary="subscribe to start capturing">
|
|
|
|
Request to start capturing from an entire wl_output.
|
|
|
|
</description>
|
|
|
|
<arg name="frame" type="new_id"
|
|
|
|
interface="zwlr_export_dmabuf_frame_v1"/>
|
2018-05-23 23:11:45 +02:00
|
|
|
<arg name="overlay_cursor" type="int"
|
|
|
|
summary="include custom client hardware cursor on top of the frame"/>
|
|
|
|
<arg name="output" type="object" interface="wl_output"/>
|
|
|
|
</request>
|
|
|
|
<request name="destroy" type="destructor">
|
|
|
|
<description summary="destroy the manager">
|
|
|
|
All objects created by the manager will still remain valid, until their
|
|
|
|
appropriate destroy request has been called.
|
|
|
|
</description>
|
2018-05-22 18:38:05 +02:00
|
|
|
</request>
|
|
|
|
</interface>
|
|
|
|
</protocol>
|