Capture the next frame (zero-copy). 采集下一帧(零拷贝)。 The returned [`Frame`] borrows directly from the kernel's mmap buffer. No data is copied. The frame must be dropped before calling `next_frame()` again (enforced by the borrow checker). 返回的 [`Frame`] 直接借用内核的 mmap 缓冲区。 不进行数据拷贝。帧必须在再次调用 `next_frame()` 前被 drop (由借用检查器强制保证)。 # Blocking This call blocks until the next frame is ready from the camera. A
(&mut self)
| 111 | /// 此调用会阻塞直到摄像头的下一帧就绪。 |
| 112 | /// 30fps 时约 33ms;120fps 时约 8.3ms。 |
| 113 | pub fn next_frame(&mut self) -> Result<Frame<'_>> { |
| 114 | let raw = self.backend.dequeue()?; |
| 115 | Ok(Frame::new( |
| 116 | raw.data, |
| 117 | raw.width, |
| 118 | raw.height, |
| 119 | raw.pixel_format, |
| 120 | raw.sequence, |
| 121 | raw.timestamp_us, |
| 122 | )) |
| 123 | } |
| 124 | |
| 125 | /// Capture and decode the next frame into a reusable [`Mat`]. |
| 126 | /// 采集并解码下一帧到可复用的 [`Mat`]。 |
no test coverage detected