Repository navigation
feat(moq-cli)!: capture encodes while publishing, --on-demand as an opt-in - #7188
Conversation
Quest-Claim: 4497eb8e0d5518b3
…pt-in `import capture` follows the moq-video and moq-audio defaults, keeping the camera and microphone open and encoding for the whole publish so a late subscriber can fetch the recent past. `--on-demand` selects both libraries' `Capture::on_demand`, opening each source only while its track has a subscriber. 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 13 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. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 9462f89
No actionable implementation bugs found. The flag reaches both libraries' Capture::on_demand fields, and constructing audio Capture alongside video preserves its existing configuration and publication path. This is a small, appropriate CLI layer over the library policy; the parser-to-options regression covers both defaults and opt-in.
Documentation clarification: --on-demand gates sustained capture, not all device access. The video driver still opens the source once at startup to probe its negotiated mode before releasing it until a viewer arrives (rs/moq-video/src/encode/producer.rs, Driver::run). Qualify the new “open ... only while ... a subscriber” help/doc wording so users do not interpret it as preventing the initial camera/picker/permission probe.
Verification: static inspection of argument mapping, feature-gated publication and both library demand gates. I did not run tests, builds, or physical-device checks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Applied the automated review's documentation note in e0c6ba1. The (Written by Claude Opus 5.5) |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: e0c6ba1
The prior device-access documentation clarification is addressed: both --on-demand help and doc/bin/cli.md explicitly retain video's startup mode probe while describing demand-gated capture. No new actionable bugs found in this documentation-only delta from 9462f89; implementation is unchanged.
Direction: this accurately distinguishes the opt-in's steady-state behavior from startup device access. Verification: static comparison against the previously inspected video driver; tests, builds and hardware checks were not run.
|
Landing e0c6ba1 as is, per the maintainer's approval of the choices in the PR body: one
Follow-up already in the body: re-check the (Written by Claude Opus 5.5) |
Completes
quest/m1/eager-encode/cli.md(removed here, along with its link in the epic README).Summary
moq import capturefollows the library defaults: the camera and microphone stay open and encode for the whole publish, so a late subscriber or FETCH finds the recent past.--on-demandflag setsmoq_video::encode::Capture::on_demandandmoq_audio::encode::Capture::on_demand, which opens and encodes each source only while its track has a subscriber (the old behavior).moq_audio::encode::CapturebyCaptureArgs::audio_capture, the same wayvideo_capturebuilds the video side, so the(config, options)tuple inSource::Captureis gone.doc/bin/cli.mddescribes the always-on camera and microphone, and adds an--on-demandexample.Impact
moq import capturedefault changes from on-demand to always-on (the libraries flipped in feat(moq-audio): capture and encode while enabled, with an on-demand opt-in #7159 and feat(moq-video)!: capture encodes while enabled, on demand as an opt-in #7164; the CLI inherited it). Migrate: add--on-demandto keep devices closed while nobody watches. Also adds the--on-demandflag.Choices made without asking
--on-demand: the quest's Goal names it. It mirrors the library fieldon_demand, following AGENTS.md's "Mirror names across Rust, JS, and the bindings". The Plan's "the repository's CLI rule" doesn't point at a specific rule I could find; the closest are the AGENTS.md CLI-examples rule (checked: the only invocations are indoc/bin/cli.md, and the new one matches--help) and rs/AGENTS.md's rename rule (doesn't apply, since nothing is renamed). Suggested quest wording: "Name the flag--on-demand, mirroringCapture::on_demand."--video-on-demand/--audio-on-demand. The Goal describes a single switch.!: this PR only adds the flag, but moq-cli's changelog wouldn't otherwise record its default change, because the library PRs didn't touch the crate.capture_runs_always_unless_on_demandchecks that the default maps to both libraries' always-on option and that--on-demandmaps to their opt-in. The "publishes without a subscriber" behavior needs a real device at the CLI level. The libraries' own tests cover it on synthetic devices (moq-audioon_demand_waits_for_a_subscriberand its always-on counterpart, and the moq-video producer tests).Checks
just rs test -p moq-cli --features capture: 235 passed.cargo clippy -p moq-cli --all-targets --features capture -D warnings: clean.cargo fmt --check: clean.quest check --base origin/main: ok.moq import capture --helplists--on-demand.Follow-ups
--on-demandhelp text anddoc/bin/cli.mdthen, since "the microphone stays open" will no longer hold.🤖 Generated with Claude Code
(Written by Claude Opus 5.5)