async_mp4/mp4box/
mvhd.rs

1use fixed_macro::fixed;
2use crate::full_box;
3use crate::types::date::Mp4DateTime;
4use crate::types::duration::Mp4Duration;
5use fixed::types::I8F8;
6use fixed::types::I16F16;
7use crate::matrix::MP4Matrix;
8
9full_box! {
10    box (b"mvhd", Mvhd, MvhdBox, u32)
11    data {
12        creation_time: Mp4DateTime,
13        modification_time: Mp4DateTime,
14        timescale: u32,
15        duration: Mp4Duration,
16        rate: I16F16,
17        volume: I8F8,
18        _r1: u16,
19        _r2: [u32; 2],
20        matrix: MP4Matrix,
21        _r3: [u32; 6],
22        next_track_id: u32
23    }
24}
25
26impl Default for Mvhd {
27    fn default() -> Self {
28        Self {
29            creation_time: Default::default(),
30            modification_time: Default::default(),
31            timescale: 1000,
32            duration: Default::default(),
33            rate: fixed!(1: I16F16),
34            volume: fixed!(1: I8F8),
35            _r1: Default::default(),
36            _r2: Default::default(),
37            matrix: Default::default(),
38            _r3: Default::default(),
39            next_track_id: 1
40        }
41    }
42}