Skip to content

Commit

Permalink
Merge pull request #402 from jamrial/lhvC
Browse files Browse the repository at this point in the history
add support for lhvC box
  • Loading branch information
rbouqueau authored Jul 12, 2024
2 parents 7c43087 + fd19340 commit c6cc468
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/parsing/lhvC.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BoxParser.createBoxCtor("lhvC", function(stream) {
var i, j;
var tmp_byte;
this.configurationVersion = stream.readUint8();
this.min_spatial_segmentation_idc = stream.readUint16() & 0xFFF;
this.parallelismType = (stream.readUint8() & 0x3);
tmp_byte = stream.readUint8();
this.numTemporalLayers = (tmp_byte & 0XD) >> 3;
this.temporalIdNested = (tmp_byte & 0X4) >> 2;
this.lengthSizeMinusOne = (tmp_byte & 0X3);

this.nalu_arrays = [];
var numOfArrays = stream.readUint8();
for (i = 0; i < numOfArrays; i++) {
var nalu_array = [];
this.nalu_arrays.push(nalu_array);
tmp_byte = stream.readUint8()
nalu_array.completeness = (tmp_byte & 0x80) >> 7;
nalu_array.nalu_type = tmp_byte & 0x3F;
var numNalus = stream.readUint16();
for (j = 0; j < numNalus; j++) {
var nalu = {}
nalu_array.push(nalu);
var length = stream.readUint16();
nalu.data = stream.readUint8Array(length);
}
}
});

0 comments on commit c6cc468

Please sign in to comment.