pub struct FrameDescriptor {Show 15 fields
pub v: u16,
pub camera_id: String,
pub frame_id: u64,
pub ts_ns: u64,
pub ts_sensor_ns: Option<u64>,
pub exposure_ns: Option<u32>,
pub trigger_seq: Option<u64>,
pub timebase: u8,
pub width: u32,
pub height: u32,
pub format: FrameFormat,
pub shm_name: String,
pub slot: u32,
pub seq: u64,
pub byte_len: u32,
}Expand description
The small message published on vision.frame. It names the ring slot a
consumer should read and carries the seq that the per-slot seqlock must
still hold for the read to be valid.
Fields§
§v: u16Wire version, stamped on every descriptor and checked on decode. A consumer that sees a version it does not speak rejects the frame instead of mis-parsing it. Deliberately carries no serde default: a payload missing this field fails to decode.
camera_id: StringSource camera id (a UVC/CSI device the engine owns, or the FPV camera tapped from the video pipeline). Lets a consumer filter by camera.
frame_id: u64Monotonic frame counter for this camera, starting at 1.
ts_ns: u64Host CLOCK_MONOTONIC ns: exposure midpoint when known, else arrival.
ts_sensor_ns: Option<u64>Source-clock timestamp in ns, interpreted per timebase.
exposure_ns: Option<u32>Exposure duration in ns, when the source reports it.
trigger_seq: Option<u64>Hardware trigger sequence that produced this frame, when known.
timebase: u8Clock domain of ts_sensor_ns (TIMEBASE_*).
width: u32§height: u32§format: FrameFormat§shm_name: String/dev/shm name of the ring this frame lives in (one ring per camera).
slot: u32Slot index within the ring holding this frame’s pixels.
seq: u64Ring sequence stamped on the slot. A consumer re-checks this against the slot’s seqlock after copying; a mismatch means the writer recycled the slot mid-read and the frame must be dropped.
byte_len: u32Length of the valid pixel bytes in the slot (format.frame_bytes).
Implementations§
Source§impl FrameDescriptor
impl FrameDescriptor
Sourcepub fn to_msgpack(&self) -> Result<Vec<u8>, Error>
pub fn to_msgpack(&self) -> Result<Vec<u8>, Error>
Encode as a msgpack map with named keys (matches the Python reader).
Sourcepub fn from_msgpack(bytes: &[u8]) -> Result<Self, DescriptorError>
pub fn from_msgpack(bytes: &[u8]) -> Result<Self, DescriptorError>
Decode from a msgpack map, rejecting a descriptor whose wire version this
build does not speak. A missing v field fails the msgpack decode; a
present-but-unknown v returns DescriptorError::Version.
Trait Implementations§
Source§impl Clone for FrameDescriptor
impl Clone for FrameDescriptor
Source§impl Debug for FrameDescriptor
impl Debug for FrameDescriptor
Source§impl<'de> Deserialize<'de> for FrameDescriptor
impl<'de> Deserialize<'de> for FrameDescriptor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for FrameDescriptor
Source§impl PartialEq for FrameDescriptor
impl PartialEq for FrameDescriptor
Source§impl Serialize for FrameDescriptor
impl Serialize for FrameDescriptor
impl StructuralPartialEq for FrameDescriptor
Auto Trait Implementations§
impl Freeze for FrameDescriptor
impl RefUnwindSafe for FrameDescriptor
impl Send for FrameDescriptor
impl Sync for FrameDescriptor
impl Unpin for FrameDescriptor
impl UnsafeUnpin for FrameDescriptor
impl UnwindSafe for FrameDescriptor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.