Skip to content

feat(windows): RemoteIdd mosaic capture - #7

Open
mlopezsegura wants to merge 3 commits into
masterfrom
feature/mosaic-capture
Open

mlopezsegura wants to merge 3 commits into
masterfrom
feature/mosaic-capture

Conversation

@mlopezsegura

@mlopezsegura mlopezsegura commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Adds a mosaic mode to the RemoteIdd capture backend: one stream shows up to four OpenStreamMS sessions in a 2×2 grid. OpenStreamMS drives it (OpenstreamCo/OpenStreamMultiSeat, feature/stream-mosaic).

How it works

  • OpenStreamMS writes osms-mosaic.txt next to the host session's sunshine.conf:
    canvas 1920 1080
    7 Left
    9 Right
    
    One <Terminal Services session id> <part> line per session; parts are the 2×2 grid names used for split seats (Full, Left, Right, Top, Bottom, TopLeft…).
  • When this session and at least one more are listed, display_ridd_vram_t opens one FrameConsumer per session, waits on any of their FrameReady events and copies only the tiles that changed onto a canvas (CopySubresourceRegion, no shaders). A session that does not present keeps its last frame. The canvas is then copied into the capture image; the encoder scales it to the client like any display.
  • The file is re-read every 250 ms; a change returns capture_e::reinit, so sessions join and leave without dropping the stream.
  • Absolute mouse is offset to this session's part (offset_x/offset_y); outside it, the cursor stays on the edge.
  • Without the file (or with a single session), nothing changes.
  • FrameConsumer (copied from OpenStreamMS): ReadyEvent() and LatestFrameId().

Testing

  • Builds locally (MSYS2 UCRT64, Release).
  • test_sunshine --gtest_filter=RemoteIdd*: 10/10 on a real GPU, none skipped. New tests: part names, layout parsing (comments, CRLF, overlaps, bad lines, canvas), odd-size split, composition of two published sessions checked per pixel (a static session keeps its frame), mouse offset, and reinit when the layout changes.
  • First manual test by the maintainer with a local OpenStreamMS build: the mosaic works. Latency with four sessions not measured yet.

This PR was generated by Claude Code (Claude Opus 5.5), with the maintainer reviewing and testing it.

🤖 Generated with Claude Code

mlopezsegura and others added 3 commits November 14, 2026 01:14
When OpenStreamMS writes osms-mosaic.txt next to sunshine.conf listing this
session and others, the RemoteIdd backend streams a canvas of the client's
size split like a 2x2 grid, with every listed session copied into its part.

- One FrameConsumer per session; waits on any FrameReady, copies only the
  tiles that changed (CopySubresourceRegion, no shaders), keeps the rest.
- Layout changes are picked up every 250 ms and reinitialize the capture.
- Absolute mouse is offset to this session's part.
- FrameConsumer (copied from OpenStreamMS): ReadyEvent() and LatestFrameId().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- osms-mosaic.txt may set "canvas W H" (OpenStreamMS uses the host session's
  own resolution); the encoder scales it to the client like any display.
- parse_mosaic_layout(), mosaic_area_cells() and mosaic_rect() are public so
  they can be unit tested; canvas_texture() exposes the canvas to tests.
- Tests: part names, parsing (comments, CRLF, overlaps, bad lines, canvas),
  odd-size split, composition of two published sessions with a static one
  keeping its frame, mouse offset, and reinit on layout changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mlopezsegura

Copy link
Copy Markdown
Collaborator Author

This PR was generated by Claude Code (Claude Opus 5.5), with the maintainer reviewing and testing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant