1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! Camera and webcam capture.
//!
//! Cross-platform video frame capture using
//! [`nokhwa`](https://crates.io/crates/nokhwa):
//! - **Linux** — Video4Linux2 (V4L2)
//! - **macOS** — AVFoundation
//! - **Windows** — Media Foundation (MSMF)
//!
//! ## Quick start
//!
//! ```rust,no_run
//! use brainwires_hardware::camera;
//! use brainwires_hardware::camera::CameraCapture;
//!
//! #[tokio::main]
//! async fn main() -> anyhow::Result<()> {
//! // List available cameras
//! for cam in camera::list_cameras() {
//! println!("[{}] {}", cam.index, cam.name);
//! }
//!
//! // Open first camera with default format
//! let mut cap = camera::open_camera(0, None)?;
//! println!("Format: {:?}", cap.format());
//!
//! // Capture 5 frames
//! for i in 0..5 {
//! let frame = cap.capture_frame().await?;
//! println!("Frame {i}: {}x{} @ {}ms", frame.width, frame.height, frame.timestamp_ms);
//! }
//!
//! cap.stop();
//! Ok(())
//! }
//! ```
//!
//! ## Requesting a specific format
//!
//! ```rust,no_run
//! use brainwires_hardware::camera::{self, CameraFormat};
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let mut cap = camera::open_camera(0, Some(CameraFormat::hd_720p()))?;
//! # Ok(()) }
//! ```
pub use ;
pub use ;
pub use ;