0018: The TV's viewer of a device screen is a GStreamer pipeline
Status: Accepted (owner, 2026-11-24). Proposed (my call, 2026-11-16)
Context
M6c step 2: the TV joins a device's screen (the handheld started a game, the TV opens it). The own-core design already says how: a small viewer app in the TV's Gamescope reads that screen's PipeWire stream, on the same machine, so nothing is encoded. What is open is what the viewer is. Options: a gst-launch-1.0 pipeline (pipewiresrc to ximagesink, a second pipewiresrc of the screen's sink monitor to pulsesink); our own small binary reusing the server's capture code with an SDL or X11 window; or a Moonlight client pointed at our own server (encode and decode on one machine, which the design rules out).
A throwaway spike on the host (two headless screens, glxgears plus a tone on the "device", the pipeline on the "TV") measured 60 fps on the TV's own Gamescope node with 0 frames dropped, the tone on the TV's sink at its exact level, and about 10% of a core and 21 MB for the viewer.
Decision
The viewer is a GStreamer pipeline in its own image (couchdogs-viewer:local, on our base image like the other apps, GStreamer and PipeWire's plugin from the distribution). The runner starts it on the TV's screen like an app, with the device's PipeWire socket mounted read-only, and puts it in front.
Consequences
No code of ours draws or plays anything; the pipeline is one command a test can read. GStreamer stays out of the server (ADR 0015), only the viewer uses it. If the pipeline needs control it cannot give (latency tuning, a picture that changes size mid-stream), we replace it with our own binary behind the same container contract.
2026-11-17: the video sink runs with qos=false. Gamescope stamps every PipeWire frame with the same timestamp, so the sink's first QoS report ("late up to T") made videoconvert and videoscale drop every later frame and the TV froze on its second frame while the device kept moving. sync=false already draws frames as they come.
Amendment (2026-11-17): the marker
(Amended again 2026-11-18 by ADR 0033: the same script now draws the one status
pill from stack/images/screen/pill.py, and the TV's "On
The TV shows the same "On ..." marker a device on the TV sees, drawn by the server's marker script, so the two sides of a join look alike. Its pill gives way to the glyph after 5 s, a change gst-launch cannot make in a running pipeline, so a small view.py (PyGObject) runs the same pipeline and swaps the two overlays. The pipeline itself is still built by view.sh, where a test reads it.