-
Notifications
You must be signed in to change notification settings - Fork 335
/
vpcC.js
28 lines (28 loc) · 1.05 KB
/
vpcC.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
27
28
BoxParser.createFullBoxCtor("vpcC", function (stream) {
var tmp;
if (this.version === 1) {
this.profile = stream.readUint8();
this.level = stream.readUint8();
tmp = stream.readUint8();
this.bitDepth = tmp >> 4;
this.chromaSubsampling = (tmp >> 1) & 0x7;
this.videoFullRangeFlag = tmp & 0x1;
this.colourPrimaries = stream.readUint8();
this.transferCharacteristics = stream.readUint8();
this.matrixCoefficients = stream.readUint8();
this.codecIntializationDataSize = stream.readUint16();
this.codecIntializationData = stream.readUint8Array(this.codecIntializationDataSize);
} else {
this.profile = stream.readUint8();
this.level = stream.readUint8();
tmp = stream.readUint8();
this.bitDepth = (tmp >> 4) & 0xF;
this.colorSpace = tmp & 0xF;
tmp = stream.readUint8();
this.chromaSubsampling = (tmp >> 4) & 0xF;
this.transferFunction = (tmp >> 1) & 0x7;
this.videoFullRangeFlag = tmp & 0x1;
this.codecIntializationDataSize = stream.readUint16();
this.codecIntializationData = stream.readUint8Array(this.codecIntializationDataSize);
}
});