mp4_atom/moof/traf/
mod.rs

1mod tfdt;
2mod tfhd;
3mod trun;
4
5pub use tfdt::*;
6pub use tfhd::*;
7pub use trun::*;
8
9use crate::*;
10
11#[derive(Debug, Clone, PartialEq, Eq, Default)]
12#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
13pub struct Traf {
14    pub tfhd: Tfhd,
15    pub tfdt: Option<Tfdt>,
16    pub trun: Vec<Trun>,
17    pub sbgp: Vec<Sbgp>,
18    pub sgpd: Vec<Sgpd>,
19    pub subs: Vec<Subs>,
20    pub saiz: Vec<Saiz>,
21    pub saio: Vec<Saio>,
22    pub meta: Option<Meta>,
23    pub udta: Option<Udta>,
24}
25
26impl Atom for Traf {
27    const KIND: FourCC = FourCC::new(b"traf");
28
29    nested! {
30        required: [ Tfhd ],
31        optional: [ Tfdt, Meta, Udta ],
32        multiple: [ Trun, Sbgp, Sgpd, Subs, Saiz, Saio ],
33    }
34}