Convert a V4L2 FourCC `u32` to a [`PixelFormat`]. 将 V4L2 FourCC `u32` 转换为 [`PixelFormat`]。
(fourcc: u32)
| 96 | /// Convert a V4L2 FourCC `u32` to a [`PixelFormat`]. |
| 97 | /// 将 V4L2 FourCC `u32` 转换为 [`PixelFormat`]。 |
| 98 | pub fn from_fourcc(fourcc: u32) -> Self { |
| 99 | match fourcc { |
| 100 | fcc::MJPEG => Self::Mjpeg, |
| 101 | fcc::YUYV => Self::Yuyv, |
| 102 | fcc::NV12 => Self::Nv12, |
| 103 | fcc::BGR24 => Self::Bgr24, |
| 104 | fcc::RGB24 => Self::Rgb24, |
| 105 | fcc::BGRA32 => Self::Bgra32, |
| 106 | other => Self::Other(other), |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | /// Convert back to a V4L2 FourCC `u32`. |
| 111 | /// 转换回 V4L2 FourCC `u32`。 |
nothing calls this directly
no outgoing calls
no test coverage detected