trak (Track Box)

Created
Jan 22, 2022 09:38 AM
Tags
This is a container box for a single track of a presentation. A presentation consists of one or more tracks. Each track is independent of the other tracks in the presentation and carries its own temporal and spatial information. Each track will contain its associated Media Box.
Tracks are used for two purposes: (a) to contain media data (media tracks) and (b) to contain packetization information for streaming protocols (hint tracks).
use crate::atoms::*; pub struct TrakBox { pub tkhd: TkhdBox, pub edts: Option<EdtsBox>, pub mdia: MdiaBox, } impl TrakBox { pub fn get_type(&self) -> BoxType { BoxType::TrakBox } pub fn get_size(&self) -> u64 { let mut size = HEADER_SIZE; size += self.tkhd.box_size(); if let Some(ref edts) = self.edts { size += edts.box_size(); } size += self.mdia.box_size(); size } }