fix: implement DirectShow capture pipeline and wire preview#35
Merged
webbertakken merged 10 commits intomainfrom Feb 27, 2026
Merged
fix: implement DirectShow capture pipeline and wire preview#35webbertakken merged 10 commits intomainfrom
webbertakken merged 10 commits intomainfrom
Conversation
- Build Source -> SampleGrabber -> NullRenderer filter graph - Implement ISampleGrabberCB for frame delivery via raw COM vtables - Convert BGR24 bottom-up to RGB24 top-down in callback - Spawn capture thread in CaptureSession::new() on Windows - Resolve device_id to device_path in start_preview command - Add get_diagnostics IPC command for diagnostic overlay
- Auto-start preview when camera is selected, stop on change/deselect - Show "No adjustable controls" when camera has no controls - Add tests for both behaviours
Previously hotplug_wnd_proc only logged device arrival/removal without re-enumerating or invoking the callback. Now it stores HotplugContext via GWLP_USERDATA and calls handle_device_change on WM_DEVICECHANGE to diff devices and fire Connected/Disconnected events.
DiagnosticStats is now tracked in the capture session and updated by the ISampleGrabberCB callback on every frame. get_diagnostics returns the real snapshot instead of placeholder values.
error and info macros are only used inside #[cfg(target_os = "windows")] blocks, so the import must be gated too to avoid unused import warnings on Linux CI.
… resolution - Use IGraphBuilder::Connect instead of ConnectDirect so DirectShow inserts colour-space converters for MJPG/YUY2 cameras - Set running flag BEFORE IMediaControl::Run to avoid dropping the first frames - Query actual negotiated resolution from SampleGrabber's connected media type instead of assuming the requested size matches - Add tracing::error/warn logging throughout the capture graph so failures are visible in the yarn dev terminal
- Add `log-always` feature to tracing crate so tracing macros forward to the log facade (consumed by tauri-plugin-log) - Fix clippy: remove assert!(true), use arrays instead of vec! in tests
Owner
Author
|
/update-snapshots |
Owner
Author
|
/update-snapshots |
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.
Summary
Test plan