Skip to content

Mosaic: up to four sessions in one stream - #53

Merged
mlopezsegura merged 6 commits into
masterfrom
feature/stream-mosaic
Nov 14, 2026
Merged

mlopezsegura merged 6 commits into
masterfrom
feature/stream-mosaic

Conversation

@mlopezsegura

@mlopezsegura mlopezsegura commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Mosaic: a session being streamed (the host) takes up to three more sessions, joined live from the dashboard. The Moonlight/WebRTC client sees them in a 2×2 grid. Needs the Sunshine mosaic capture: OpenstreamCo/Sunshine-Web-RTC#7.

What it does

  • Join / leave: session menu ⋯ → Join another session's stream… puts it in the next free part (1 full screen, 2 halves, 3-4 quarters); the guest is started if needed. Leave the mosaic / End the mosaic on the host.
  • Two sessions: side by side or one above the other, from the host's menu. The choice is kept if more sessions join and leave.
  • Controllers: controller N created by the host's Sunshine goes to session N, in order of arrival (0 = host); without a session N it stays on the host. Controllers are reassigned when the mosaic changes.
  • Keyboard, mouse and audio: the host's only; the absolute mouse lands in the host's part.
  • Under the hood (Services/Mosaic/MosaicService.cs): pauses the guests' Sunshine, reconnects each session's RDP to the size of its part (RemoteIdd accepts any mode), and writes osms-mosaic.txt next to the host's sunshine.conf. The mosaic ends when the host stops or after 60 s without a client.
  • API: GET/POST/DELETE /api/sessions/{id}/mosaic[/{memberId}], PUT /api/sessions/{id}/mosaic/layout. GET /api/sessions adds mosaicHost, mosaicIndex, mosaicCount, mosaicStacked.
  • Dashboard: menu entries and a chip with a 2×2 map on each card. Texts in the 22 languages.
  • A local seat cannot use a session that is in a mosaic.
  • Docs: docs/mosaico.md, README feature list.

Before merging

Testing

  • Builds; C# tests (57, new MosaicLayoutTests) and i18n tests (38) pass.
  • Installer built locally; first manual test: two sessions in one stream work.
  • Latency with four sessions, repeated joins/leaves and controller reassignment not tested in depth yet.

🤖 Generated with Claude Code

mlopezsegura and others added 6 commits November 14, 2026 01:29
Una sesión que se retransmite (la anfitriona) admite en caliente hasta otras
tres; el cliente las ve en una cuadrícula de 2x2 (1 entera, 2 mitades, 3-4
cuartos). Necesita el Sunshine con captura mosaico (Sunshine-Web-RTC
feature/mosaic-capture).

- MosaicService: unir/sacar, pausa el Sunshine de las invitadas, reconecta
  cada sesión al tamaño de su parte y escribe osms-mosaic.txt junto al
  sunshine.conf de la anfitriona. Se deshace al parar la anfitriona o tras
  60 s sin cliente.
- Mandos: el mando N que crea el Sunshine de la anfitriona va a la sesión N
  por orden de llegada; se reasignan si el mosaico cambia.
- API /api/sessions/{id}/mosaic, menú y etiqueta con mapa 2x2 en el panel,
  textos en los 22 idiomas.
- RemoteIdd FrameConsumer: ReadyEvent() y LatestFrameId().
- Un puesto no puede usar una sesión que está en un mosaico.
- docs/mosaico.md y pruebas de MosaicLayout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sunshine.exe built locally from Sunshine-Web-RTC feature/mosaic-capture
(ed4f5567), Release, stripped. Replace it with the CI build before a release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With two sessions the host's menu switches between left/right and top/bottom
halves (PUT /api/sessions/{id}/mosaic/layout). Both sessions reconnect to
their new half; the choice is kept if more sessions join and leave.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mlopezsegura
mlopezsegura merged commit 3ec3740 into master Nov 14, 2026
1 check passed
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