将 rustcv-core 的 FourCC 转换为 v4l 的 FourCC 用于请求设备设置格式
(fmt: PixelFormat)
| 40 | /// 将 rustcv-core 的 FourCC 转换为 v4l 的 FourCC |
| 41 | /// 用于请求设备设置格式 |
| 42 | pub fn to_v4l_fourcc(fmt: PixelFormat) -> Option<V4lFourCC> { |
| 43 | match fmt { |
| 44 | PixelFormat::Known(cc) => Some(V4lFourCC::new(&cc.0.to_le_bytes())), |
| 45 | PixelFormat::Unknown(_) => None, // 无法主动请求未知的格式 |
| 46 | } |
| 47 | } |