Files
punktfunk/crates/pf-vdisplay/protocols/zkde-screencast-unstable-v1.xml
T
enricobuehler 27a5d8daac refactor(host/W6.2): extract virtual-display orchestration into the pf-vdisplay crate
vdisplay.rs + vdisplay/* (the per-compositor Linux backends — KWin zkde-screencast,
wlroots swaymsg, Mutter RemoteDesktop, Hyprland — and the Windows IddCx/pf-vdisplay
driver backend, behind one VirtualDisplay trait; the mode-conflict admission
registry, the display policy/identity/custom-preset state, and the session-env /
gamescope routing) move into crates/pf-vdisplay (plan §W6). The DDC/CI panel-power
control (used only here) and the KWin zkde protocol XML move with it. This
completes the host-crate decomposition: capture, encode, inject, and vdisplay are
now four subsystem crates over the shared leaves, and punktfunk-host is the
orchestrator (serve/supervisor + native + gamestream + mgmt).

Coupling breaks (all down-only, cargo-tree acyclic):
- capture::dxgi identity -> pf_frame::dxgi; win_display/monitor_devnode/
  console_session_mismatch -> pf-win-display leaf; can_open_another_session ->
  pf-encode (the NVENC session-budget admission gate — acyclic peer edge).
- The registry's DisplayCreated/DisplayReleased emits into the host SSE event bus
  invert to a leaf hook: pf-vdisplay emits a neutral DisplayEvent to a
  host-registered DISPLAY_EVENT_SINK, so it never reaches the orchestrator's
  events module.
- The IddCx driver module is renamed pf_vdisplay -> driver (its old name collided
  with the crate name through the host's `mod vdisplay` shim glob).

The host keeps `mod vdisplay { pub use pf_vdisplay::* }` so every crate::vdisplay::*
path (serve/mgmt/native/the capture FrameChannelSender seam) is unchanged; the
heavy deps (wayland/ashpd/tokio + the zkde protocol) moved with the crate.
Co-authored: a fail-closed IOCTL-reply-length security fix (reject short/zeroed
pf-vdisplay driver replies before trusting protocol_version/target_id/wudf_pid/luid,
security-review 2026-07-17) rides this commit in the moved driver module.

Verified: Linux clippy -D warnings (pf-vdisplay + host nvenc,vulkan-encode,pyrowave
--all-targets) + pf-vdisplay 63/63 + host 167/167 tests; Windows clippy -D warnings
(pf-vdisplay --all-targets + host nvenc,amf-qsv --all-targets) Finished exit 0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 12:14:08 +02:00

106 lines
6.0 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<protocol name="zkde_screencast_unstable_v1">
<copyright><![CDATA[
SPDX-FileCopyrightText: 2020-2021 Aleix Pol Gonzalez <aleixpol@kde.org>
SPDX-License-Identifier: LGPL-2.1-or-later
]]></copyright>
<interface name="zkde_screencast_unstable_v1" version="6">
<description summary="Protocol for managing PipeWire feeds of the different displays and windows">
Warning! The protocol described in this file is a desktop environment
implementation detail. Regular clients must not use this protocol.
Backward incompatible changes may be added without bumping the major
version of the extension.
</description>
<enum name="pointer">
<description summary="Stream consumer attachment attributes" />
<entry name="hidden" value="1" summary="No cursor"/>
<entry name="embedded" value="2" summary="Render the cursor on the stream"/>
<entry name="metadata" value="4" summary="Send metadata about where the cursor is through PipeWire"/>
</enum>
<request name="stream_output">
<description summary="requests a feed from a given source"/>
<arg name="stream" type="new_id" interface="zkde_screencast_stream_unstable_v1"/>
<arg name="output" type="object" interface="wl_output"/>
<arg name="pointer" type="uint" summary="Requested pointer mode"/>
</request>
<request name="stream_window">
<description summary="requests a feed from a given source"/>
<arg name="stream" type="new_id" interface="zkde_screencast_stream_unstable_v1"/>
<arg name="window_uuid" type="string" summary="window Identifier"/>
<arg name="pointer" type="uint" summary="Requested pointer mode"/>
</request>
<request name="destroy" type="destructor">
<description summary="Destroy the zkde_screencast_unstable_v1">
Destroy the zkde_screencast_unstable_v1 object.
</description>
</request>
<request name="stream_virtual_output" since="2">
<description summary="requests a feed from a new virtual output"/>
<arg name="stream" type="new_id" interface="zkde_screencast_stream_unstable_v1"/>
<arg name="name" type="string" summary="name of the created output"/>
<arg name="width" type="int" summary="Logical width resolution"/>
<arg name="height" type="int" summary="Logical height resolution"/>
<arg name="scale" type="fixed" summary="Scaling factor of the display where it's to be displayed"/>
<arg name="pointer" type="uint" summary="Requested pointer mode"/>
</request>
<request name="stream_region" since="3">
<description summary="requests a feed from region in the workspace">
Since version 5, the compositor will choose the highest scale
factor for the region if the given scale is 0.0.
</description>
<arg name="stream" type="new_id" interface="zkde_screencast_stream_unstable_v1"/>
<arg name="x" type="int" summary="Logical left position"/>
<arg name="y" type="int" summary="Logical top position"/>
<arg name="width" type="uint" summary="Logical width resolution"/>
<arg name="height" type="uint" summary="Logical height resolution"/>
<arg name="scale" type="fixed" summary="Scaling factor of the output recording"/>
<arg name="pointer" type="uint" summary="Requested pointer mode"/>
</request>
<request name="stream_virtual_output_with_description" since="4">
<description summary="requests a feed from a new virtual output"/>
<arg name="stream" type="new_id" interface="zkde_screencast_stream_unstable_v1"/>
<arg name="name" type="string" summary="name of the created output"/>
<arg name="description" type="string" summary="user visible description of the created output"/>
<arg name="width" type="int" summary="Logical width resolution"/>
<arg name="height" type="int" summary="Logical height resolution"/>
<arg name="scale" type="fixed" summary="Scaling factor of the display where it's to be displayed"/>
<arg name="pointer" type="uint" summary="Requested pointer mode"/>
</request>
</interface>
<interface name="zkde_screencast_stream_unstable_v1" version="6">
<request name="close" type="destructor">
<description summary="Indicates we are done with the stream and the communication is over."/>
</request>
<event name="closed">
<description summary="Notifies that the server has stopped the stream. Clients should now call close."/>
</event>
<event name="created" deprecated-since="6">
<description summary="Notifies about a pipewire feed being created">
Deprecated since version 6, use the object serial from the serial event instead
</description>
<arg name="node" type="uint" summary="node of the pipewire buffer"/>
</event>
<event name="failed">
<description summary="Offers an error message so the client knows the created event will not arrive, and the client should close the resource."/>
<arg name="error" type="string" summary="A human readable translated error message."/>
</event>
<event name="serial" since="6">
<description summary="the pipewire object serial">
The pipewire object serial of the stream. Should be preferred over the node id which is prone to id reuse.
Will be sent before the created event.
</description>
<arg name="object_serial_hi" type="uint" summary="high bits of the pipewire object serial"/>
<arg name="object_serial_low" type="uint" summary="low bits of the pipewire object serial"/>
</event>
</interface>
</protocol>