pub struct FrameInner { /* private fields */ }Expand description
The owned body of a refcounted Frame. Send + Sync.
Holds a sync::Arena (the bytes), a fixed-size table of
(offset_in_arena, length_in_bytes) pairs (one per plane), and a
FrameHeader. The plane_count field tracks how many entries
of plane_offsets are actually populated. Up to MAX_PLANES
planes are supported.
Lifetime: an Arena returns its buffer to the pool when
dropped. An Arc<FrameInner> keeps the arena alive via its single
owned field, so as long as any clone of a Frame exists the
underlying buffer stays out of the pool.
Implementations§
Source§impl FrameInner
impl FrameInner
Sourcepub fn new(
arena: Arena,
planes: &[(usize, usize)],
header: FrameHeader,
) -> Result<Frame>
pub fn new( arena: Arena, planes: &[(usize, usize)], header: FrameHeader, ) -> Result<Frame>
Construct a Frame (Arc<FrameInner>) from an arena, a slice
of (offset, length) plane descriptors, and a header. Returns
Error::InvalidData if more than MAX_PLANES planes are
supplied or if any plane range falls outside the arena’s used
region.
Sourcepub fn plane_count(&self) -> usize
pub fn plane_count(&self) -> usize
Number of planes this frame holds.
Sourcepub fn plane(&self, i: usize) -> Option<&[u8]>
pub fn plane(&self, i: usize) -> Option<&[u8]>
Read-only access to plane i. Returns None if i is out of
range.
Sourcepub fn header(&self) -> &FrameHeader
pub fn header(&self) -> &FrameHeader
Frame header (width / height / pixel format / pts).