Skip to main content

Crate cavs_format

Crate cavs_format 

Source
Expand description

CAVS-1 binary container format: types, writer and reader.

CAVS-1 (Content-Addressable Versioned Streaming, v1) is a packaging layer for game content (builds, packs, bundles, patches) — and, secondarily, video. It stores deduplicated, content-hashed chunks plus the tables needed to reconstruct the original files byte-for-byte (raw assets, or fMP4/CMAF segments and playlists when packaging video).

On-disk layout (little-endian throughout):

+-----------------------------+ offset 0
| Superblock (64 bytes)       |
+-----------------------------+ offset 64
| DATA section (chunk bytes)  |  streamed while packing
+-----------------------------+
| TRACKS section              |
| DICT section                |
| CHUNKS section              |
| SEGMENTS section            |
| META section                |
| INTEGRITY section           |
+-----------------------------+
| Section directory           |  pointed to by the superblock
+-----------------------------+

See FORMAT.md at the workspace root for the full byte-level spec.

Structs§

ChunkRecord
Chunk-table record. data_offset is relative to the DATA section start.
Integrity
Integrity section contents.
PackStats
Summary of a finished pack, for reporting.
Reader
SectionEntry
One entry of the section directory.
SegmentRecord
Segment-directory record. Reconstruction of the segment payload is the ordered concatenation of the raw bytes of chunks.
Superblock
Superblock contents.
TrackRecord
Track-table record.
VerifyReport
Result of a full-file verification pass.
Writer

Enums§

FormatError
SectionType
Section identifiers.
SignatureStatus
Outcome of a content-signature check.
TrackKind
Track kinds.

Constants§

CHUNK_FLAG_ZSTD
Chunk flag bit: payload stored zstd-compressed.
COMPRESSION_NONE
Compression algorithm ids (superblock default and per-chunk flag).
COMPRESSION_ZSTD
MAGIC
File magic: “CAVS”.
MAX_CHUNK_RAW
Upper bound on a single chunk’s uncompressed size (256 MiB). Larger than any chunker’s max; used to cap decompression allocations from untrusted or corrupted files.
SECTION_DIR_ENTRY_LEN
Size of one section-directory entry: type(4) + offset(8) + len(8) + hash(32).
SEGMENT_FLAG_RANDOM_ACCESS
Segment flag bit: random-access point (keyframe bundle boundary).
SUPERBLOCK_LEN
Fixed superblock size in bytes.
VERSION_MAJOR
VERSION_MINOR

Type Aliases§

Result