crates/camera-windows/README.md
Unified Windows camera capture API that provides a seamless interface across both Media Foundation and DirectShow backends. Will use Media Foundation where possible, but will also list DirectShow devices if said devices aren't available via Media Foundation.
Provides a single, ergonomic API for Windows camera capture that intelligently chooses between Media Foundation (modern) and DirectShow (legacy) based on device capabilities and format availability. Designed to handle the complexity of Windows camera ecosystem where devices may support different APIs with varying feature sets.
get_devices() call returns all available camerasget_devices() - Enumerate all cameras from both Media Foundation and DirectShowVideoDeviceInfo::name(), VideoDeviceInfo::id(), VideoDeviceInfo::model_id() - Device metadataVideoDeviceInfo::is_mf() - Check if device uses Media Foundation backendVideoDeviceInfo::formats() - Iterator over unified VideoFormat objectsVideoDeviceInfo::start_capturing(format, callback) - Begin capture with unified callback interfaceCaptureHandle::stop_capturing() - Stop capture session and cleanup resourcesFrame::bytes() - Access frame data with automatic buffer managementVideoFormat::width(), VideoFormat::height(), VideoFormat::frame_rate() - Format propertiesVideoFormat::pixel_format() - Unified pixel format enumPixelFormat - Normalized format representation across ARGB, RGB, YUV420P, NV12, YUYV422, UYVY422Bridges the gap between Media Foundation's async capture engine and DirectShow's filter graph architecture through a unified device enumeration and capture interface. Implements intelligent backend selection by comparing device names and model IDs to deduplicate devices exposed by both APIs, preferring Media Foundation for performance while ensuring DirectShow compatibility for virtual cameras and legacy hardware.