1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/// Default bounded capacity of the PTS-ordered decoded video frame queue.
pub const VIDEO_DEFAULT_QUEUE_CAPACITY: usize = 6;
/// Default bounded capacity of the reusable CPU RGBA8 decoded video frame pool.
pub const VIDEO_DEFAULT_POOL_CAPACITY: usize = 8;
/// Default maximum lateness threshold in microseconds before dropping stale queued frames (`50 ms`).
pub const VIDEO_DEFAULT_MAX_LATE_US: i64 = 50_000;
/// Default presentation tolerance in microseconds allowing early match within half a millisecond (`500 us`).
pub const VIDEO_PRESENT_TOLERANCE_US: i64 = 500;
/// Microseconds per second conversion constant for media timeline math.
pub const VIDEO_MICROS_PER_SEC: u64 = 1_000_000;
/// Magic four-byte prefix identifying pure-Rust `SoftwareVideoDecoder` structured video frames.
pub const VIDEO_SW_FRAME_MAGIC: & = b"EVF1";
/// Packet kind tag for uncompressed intra-coded RGBA8 frames inside `EVF1` packets.
pub const VIDEO_SW_PACKET_INTRA_RGBA: u8 = 0;
/// Packet kind tag for intra-coded YUV420P frames converted via `VideoColorInfo` matrix math.
pub const VIDEO_SW_PACKET_INTRA_YUV420P: u8 = 1;
/// Packet kind tag for P-frame XOR delta packets dependent on the preceding reference frame.
pub const VIDEO_SW_PACKET_DELTA_XOR: u8 = 2;
pub const MP4_BOX_FTYP: = *b"ftyp";
pub const MP4_BOX_MOOV: = *b"moov";
pub const MP4_BOX_MVHD: = *b"mvhd";
pub const MP4_BOX_TRAK: = *b"trak";
pub const MP4_BOX_TKHD: = *b"tkhd";
pub const MP4_BOX_MDIA: = *b"mdia";
pub const MP4_BOX_MDHD: = *b"mdhd";
pub const MP4_BOX_HDLR: = *b"hdlr";
pub const MP4_BOX_MINF: = *b"minf";
pub const MP4_BOX_STBL: = *b"stbl";
pub const MP4_BOX_STSD: = *b"stsd";
pub const MP4_BOX_COLR: = *b"colr";
pub const MP4_BOX_NCLX: = *b"nclx";
pub const MP4_BOX_STTS: = *b"stts";
pub const MP4_BOX_CTTS: = *b"ctts";
pub const MP4_BOX_STSS: = *b"stss";
pub const MP4_BOX_STSC: = *b"stsc";
pub const MP4_BOX_STSZ: = *b"stsz";
pub const MP4_BOX_STCO: = *b"stco";
pub const MP4_BOX_CO64: = *b"co64";
pub const MP4_BOX_MDAT: = *b"mdat";
pub const MP4_HANDLER_VIDE: = *b"vide";
pub const MP4_HANDLER_SOUN: = *b"soun";
pub const MP4_BRAND_ISOM: = *b"isom";
pub const MP4_BRAND_MP42: = *b"mp42";
pub const MP4_CODEC_AVC1: = *b"avc1";
pub const MP4_CODEC_AVC3: = *b"avc3";
pub const MP4_CODEC_HVC1: = *b"hvc1";
pub const MP4_CODEC_HEV1: = *b"hev1";
pub const MP4_CODEC_VP09: = *b"vp09";
pub const MP4_CODEC_AV01: = *b"av01";
pub const MP4_CODEC_RAWV: = *b"rawv";
pub const MP4_CODEC_RGBA: = *b"rgba";
pub const MP4_CODEC_MP4A: = *b"mp4a";
pub const MP4_CODEC_OPUS: = *b"Opus";
pub const VIDEO_WORKER_THREAD_NAME: &str = "euv-video-decode";
pub const VIDEO_ERR_MP4_EMPTY: &str = "MP4 container buffer is empty";
pub const VIDEO_ERR_MP4_TRUNCATED_BOX: &str = "MP4 box header or payload is truncated";
pub const VIDEO_ERR_MP4_NO_MOOV: &str = "MP4 container is missing a moov box";
pub const VIDEO_ERR_MP4_NO_VIDEO_TRACK: &str = "MP4 container has no decodable video track";
pub const VIDEO_ERR_MP4_SAMPLE_BOUNDS: &str =
"MP4 sample byte range exceeds container bounds";
pub const VIDEO_ERR_SW_PACKET_INVALID: &str =
"Software video decoder received malformed packet";
pub const VIDEO_ERR_SW_PACKET_SIZE: &str =
"Software video packet payload size does not match frame dimensions";
pub const VIDEO_ERR_SW_DELTA_NO_REF: &str =
"Delta video frame cannot be decoded before an intra keyframe";
pub const VIDEO_ERR_POOL_EXHAUSTED: &str =
"Bounded CPU video frame pool has no available slots";
pub const VIDEO_ERR_UNSUPPORTED_DIMENSIONS: &str =
"Video frame dimensions exceed valid non-zero bounds";
pub const VIDEO_ERR_UNSUPPORTED_CODEC: &str =
"Software fallback cannot decode compressed bitstream without a hardware or codec backend";
pub const VIDEO_DEFAULT_BRAND_STR: &str = "isom";
pub const VIDEO_FORMAT_MP4_PREFIX: &str = "MP4 ยท ";
pub const VIDEO_CODEC_LABEL_H264: &str = "H.264";
pub const VIDEO_CODEC_LABEL_H265: &str = "H.265";
pub const VIDEO_CODEC_LABEL_VP9: &str = "VP9";
pub const VIDEO_CODEC_LABEL_AV1: &str = "AV1";
pub const VIDEO_CODEC_LABEL_RAW: &str = "RawFrames";