-
Notifications
You must be signed in to change notification settings - Fork 344
/
Copy pathsidx.js
27 lines (26 loc) · 907 Bytes
/
sidx.js
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
BoxParser.createFullBoxCtor("sidx", "CompressedSegmentIndexBox", function(stream) {
this.reference_ID = stream.readUint32();
this.timescale = stream.readUint32();
if (this.version === 0) {
this.earliest_presentation_time = stream.readUint32();
this.first_offset = stream.readUint32();
} else {
this.earliest_presentation_time = stream.readUint64();
this.first_offset = stream.readUint64();
}
stream.readUint16();
this.references = [];
var count = stream.readUint16();
for (var i = 0; i < count; i++) {
var ref = {};
this.references.push(ref);
var tmp_32 = stream.readUint32();
ref.reference_type = (tmp_32 >> 31) & 0x1;
ref.referenced_size = tmp_32 & 0x7FFFFFFF;
ref.subsegment_duration = stream.readUint32();
tmp_32 = stream.readUint32();
ref.starts_with_SAP = (tmp_32 >> 31) & 0x1;
ref.SAP_type = (tmp_32 >> 28) & 0x7;
ref.SAP_delta_time = tmp_32 & 0xFFFFFFF;
}
});