MCPcopy Create free account
hub / github.com/RustCV/RustCV / RawFrame

Class RawFrame

rustcv-camera/src/backend/mod.rs:26–55  ·  view source on GitHub ↗

Raw frame data returned by a platform backend's `dequeue()`. 平台后端 `dequeue()` 返回的原始帧数据。 The lifetime `'a` is tied to the backend that produced it. For V4L2 this borrows directly from the mmap buffer; for AVFoundation it borrows from `AvfBackend::frame_buf`. 生命周期 `'a` 绑定到产生它的后端。 V4L2 中直接借用 mmap 缓冲区;AVFoundation 中借用 `AvfBackend::frame_buf`。

Source from the content-addressed store, hash-verified

24/// 生命周期 `'a` 绑定到产生它的后端。
25/// V4L2 中直接借用 mmap 缓冲区;AVFoundation 中借用 `AvfBackend::frame_buf`。
26pub(crate) struct RawFrame<'a> {
27 /// Buffer index — used by V4L2 to re-queue the mmap buffer.
28 /// Always 0 on AVFoundation (buffers managed internally).
29 ///
30 /// 缓冲区索引 —— V4L2 用于重新入队 mmap 缓冲区。
31 /// AVFoundation 上始终为 0(缓冲区由内部管理)。
32 #[allow(dead_code)]
33 pub index: usize,
34
35 /// Pixel data slice. Format is indicated by `pixel_format`.
36 /// 像素数据切片。格式由 `pixel_format` 指示。
37 pub data: &'a [u8],
38
39 pub width: u32,
40 pub height: u32,
41 pub pixel_format: PixelFormat,
42
43 /// Monotonically increasing frame counter.
44 /// V4L2: kernel sequence number (gaps indicate dropped frames).
45 /// AVFoundation: simple counter incremented by the delegate.
46 ///
47 /// 单调递增的帧计数器。
48 /// V4L2:内核序号(间隔表示丢帧)。
49 /// AVFoundation:delegate 递增的简单计数器。
50 pub sequence: u64,
51
52 /// Capture timestamp in microseconds.
53 /// 采集时间戳(微秒)。
54 pub timestamp_us: u64,
55}
56
57// ─── Platform backends ───────────────────────────────────────────────────────
58

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected