Skip to content

feat: real fps counter + highest-fps capture mode#14

Merged
opariffazman merged 2 commits into
mainfrom
feat/fps-and-capture-mode
Jun 24, 2026
Merged

feat: real fps counter + highest-fps capture mode#14
opariffazman merged 2 commits into
mainfrom
feat/fps-and-capture-mode

Conversation

@opariffazman

Copy link
Copy Markdown
Contributor

What

Two small, independent capture-pipeline wins, surfaced while investigating choppy overlay playback:

  1. Real measured fps in cos_get_status — replaces the hardcoded 30.0 stub with a header-only FpsCounter (rolling 0.5 s window) fed by a worker-thread frame counter. The status line now shows the actual capture rate.

  2. Capture selects the highest-fps native camera modeCreateReader previously let Media Foundation pick the camera's default native type (often a low-fps mode). It now enumerates native types, picks highest fps then highest resolution (≤ 1080p), and pins the RGB32 request to that size + rate (falling back to unconstrained if MF rejects it). A standalone native/shim/smoke/capture_probe.cpp diagnostic lists modes and measures RGB32 vs raw-MJPG delivery fps.

Why

The old hardcoded 30.0 masked real performance. Adding the real counter immediately exposed three environmental issues (none of them code bugs): a Debug build running unoptimized, a dev output dir missing its maxine\ runtime, and the webcam capped at 15 fps on a bandwidth-limited USB port. The capture-mode change ensures we always request the camera's best mode rather than MF's default.

Not in this PR (parked)

The AI sharpness effects (Artifact Reduction, Super Resolution) are deferred on feat/ai-sharpness-resolution. Reason: nvvfxartifactreduction does not exist in the VFX 1.2.0.0 NGC catalog, and Super Resolution is NGX VSR (selector VideoSuperRes, param QualityLevel) — the initial inferred implementation needs a rewrite against the real per-feature header. The shared plumbing (C-ABI effect slots, worker wiring, MVVM toggles, tests) is preserved on that branch for the rebuild.

Testing

  • 0-warning Release builds (native shim + WinUI 3 App).
  • Core suite: 54/54 xUnit pass.
  • fps_smoke covers the FpsCounter rolling-window semantics.
  • Verified on RTX 3090: real fps in the status line; capture negotiates 1080p30 (capture_probe confirms); green screen + eye contact unaffected.

🤖 Generated with Claude Code

opariffazman and others added 2 commits June 24, 2026 07:52
cos_get_status returned a constant 30.0. Add a header-only FpsCounter (rolling
0.5s window) fed by a worker-thread frame counter; cos_get_status now reports
the measured rate. fps_smoke.cpp covers the window semantics.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… diag)

CreateReader enumerated nothing — MF picked the camera's default native type,
which can be a low-fps mode. Now enumerate native types, pick highest fps then
highest res (<=1080p), and pin the RGB32 request to that size+rate so MF takes
the MJPG-30 path; fall back to unconstrained if rejected. capture_probe.cpp is
a standalone diagnostic (lists modes, measures RGB32 vs raw-MJPG delivery fps).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@opariffazman
opariffazman merged commit e6f3b5d into main Jun 24, 2026
1 check passed
@opariffazman
opariffazman deleted the feat/fps-and-capture-mode branch June 24, 2026 00:44
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