feat(#16): optional exposure/framerate lock#19
Merged
Conversation
Auto-exposure raises frame time past the 33ms budget in low light, halving fps to ~15. Add an optional control to pin the camera to Manual exposure so framerate holds steady, at the cost of a darker image. Off by default. Native: worker queries IAMCameraControl off the reader's media source; when the camera supports Manual exposure it maps a normalized 0..1 value onto the camera range (snapped to stepping) and pushes on change; OFF restores Auto. No-ops when unsupported; restores Auto on shutdown. ABI: CosParams += exposure_lock_enabled + exposure_value; CosStatus += exposure_supported (support is per open camera, known only while running, so surfaced via the polled status not the pre-start capability probe). C#: ShimParams/ShimStatus + PInvoke mirrors; EffectSettings persistence; VM observable ExposureLock/ExposureValue/ExposureSupported with live push + config round-trip; XAML toggle + brightness slider, greyed until running and supported. The native camControl==null check is the authoritative gate (not a managed ApplyParams gate, which would force exposure off at Start before the first status poll and break persisted-on exposure). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #16.
Problem
Webcam auto-exposure raises frame time past the 33 ms/frame budget in low light, so the camera physically drops to ~15 fps. Confirmed live (overlay reads ~15 dim, 30 bright). Camera firmware behavior, not the capture pipeline.
Change
Optional control to pin the camera to Manual exposure so framerate holds at 30 regardless of lighting, at the cost of a darker image in dim rooms. Off by default (keeps auto-exposure).
IAMCameraControloff the reader''s media source; if the camera supports Manual exposure it maps a normalized 0..1 value onto the camera range (snapped to stepping) and pushes on change; OFF restores Auto. No-ops when unsupported; restores Auto on shutdown.CosParams+=exposure_lock_enabled+exposure_value;CosStatus+=exposure_supported(per-camera support is known only while running, so surfaced via the polled status, not the pre-start capability probe).ShimParams/ShimStatus+ PInvoke mirrors;EffectSettingspersistence; VM observableExposureLock/ExposureValue/ExposureSupportedwith live push + config round-trip; XAML toggle + brightness slider, greyed until running and the camera reports support.The native
camControl==nullcheck is the authoritative gate (a managedApplyParamsgate would force exposure off at Start before the first status poll lands and break persisted-on exposure).Verification
🤖 Generated with Claude Code