Skip to main content

Frame

Struct Frame 

Source
pub struct Frame {
    pub domain: MemoryDomain,
    pub timing: FrameTiming,
    pub sequence: u64,
    pub meta: FrameMetaSet,
}

Fields§

§domain: MemoryDomain§timing: FrameTiming§sequence: u64§meta: FrameMetaSet

Per-frame metadata side-channel: typed blobs that travel with the buffer (the GstMeta / GstAnalyticsRelationMeta analog). Empty on construction. A zero-sized unit when the metadata feature is off, so the no_std / RTOS baseline pays nothing; with the feature on it is a typed FrameMetaSet carrying e.g. AnalyticsMeta detections. See crate::meta.

Implementations§

Source§

impl Frame

Source

pub fn new(domain: MemoryDomain, timing: FrameTiming, sequence: u64) -> Self

Construct a frame with an empty metadata set. Prefer this over the bare struct literal at new construction sites so a future Frame field addition does not break them.

Source

pub fn share(&self) -> Frame

Duplicate this frame for fan-out (a tee branch, or a multicast route). The buffer is shared where the memory domain allows it: GPU handles and pre-shared System bytes are refcounted (cheap), owned System bytes are deep-copied (the honest cost of handing CPU bytes to a second consumer). Per-frame metadata is shared by Arc refcount, with copy-on-write on the branch that mutates it, so the copies never alias. Frame is deliberately not Clone (owned CPU bytes make a silent clone a surprise cost); this is the explicit, named fan-out primitive instead. See MemoryDomain::share.

Fan-out is a heap operation (the domain share refcounts or deep-copies), so it is gated behind alloc; the heap-free MCU path is a single linear chain with no tee.

Trait Implementations§

Source§

impl Debug for Frame

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Frame

§

impl !UnwindSafe for Frame

§

impl Freeze for Frame

§

impl Send for Frame

§

impl Sync for Frame

§

impl Unpin for Frame

§

impl UnsafeUnpin for Frame

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ElementBound for T
where T: Send,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.