all atoms for init segment

This commit is contained in:
Muaz Ahmad 2023-10-18 13:36:27 +05:00
parent b9a7b10639
commit 9680ffd46b

View file

@ -10,6 +10,12 @@ struct WindowMatrix {
w: u32, w: u32,
} }
struct Edits {
duration: u64,
start: u64,
play_rate: u32,
}
struct MOOV { struct MOOV {
mvhd: MVHD, mvhd: MVHD,
traks: [TRAK; 2], traks: [TRAK; 2],
@ -19,10 +25,10 @@ struct MOOV {
struct MVHD { struct MVHD {
version: u8, version: u8,
flags: u32, flags: u32,
create_time: u32, create_time: u64,
modify_time: u32, modify_time: u64,
time_scale: u32, time_scale: u32,
duration: u32, duration: u64,
playrate: u32, playrate: u32,
volume: u16, volume: u16,
matrix: WindowMatrix, matrix: WindowMatrix,
@ -36,13 +42,13 @@ struct TRAK {
} }
struct TKHD { struct TKHD {
version: u32, version: u8,
flags: u32, flags: u32,
create_time: u32, create_time: u64,
modify_time: u32, modify_time: u64,
track_id: u32, track_id: u32,
time_scale: u32, time_scale: u32,
duration: u32, duration: u64,
layer: u16, layer: u16,
alt_group: u16, alt_group: u16,
volume: u16, volume: u16,
@ -51,8 +57,157 @@ struct TKHD {
height: u32, height: u32,
} }
struct EDTS; struct EDTS {
elst: ELST,
}
struct MDIA; struct ELST {
version: u8,
flags: u32,
num_edits: u32,
edits: Vec<Edits>,
}
struct MVEX; struct MDIA {
mdhd: MDHD,
hdlr: HDLR,
minf: MINF,
}
struct MDHD {
version: u8,
flags: u32,
create_time: u64,
modify_time: u64,
time_scale: u32,
duration: u64,
language: u32,
}
struct HDLR {
version: u8,
flags: u32,
handler: u32,
name: String,
}
enum MINF {
Video(MINF_V),
Audio(MINF_A),
}
struct MINF_V {
vmhd: VMHD,
dinf: DINF,
stbl: STBL,
}
struct VMHD {
version: u8,
flags: u32,
mode: u16,
opcolor: [u16; 3],
}
struct MINF_A {
smhd: SMHD,
dinf: DINF,
stbl: STBL,
}
struct SMHD {
version: u8,
flags: u32,
balance: u16,
}
struct DINF {
dref: DREF,
}
struct DREF {
version: u8,
flags: u32,
num_refs: u32,
refs: Vec<Refs>
}
enum Refs {
RefURL(URL),
RefURN(URN),
}
struct URL {
version: u8,
flags: u32,
url: String,
}
struct URN {
version: u8,
flags: u32,
urn: String,
}
struct STBL {
stsd: Vec<u8>,
stts: STTS,
stsc: STSC,
stsz: STSZ,
stco: STCO,
opts: Vec<Vec<u8>>,
}
struct STTS {
version: u8,
flags: u32,
num_entires: u32,
entires: Vec<STTSEntry>,
}
struct STTSEntry {
count_consec: u32,
duration: u32,
}
struct STSC {
version: u8,
flags: u32,
num_entries: u32,
entries: Vec<STSCEntry>,
}
struct STSCEntry {
chunk_idx: u32,
samples_per: u32,
data_ref_idx: u32,
}
struct STSZ {
version: u8,
flags: u32,
common_size: u32,
num_entries: u32,
entries: Vec<u32>,
}
struct STCO {
version: u8,
flags: u32,
num_entries: u32,
entries: Vec<u32>,
}
struct MVEX {
trexs: [TREX; 2],
}
struct TREX {
version: u8,
flags: u32,
track_id: u32,
default_desc_idx: u32,
default_duration: u32,
default_size: u32,
default_flags: u32,
}