pub struct VideoConverter { /* private fields */ }Expand description
Native V210/P216 conversion helpers retained with their selected runtime.
Both exports are resolved before construction succeeds. Operations use caller-owned initialized storage and do not allocate pixel buffers. Borrowed P216 inputs retain their original validated row and plane strides.
Implementations§
Source§impl VideoConverter
impl VideoConverter
Sourcepub fn new(ndi: &Ndi) -> Result<Self>
pub fn new(ndi: &Ndi) -> Result<Self>
Resolve both native utility functions from one initialized runtime.
§Errors
Returns Error::UnsupportedCapability when the runtime does not
provide both native V210/P216 conversion functions.
Sourcepub fn v210_to_p216(
&self,
layout: V210Layout,
source: &[u32],
destination: &mut VideoFrame,
) -> Result<()>
pub fn v210_to_p216( &self, layout: V210Layout, source: &[u32], destination: &mut VideoFrame, ) -> Result<()>
Unpack V210 into an existing P216 frame with matching dimensions.
source contains native 32-bit V210 words and complete row storage. Only
samples are replaced: destination timecode, timestamps, metadata and frame
headers remain unchanged. P216 samples contain the ten bits shifted left
by six. Extra source words and row padding are ignored.
§Errors
Error::InvalidFrame when destination is not a P216 frame of the
layout’s dimensions, or source is shorter than the layout’s storage.
destination is then unchanged.
Sourcepub fn p216_to_v210(
&self,
source: &(impl VideoSource + ?Sized),
layout: V210Layout,
destination: &mut [u32],
) -> Result<()>
pub fn p216_to_v210( &self, source: &(impl VideoSource + ?Sized), layout: V210Layout, destination: &mut [u32], ) -> Result<()>
Pack P216 into reusable V210 storage, discarding each sample’s low six bits.
Active output words are initialized to zero before the native call because the SDK preserves unused bits through read/modify/write operations. Their two unused high bits therefore remain zero. Row padding and extra trailing words are unchanged. V210 utility buffers carry no frame metadata.
Accepts owned, captured, FrameSync and external borrowed VideoSource
inputs, including padded P216 planes. The native utility reads the original
active rows with their validated stride; no intermediate pixel copy or
wrapper allocation is made. The source borrow lasts through the call.
§Errors
Error::InvalidFrame when source is not a P216 frame of the
layout’s dimensions, or destination is shorter than the layout’s
storage. destination is then unchanged.