核心:格式协商算法 遍历硬件支持的所有格式,计算得分,返回最佳配置
| 80 | /// 核心:格式协商算法 |
| 81 | /// 遍历硬件支持的所有格式,计算得分,返回最佳配置 |
| 82 | struct NegotiatedFormat { |
| 83 | width: u32, |
| 84 | height: u32, |
| 85 | format: PixelFormat, |
| 86 | #[allow(dead_code)] |
| 87 | fps: u32, // 目标 FPS |
| 88 | } |
| 89 | |
| 90 | fn negotiate_format(dev: &v4l::Device, config: &CameraConfig) -> Result<NegotiatedFormat> { |
| 91 | let mut best_score = -1; |
nothing calls this directly
no outgoing calls
no test coverage detected