pub struct PartitionPack {Show 15 fields
pub kind: PartitionKind,
pub status: PartitionStatus,
pub major_version: u16,
pub minor_version: u16,
pub kag_size: u32,
pub this_partition: u64,
pub previous_partition: u64,
pub footer_partition: u64,
pub header_byte_count: u64,
pub index_byte_count: u64,
pub index_sid: u32,
pub body_offset: u64,
pub body_sid: u32,
pub operational_pattern: UlBytes,
pub essence_containers: Vec<UlBytes>,
}Expand description
The Partition Pack — SMPTE ST 377-1:2019 §7.1, Table 4 (Key) + Table 5
(Value). Covers the Header/Body/Footer variants (§7.2-7.4); which one a
given instance is lives in kind.
Fields§
§kind: PartitionKindWhich kind of Partition this is (Table 4 byte 14).
status: PartitionStatusOpen/Closed × Complete/Incomplete (Table 4 byte 15).
major_version: u16Fixed 0x0001 for this revision.
minor_version: u16Fixed 0x0003 for this revision (0x0002 = ST 377M-2004).
kag_size: u32KLV Alignment Grid size in bytes: 0=undefined, 1=byte-aligned,
2..=1048576 a valid grid, >1048576 forbidden (§6.4.1).
this_partition: u64Byte offset of this Partition from the start of the Header Partition (always 0 for the Header Partition itself).
previous_partition: u64Byte offset of the previous Partition (0 for the first Partition after the Header).
Byte offset of the Footer Partition (0 if not yet known).
header_byte_count: u64Bytes used for Header Metadata + Primer Pack in this Partition (0 if none).
index_byte_count: u64Bytes used for Index Table Segments in this Partition (0 if none).
index_sid: u32Index Table Segment stream ID in this Partition (0 = none).
body_offset: u64Byte offset of the Essence Container segment in this Partition, relative to the start of its BodySID stream.
body_sid: u32Essence Container stream ID in this Partition (0 = none).
operational_pattern: UlBytesOperational Pattern UL (copy of the Preface’s own value).
essence_containers: Vec<UlBytes>Batch of Essence Container ULs used in/referenced by this file.
Implementations§
Source§impl PartitionPack
impl PartitionPack
Sourcepub fn key(kind: PartitionKind, status: PartitionStatus) -> UlBytes
pub fn key(kind: PartitionKind, status: PartitionStatus) -> UlBytes
Build the 16-byte Key for kind/status (Table 4/6/7/8).
Byte numbering (1-indexed per the spec) -> 0-indexed array position:
bytes 1-7 = the fixed prefix 06 0E 2B 34 02 05 01; byte 8 =
registry version (wildcard on parse, written as 0x01); bytes 9-12
= the fixed mid section 0D 01 02 01; byte 13 = Structure Kind
(0x01, part of the fixed prefix); byte 14 = Partition Kind
(PartitionKind); byte 15 = Partition Status (PartitionStatus);
byte 16 = reserved (0x00).
Sourcepub fn is_partition_key(key: &UlBytes) -> bool
pub fn is_partition_key(key: &UlBytes) -> bool
True if key matches the Partition Pack Key (Table 4): the fixed
prefix bytes AND byte 14 one of the three valid PartitionKind
values. Useful to recognize a Partition Pack while walking a file’s
top-level KLV items, before committing to a full parse.
The fixed prefix alone is not sufficient to distinguish a
Partition Pack from a crate::PrimerPack or
crate::RandomIndexPack Key: all three share the same “Defined-
Length Pack, Set/Pack Registry” family (bytes 1-13, Tables 4/13/29)
and differ only in byte 14 (0x02/0x03/0x04 Partition vs. 0x05
Primer Pack vs. 0x11 Random Index Pack) — so byte 14 must be
checked too, not just the shared prefix.
Trait Implementations§
Source§impl Clone for PartitionPack
impl Clone for PartitionPack
Source§fn clone(&self) -> PartitionPack
fn clone(&self) -> PartitionPack
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PartitionPack
impl Debug for PartitionPack
impl Eq for PartitionPack
Source§impl<'a> Parse<'a> for PartitionPack
impl<'a> Parse<'a> for PartitionPack
Source§impl PartialEq for PartitionPack
impl PartialEq for PartitionPack
Source§impl Serialize for PartitionPack
impl Serialize for PartitionPack
Source§type Error = Error
type Error = Error
Parse impl, but need not be).Source§fn serialized_len(&self) -> usize
fn serialized_len(&self) -> usize
serialize_into will write.