Repository navigation
feat(studio): a Linux virtual camera for each published scene - #82
Conversation
Quest-Claim: 96f5881cb29fb521
Each published scene gets a Virtual camera toggle of its own in the Output
panel, beside the program's. Its PipeWire node is named moq-studio-<scene>
("MoQ Studio: <scene>"), or it takes a v4l2loopback device no other camera
holds. The camera asks for its scene to be drawn while an app reads it,
reopens when the scene's size changes, and turns off once the scene is no
longer published under its name. The Devices panel leaves out every camera
the studio publishes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 20 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: bb2d80d
Base: 167cdca
No actionable findings.
Direction: treating each scene camera as another compositor consumer preserves on-demand drawing and the scene's own canvas. Checking canvas changes independently of an available texture lets an unread camera reopen at the new size. Removed scene cameras are extracted under the state lock and closed outside it; per-camera PipeWire IDs feed the Devices exclusion list. The process-wide v4l2 device reservation is held across selection/configuration, preventing simultaneous studio cameras from selecting the same path.
The expanded PipeWire test checks simultaneous distinct pictures and sizes, resize while unread, unpublish cleanup and refusal of unpublished scenes. The v4l2 test checks non-sharing and subsequent release. README and quest closure match the feature.
Verification: GitHub-only static review of all eight changed files, the surrounding engine draw/lifecycle and UI paths, and camera worker/readback/backend ownership. No builds, tests, quest validation, PipeWire session, v4l2loopback module, GPU runs or performance measurements executed. The reported validation was not independently reproduced, and the author explicitly did not run the extended v4l2 test locally. COMMENT only, not approval.
(Written by review (OpenAI))

Finishes quest/m0/vcam/linux.md.
Problem
The Linux virtual camera (moq-dev/studio#9) shows only the program. Since moq-dev/studio#71 a published scene is a second picture at its own size (a vertical cut, say), and a video-call app could not pick it.
Approach
vcam::Cameratakes the scene it shows (Nonefor the program). Its PipeWire node ismoq-studio-<scene>, described "MoQ Studio: "; the program's staysmoq-studio/ "MoQ Studio". Its capture id comes from the node, so the Devices panel filter follows.Stateholds the cameras in one map keyed byOption<String>(program underNone).Engine::set_camera(scene, on)refuses a scene that is not published.wanted()(an app reads it) to the scene'sCompositor::set_outputsdraw flag, so a scene nobody else reads is drawn only while an app reads its camera. After the render it offers the scene'sCompositor::outputtexture, orNonewhen not drawn. The reopen check uses the scene's canvas from the collection, not the drawn texture, so a resize while nobody reads still reopens the node before an app links at the old size.Impact
pipewire:moq-studio-<scene>). Not saved in the scene file, like the program's.moq-studio. No wire or scene-file change.Alternatives
Choices made without asking
moq-studio-<scene>). It is unique because scene names are unique, and moq-video resolvespipewire:<name>by exact match.Validation
On
nixos(RTX 3070 Ti):just ci: pass (278 tests).cargo clippy -p moq-studio --features pipewire --all-targets -D warnings: pass.engine::tests::the_virtual_camera_reaches_a_pipewire_app(extended), in a private PipeWire session (sh/pipewire-session.sh), on the GPU and on lavapipe asjust render-swruns it: pass. It now covers the program camera and thetallscene camera at once, each showing its own color at its own size. It also checks the scene camera reopening when the scene is resized, turning off once the scene is unpublished, and refusing to turn on for an unpublished scene.vcam::v4l2::tests::a_v4l2_app_reads_the_program(extended so a second camera never shares the device): not run, becausenixoshas no v4l2loopback module. The nightly's v4l2loopback job runs it.Follow-ups
None.
Review
quest review --new --base origin/main(fresh session 01a1b516; the first run had resumed PR feat(studio): a Linux virtual camera, as a PipeWire node or a v4l2loopback device #9's old session on this branch name, also 0 findings).(Written by Claude Opus 5.5)
🤖 Generated with Claude Code