crates/camera-mediafoundation/README.md
Ergonomic Rust wrapper around Windows Media Foundation API for camera capture, providing safe abstractions while maintaining low-level control. Aims to mirror how Chromium consumes Media Foundation.
Provides safe access to Windows camera devices through Media Foundation's Capture Engine, handling COM initialization, device enumeration, format negotiation, and asynchronous frame delivery.
DeviceSourcesIterator for enumerating video capture devicesCaptureHandleIMFMediaBufferExt traitinitialize_mediafoundation() - Initialize MF subsystemDeviceSourcesIterator::new() - Enumerate available camerasDevice::name(), Device::id(), Device::model_id() - Device metadataDevice::formats() - Iterator over supported IMFMediaType formatsDevice::start_capturing(format) - Begin async capture with specified formatCaptureHandle::sample_rx() - Receive IMFSample frames via channelCaptureHandle::event_rx() - Receive CaptureEngineEvent status updatesVideoSample::bytes() - Extract frame data as byte arrayIMFMediaBufferExt::lock() - Safe buffer access with automatic unlockBridges Media Foundation's callback-based model to Rust's ownership system using channels for cross-thread communication, RAII for resource management, and comprehensive error handling for production reliability.