Skip to main content

parse_chunks

Function parse_chunks 

Source
pub fn parse_chunks(
    payload: &[u8],
) -> Result<Vec<(u32, usize, usize)>, U3vError>
Expand description

The chunks of a USB3 Vision chunk payload, as (chunk ID, offset, length) in payload order.

The layout is GigE Vision’s — each chunk its data followed by an 8-byte tag, so the payload is read from its end — with the tag’s ID and length little-endian, as aravis reads a USB3 Vision buffer’s chunks (arvuvstream.c sets chunk_endianness to little-endian; corroboration only, the USB3 Vision standard is not available to us). With an image payload the image is the first chunk.

Remote input: a tag that claims more than precedes it, or a front too short for a tag, is an error.