@dolbylaboratories/alps 2.0.0 → 3.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/alps.bundle.js +262 -125
- package/dist/alps.bundle.js.map +2 -2
- package/dist/alps.bundle.min.js +1 -1
- package/package.json +2 -2
package/dist/alps.bundle.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../node_modules/codem-isoboxer/dist/iso_boxer.js", "../src/constants/isobmff_box_names.js", "../src/constants/toc_elements.js", "../src/bitwise_operations.js", "../src/get_sample_offsets.js", "../src/ac4_toc_parser_wrapper/bitsource.js", "../src/ac4_toc_parser_wrapper/filtersink.js", "../src/ac4_toc_parser.js", "../src/ac4_toc_parser_wrapper/index.js", "../src/alps_core.js", "../src/alps.js"],
|
|
4
|
-
"sourcesContent": ["/*! codem-isoboxer v0.3.10 https://github.com/madebyhiro/codem-isoboxer/blob/master/LICENSE.txt */\nvar ISOBoxer = {};\n\nISOBoxer.parseBuffer = function(arrayBuffer) {\n return new ISOFile(arrayBuffer).parse();\n};\n\nISOBoxer.addBoxProcessor = function(type, parser) {\n if (typeof type !== 'string' || typeof parser !== 'function') {\n return;\n }\n ISOBox.prototype._boxProcessors[type] = parser;\n};\n\nISOBoxer.createFile = function() {\n return new ISOFile();\n};\n\n// See ISOBoxer.append() for 'pos' parameter syntax\nISOBoxer.createBox = function(type, parent, pos) {\n var newBox = ISOBox.create(type);\n if (parent) {\n parent.append(newBox, pos);\n }\n return newBox;\n};\n\n// See ISOBoxer.append() for 'pos' parameter syntax\nISOBoxer.createFullBox = function(type, parent, pos) {\n var newBox = ISOBoxer.createBox(type, parent, pos);\n newBox.version = 0;\n newBox.flags = 0;\n return newBox;\n};\n\nISOBoxer.Utils = {};\nISOBoxer.Utils.dataViewToString = function(dataView, encoding) {\n var impliedEncoding = encoding || 'utf-8';\n if (typeof TextDecoder !== 'undefined') {\n return new TextDecoder(impliedEncoding).decode(dataView);\n }\n var a = [];\n var i = 0;\n\n if (impliedEncoding === 'utf-8') {\n /* The following algorithm is essentially a rewrite of the UTF8.decode at\n http://bannister.us/weblog/2007/simple-base64-encodedecode-javascript/\n */\n\n while (i < dataView.byteLength) {\n var c = dataView.getUint8(i++);\n if (c < 0x80) {\n // 1-byte character (7 bits)\n } else if (c < 0xe0) {\n // 2-byte character (11 bits)\n c = (c & 0x1f) << 6;\n c |= (dataView.getUint8(i++) & 0x3f);\n } else if (c < 0xf0) {\n // 3-byte character (16 bits)\n c = (c & 0xf) << 12;\n c |= (dataView.getUint8(i++) & 0x3f) << 6;\n c |= (dataView.getUint8(i++) & 0x3f);\n } else {\n // 4-byte character (21 bits)\n c = (c & 0x7) << 18;\n c |= (dataView.getUint8(i++) & 0x3f) << 12;\n c |= (dataView.getUint8(i++) & 0x3f) << 6;\n c |= (dataView.getUint8(i++) & 0x3f);\n }\n a.push(String.fromCharCode(c));\n }\n } else { // Just map byte-by-byte (probably wrong)\n while (i < dataView.byteLength) {\n a.push(String.fromCharCode(dataView.getUint8(i++)));\n }\n }\n return a.join('');\n};\n\nISOBoxer.Utils.utf8ToByteArray = function(string) {\n // Only UTF-8 encoding is supported by TextEncoder\n var u, i;\n if (typeof TextEncoder !== 'undefined') {\n u = new TextEncoder().encode(string);\n } else {\n u = [];\n for (i = 0; i < string.length; ++i) {\n var c = string.charCodeAt(i);\n if (c < 0x80) {\n u.push(c);\n } else if (c < 0x800) {\n u.push(0xC0 | (c >> 6));\n u.push(0x80 | (63 & c));\n } else if (c < 0x10000) {\n u.push(0xE0 | (c >> 12));\n u.push(0x80 | (63 & (c >> 6)));\n u.push(0x80 | (63 & c));\n } else {\n u.push(0xF0 | (c >> 18));\n u.push(0x80 | (63 & (c >> 12)));\n u.push(0x80 | (63 & (c >> 6)));\n u.push(0x80 | (63 & c));\n }\n }\n }\n return u;\n};\n\n// Method to append a box in the list of child boxes\n// The 'pos' parameter can be either:\n// - (number) a position index at which to insert the new box\n// - (string) the type of the box after which to insert the new box\n// - (object) the box after which to insert the new box\nISOBoxer.Utils.appendBox = function(parent, box, pos) {\n box._offset = parent._cursor.offset;\n box._root = (parent._root ? parent._root : parent);\n box._raw = parent._raw;\n box._parent = parent;\n\n if (pos === -1) {\n // The new box is a sub-box of the parent but not added in boxes array,\n // for example when the new box is set as an entry (see dref and stsd for example)\n return;\n }\n\n if (pos === undefined || pos === null) {\n parent.boxes.push(box);\n return;\n }\n\n var index = -1,\n type;\n\n if (typeof pos === \"number\") {\n index = pos;\n } else {\n if (typeof pos === \"string\") {\n type = pos;\n } else if (typeof pos === \"object\" && pos.type) {\n type = pos.type;\n } else {\n parent.boxes.push(box);\n return;\n }\n\n for (var i = 0; i < parent.boxes.length; i++) {\n if (type === parent.boxes[i].type) {\n index = i + 1;\n break;\n }\n }\n }\n parent.boxes.splice(index, 0, box);\n};\n\nif (typeof exports !== 'undefined') {\n exports.parseBuffer = ISOBoxer.parseBuffer;\n exports.addBoxProcessor = ISOBoxer.addBoxProcessor;\n exports.createFile = ISOBoxer.createFile;\n exports.createBox = ISOBoxer.createBox;\n exports.createFullBox = ISOBoxer.createFullBox;\n exports.Utils = ISOBoxer.Utils;\n}\n\nISOBoxer.Cursor = function(initialOffset) {\n this.offset = (typeof initialOffset == 'undefined' ? 0 : initialOffset);\n};\n\nvar ISOFile = function(arrayBuffer) {\n this._cursor = new ISOBoxer.Cursor();\n this.boxes = [];\n if (arrayBuffer) {\n this._raw = new DataView(arrayBuffer);\n }\n};\n\nISOFile.prototype.fetch = function(type) {\n var result = this.fetchAll(type, true);\n return (result.length ? result[0] : null);\n};\n\nISOFile.prototype.fetchAll = function(type, returnEarly) {\n var result = [];\n ISOFile._sweep.call(this, type, result, returnEarly);\n return result;\n};\n\nISOFile.prototype.parse = function() {\n this._cursor.offset = 0;\n this.boxes = [];\n while (this._cursor.offset < this._raw.byteLength) {\n var box = ISOBox.parse(this);\n\n // Box could not be parsed\n if (typeof box.type === 'undefined') break;\n\n this.boxes.push(box);\n }\n return this;\n};\n\nISOFile._sweep = function(type, result, returnEarly) {\n if (this.type && this.type == type) result.push(this);\n for (var box in this.boxes) {\n if (result.length && returnEarly) return;\n ISOFile._sweep.call(this.boxes[box], type, result, returnEarly);\n }\n};\n\nISOFile.prototype.write = function() {\n\n var length = 0,\n i;\n\n for (i = 0; i < this.boxes.length; i++) {\n length += this.boxes[i].getLength(false);\n }\n\n var bytes = new Uint8Array(length);\n this._rawo = new DataView(bytes.buffer);\n this.bytes = bytes;\n this._cursor.offset = 0;\n\n for (i = 0; i < this.boxes.length; i++) {\n this.boxes[i].write();\n }\n\n return bytes.buffer;\n};\n\nISOFile.prototype.append = function(box, pos) {\n ISOBoxer.Utils.appendBox(this, box, pos);\n};\nvar ISOBox = function() {\n this._cursor = new ISOBoxer.Cursor();\n};\n\nISOBox.parse = function(parent) {\n var newBox = new ISOBox();\n newBox._offset = parent._cursor.offset;\n newBox._root = (parent._root ? parent._root : parent);\n newBox._raw = parent._raw;\n newBox._parent = parent;\n newBox._parseBox();\n parent._cursor.offset = newBox._raw.byteOffset + newBox._raw.byteLength;\n return newBox;\n};\n\nISOBox.create = function(type) {\n var newBox = new ISOBox();\n newBox.type = type;\n newBox.boxes = [];\n return newBox;\n};\n\nISOBox.prototype._boxContainers = ['dinf', 'edts', 'mdia', 'meco', 'mfra', 'minf', 'moof', 'moov', 'mvex', 'stbl', 'strk', 'traf', 'trak', 'tref', 'udta', 'vttc', 'sinf', 'schi', 'encv', 'enca','meta','grpl','prsl'];\n\nISOBox.prototype._boxProcessors = {};\n\n///////////////////////////////////////////////////////////////////////////////////////////////////\n// Generic read/write functions\n\nISOBox.prototype._procField = function (name, type, size) {\n if (this._parsing) {\n this[name] = this._readField(type, size);\n }\n else {\n this._writeField(type, size, this[name]);\n }\n};\n\nISOBox.prototype._procFieldArray = function (name, length, type, size) {\n var i;\n if (this._parsing) {\n this[name] = [];\n for (i = 0; i < length; i++) {\n this[name][i] = this._readField(type, size);\n }\n }\n else {\n for (i = 0; i < this[name].length; i++) {\n this._writeField(type, size, this[name][i]);\n }\n }\n};\n\nISOBox.prototype._procFullBox = function() {\n this._procField('version', 'uint', 8);\n this._procField('flags', 'uint', 24);\n};\n\nISOBox.prototype._procEntries = function(name, length, fn) {\n var i;\n if (this._parsing) {\n this[name] = [];\n for (i = 0; i < length; i++) {\n this[name].push({});\n fn.call(this, this[name][i]);\n }\n }\n else {\n for (i = 0; i < length; i++) {\n fn.call(this, this[name][i]);\n }\n }\n};\n\nISOBox.prototype._procSubEntries = function(entry, name, length, fn) {\n var i;\n if (this._parsing) {\n entry[name] = [];\n for (i = 0; i < length; i++) {\n entry[name].push({});\n fn.call(this, entry[name][i]);\n }\n }\n else {\n for (i = 0; i < length; i++) {\n fn.call(this, entry[name][i]);\n }\n }\n};\n\nISOBox.prototype._procEntryField = function (entry, name, type, size) {\n if (this._parsing) {\n entry[name] = this._readField(type, size);\n }\n else {\n this._writeField(type, size, entry[name]);\n }\n};\n\nISOBox.prototype._procSubBoxes = function(name, length) {\n var i;\n if (this._parsing) {\n this[name] = [];\n for (i = 0; i < length; i++) {\n this[name].push(ISOBox.parse(this));\n }\n }\n else {\n for (i = 0; i < length; i++) {\n if (this._rawo) {\n this[name][i].write();\n } else {\n this.size += this[name][i].getLength();\n }\n }\n }\n};\n\n///////////////////////////////////////////////////////////////////////////////////////////////////\n// Read/parse functions\n\nISOBox.prototype._readField = function(type, size) {\n switch (type) {\n case 'uint':\n return this._readUint(size);\n case 'int':\n return this._readInt(size);\n case 'template':\n return this._readTemplate(size);\n case 'string':\n return (size === -1) ? this._readTerminatedString() : this._readString(size);\n case 'data':\n return this._readData(size);\n case 'utf8':\n return this._readUTF8String();\n case 'utf8string':\n return this._readUTF8TerminatedString();\n default:\n return -1;\n }\n};\n\nISOBox.prototype._readInt = function(size) {\n var result = null,\n offset = this._cursor.offset - this._raw.byteOffset;\n switch(size) {\n case 8:\n result = this._raw.getInt8(offset);\n break;\n case 16:\n result = this._raw.getInt16(offset);\n break;\n case 32:\n result = this._raw.getInt32(offset);\n break;\n case 64:\n // Warning: JavaScript cannot handle 64-bit integers natively.\n // This will give unexpected results for integers >= 2^53\n var s1 = this._raw.getInt32(offset);\n var s2 = this._raw.getInt32(offset + 4);\n result = (s1 * Math.pow(2,32)) + s2;\n break;\n }\n this._cursor.offset += (size >> 3);\n return result;\n};\n\nISOBox.prototype._readUint = function(size) {\n var result = null,\n offset = this._cursor.offset - this._raw.byteOffset,\n s1, s2;\n switch(size) {\n case 8:\n result = this._raw.getUint8(offset);\n break;\n case 16:\n result = this._raw.getUint16(offset);\n break;\n case 24:\n s1 = this._raw.getUint16(offset);\n s2 = this._raw.getUint8(offset + 2);\n result = (s1 << 8) + s2;\n break;\n case 32:\n result = this._raw.getUint32(offset);\n break;\n case 64:\n // Warning: JavaScript cannot handle 64-bit integers natively.\n // This will give unexpected results for integers >= 2^53\n s1 = this._raw.getUint32(offset);\n s2 = this._raw.getUint32(offset + 4);\n result = (s1 * Math.pow(2,32)) + s2;\n break;\n }\n this._cursor.offset += (size >> 3);\n return result;\n};\n\nISOBox.prototype._readString = function(length) {\n var str = '';\n for (var c = 0; c < length; c++) {\n var char = this._readUint(8);\n str += String.fromCharCode(char);\n }\n return str;\n};\n\nISOBox.prototype._readTemplate = function(size) {\n var pre = this._readUint(size / 2);\n var post = this._readUint(size / 2);\n return pre + (post / Math.pow(2, size / 2));\n};\n\nISOBox.prototype._readTerminatedString = function() {\n var str = '';\n while (this._cursor.offset - this._offset < this._raw.byteLength) {\n var char = this._readUint(8);\n if (char === 0) break;\n str += String.fromCharCode(char);\n }\n return str;\n};\n\nISOBox.prototype._readData = function(size) {\n var length = (size > 0) ? size : (this._raw.byteLength - (this._cursor.offset - this._offset));\n if (length > 0) {\n var data = new Uint8Array(this._raw.buffer, this._cursor.offset, length);\n\n this._cursor.offset += length;\n return data;\n }\n else {\n return null;\n }\n};\n\nISOBox.prototype._readUTF8String = function() {\n var length = this._raw.byteLength - (this._cursor.offset - this._offset);\n var data = null;\n if (length > 0) {\n data = new DataView(this._raw.buffer, this._cursor.offset, length);\n this._cursor.offset += length;\n }\n \n return data ? ISOBoxer.Utils.dataViewToString(data) : data;\n};\n\nISOBox.prototype._readUTF8TerminatedString = function() {\n var length = this._raw.byteLength - (this._cursor.offset - this._offset);\n var data = null;\n if (length > 0) {\n data = new DataView(this._raw.buffer, this._cursor.offset, length);\n\n var l;\n for (l=0; l<length; l++)\n if (data.getUint8(l) === 0)\n break;\n\n // remap the Dataview with the actual length\n data = new DataView(this._raw.buffer, this._cursor.offset, l);\n this._cursor.offset += Math.min(l+1, length);\n }\n\n return data ? ISOBoxer.Utils.dataViewToString(data) : data;\n};\n\nISOBox.prototype._parseBox = function() {\n this._parsing = true;\n this._cursor.offset = this._offset;\n\n // return immediately if there are not enough bytes to read the header\n if (this._offset + 8 > this._raw.buffer.byteLength) {\n this._root._incomplete = true;\n return;\n }\n\n this._procField('size', 'uint', 32);\n this._procField('type', 'string', 4);\n\n if (this.size === 1) { this._procField('largesize', 'uint', 64); }\n if (this.type === 'uuid') { this._procFieldArray('usertype', 16, 'uint', 8); }\n\n switch(this.size) {\n case 0:\n // Size zero indicates last box in the file. Consume remaining buffer.\n this._raw = new DataView(this._raw.buffer, this._offset);\n break;\n case 1:\n if (this._offset + this.size > this._raw.buffer.byteLength) {\n this._incomplete = true;\n this._root._incomplete = true;\n } else {\n this._raw = new DataView(this._raw.buffer, this._offset, this.largesize);\n }\n break;\n default:\n if (this._offset + this.size > this._raw.buffer.byteLength) {\n this._incomplete = true;\n this._root._incomplete = true;\n } else {\n this._raw = new DataView(this._raw.buffer, this._offset, this.size);\n }\n }\n\n // additional parsing\n if (!this._incomplete) {\n if (this._boxProcessors[this.type]) {\n this._boxProcessors[this.type].call(this);\n }\n if (this._boxContainers.indexOf(this.type) !== -1) {\n this._parseContainerBox();\n } else{\n // Unknown box => read and store box content\n this._data = this._readData();\n }\n }\n};\n\nISOBox.prototype._parseFullBox = function() {\n this.version = this._readUint(8);\n this.flags = this._readUint(24);\n};\n\nISOBox.prototype._parseContainerBox = function() {\n this.boxes = [];\n while (this._cursor.offset - this._raw.byteOffset < this._raw.byteLength) {\n this.boxes.push(ISOBox.parse(this));\n }\n};\n\n///////////////////////////////////////////////////////////////////////////////////////////////////\n// Write functions\n\nISOBox.prototype.append = function(box, pos) {\n ISOBoxer.Utils.appendBox(this, box, pos);\n};\n\nISOBox.prototype.getLength = function() {\n this._parsing = false;\n this._rawo = null;\n\n this.size = 0;\n this._procField('size', 'uint', 32);\n this._procField('type', 'string', 4);\n\n if (this.size === 1) { this._procField('largesize', 'uint', 64); }\n if (this.type === 'uuid') { this._procFieldArray('usertype', 16, 'uint', 8); }\n\n if (this._boxProcessors[this.type]) {\n this._boxProcessors[this.type].call(this);\n }\n\n if (this._boxContainers.indexOf(this.type) !== -1) {\n for (var i = 0; i < this.boxes.length; i++) {\n this.size += this.boxes[i].getLength();\n }\n } \n\n if (this._data) {\n this._writeData(this._data);\n }\n\n return this.size;\n};\n\nISOBox.prototype.write = function() {\n this._parsing = false;\n this._cursor.offset = this._parent._cursor.offset;\n\n switch(this.size) {\n case 0:\n this._rawo = new DataView(this._parent._rawo.buffer, this._cursor.offset, (this.parent._rawo.byteLength - this._cursor.offset));\n break;\n case 1:\n this._rawo = new DataView(this._parent._rawo.buffer, this._cursor.offset, this.largesize);\n break;\n default:\n this._rawo = new DataView(this._parent._rawo.buffer, this._cursor.offset, this.size);\n }\n\n this._procField('size', 'uint', 32);\n this._procField('type', 'string', 4);\n\n if (this.size === 1) { this._procField('largesize', 'uint', 64); }\n if (this.type === 'uuid') { this._procFieldArray('usertype', 16, 'uint', 8); }\n\n if (this._boxProcessors[this.type]) {\n this._boxProcessors[this.type].call(this);\n }\n\n if (this._boxContainers.indexOf(this.type) !== -1) {\n for (var i = 0; i < this.boxes.length; i++) {\n this.boxes[i].write();\n }\n } \n\n if (this._data) {\n this._writeData(this._data);\n }\n\n this._parent._cursor.offset += this.size;\n\n return this.size;\n};\n\nISOBox.prototype._writeInt = function(size, value) {\n if (this._rawo) {\n var offset = this._cursor.offset - this._rawo.byteOffset;\n switch(size) {\n case 8:\n this._rawo.setInt8(offset, value);\n break;\n case 16:\n this._rawo.setInt16(offset, value);\n break;\n case 32:\n this._rawo.setInt32(offset, value);\n break;\n case 64:\n // Warning: JavaScript cannot handle 64-bit integers natively.\n // This will give unexpected results for integers >= 2^53\n var s1 = Math.floor(value / Math.pow(2,32));\n var s2 = value - (s1 * Math.pow(2,32));\n this._rawo.setUint32(offset, s1);\n this._rawo.setUint32(offset + 4, s2);\n break;\n }\n this._cursor.offset += (size >> 3);\n } else {\n this.size += (size >> 3);\n }\n};\n\nISOBox.prototype._writeUint = function(size, value) {\n\n if (this._rawo) {\n var offset = this._cursor.offset - this._rawo.byteOffset,\n s1, s2;\n switch(size) {\n case 8:\n this._rawo.setUint8(offset, value);\n break;\n case 16:\n this._rawo.setUint16(offset, value);\n break;\n case 24:\n s1 = (value & 0xFFFF00) >> 8;\n s2 = (value & 0x0000FF);\n this._rawo.setUint16(offset, s1);\n this._rawo.setUint8(offset + 2, s2);\n break;\n case 32:\n this._rawo.setUint32(offset, value);\n break;\n case 64:\n // Warning: JavaScript cannot handle 64-bit integers natively.\n // This will give unexpected results for integers >= 2^53\n s1 = Math.floor(value / Math.pow(2,32));\n s2 = value - (s1 * Math.pow(2,32));\n this._rawo.setUint32(offset, s1);\n this._rawo.setUint32(offset + 4, s2);\n break;\n }\n this._cursor.offset += (size >> 3);\n } else {\n this.size += (size >> 3);\n }\n};\n\nISOBox.prototype._writeString = function(size, str) {\n for (var c = 0; c < size; c++) {\n this._writeUint(8, str.charCodeAt(c));\n }\n};\n\nISOBox.prototype._writeTerminatedString = function(str) {\n if (str.length === 0) {\n return;\n }\n for (var c = 0; c < str.length; c++) {\n this._writeUint(8, str.charCodeAt(c));\n }\n this._writeUint(8, 0);\n};\n\nISOBox.prototype._writeTemplate = function(size, value) {\n var pre = Math.floor(value);\n var post = (value - pre) * Math.pow(2, size / 2);\n this._writeUint(size / 2, pre);\n this._writeUint(size / 2, post);\n};\n\nISOBox.prototype._writeData = function(data) {\n var i;\n //data to copy\n if (data) {\n if (this._rawo) {\n //Array and Uint8Array has also to be managed\n if (data instanceof Array) {\n var offset = this._cursor.offset - this._rawo.byteOffset;\n for (var i = 0; i < data.length; i++) {\n this._rawo.setInt8(offset + i, data[i]);\n }\n this._cursor.offset += data.length;\n } \n\n if (data instanceof Uint8Array) {\n this._root.bytes.set(data, this._cursor.offset);\n this._cursor.offset += data.length;\n }\n\n } else {\n //nothing to copy only size to compute\n this.size += data.length;\n }\n }\n};\n\nISOBox.prototype._writeUTF8String = function(string) {\n var u = ISOBoxer.Utils.utf8ToByteArray(string);\n if (this._rawo) {\n var dataView = new DataView(this._rawo.buffer, this._cursor.offset, u.length);\n for (var i = 0; i < u.length; i++) {\n dataView.setUint8(i, u[i]);\n }\n } else {\n this.size += u.length;\n }\n};\n\nISOBox.prototype._writeField = function(type, size, value) {\n switch (type) {\n case 'uint':\n this._writeUint(size, value);\n break;\n case 'int':\n this._writeInt(size, value);\n break;\n case 'template':\n this._writeTemplate(size, value);\n break;\n case 'string':\n if (size == -1) {\n this._writeTerminatedString(value);\n } else {\n this._writeString(size, value);\n }\n break;\n case 'data':\n this._writeData(value);\n break;\n case 'utf8':\n this._writeUTF8String(value);\n break;\n default:\n break;\n }\n};\n\n// ISO/IEC 14496-12:202x - 12.2.8 Audio rendering indication box\nISOBox.prototype._boxProcessors['ardi'] = function() {\n this._procFullBox();\n this._procField('audio_rendering_indication', 'uint', 8);\n};\n\n// ISO/IEC 14496-15:2014 - avc1/2/3/4, hev1, hvc1, encv\nISOBox.prototype._boxProcessors['avc1'] =\nISOBox.prototype._boxProcessors['avc2'] =\nISOBox.prototype._boxProcessors['avc3'] =\nISOBox.prototype._boxProcessors['avc4'] =\nISOBox.prototype._boxProcessors['hvc1'] =\nISOBox.prototype._boxProcessors['hev1'] =\nISOBox.prototype._boxProcessors['encv'] = function() {\n // SampleEntry fields\n this._procFieldArray('reserved1', 6, 'uint', 8);\n this._procField('data_reference_index', 'uint', 16);\n // VisualSampleEntry fields\n this._procField('pre_defined1', 'uint', 16);\n this._procField('reserved2', 'uint', 16);\n this._procFieldArray('pre_defined2', 3, 'uint', 32);\n this._procField('width', 'uint', 16);\n this._procField('height', 'uint', 16);\n this._procField('horizresolution', 'template', 32);\n this._procField('vertresolution', 'template', 32);\n this._procField('reserved3', 'uint', 32);\n this._procField('frame_count', 'uint', 16);\n this._procFieldArray('compressorname', 32,'uint', 8);\n this._procField('depth', 'uint', 16);\n this._procField('pre_defined3', 'int', 16);\n // Codec-specific fields\n this._procField('config', 'data', -1);\n};\n\n// ISO/IEC 14496-12:2012 - 8.6.1.3 Composition Time To Sample Box\nISOBox.prototype._boxProcessors['ctts'] = function() {\n this._procFullBox();\n this._procField('entry_count', 'uint', 32);\n this._procEntries('entries', this.entry_count, function(entry) {\n this._procEntryField(entry, 'sample_count', 'uint', 32);\n this._procEntryField(entry, 'sample_offset', (this.version === 1) ? 'int' : 'uint', 32);\n });\n};\n\n// ISO/IEC 14496-12:2012 - 8.7.2 Data Reference Box\nISOBox.prototype._boxProcessors['dref'] = function() {\n this._procFullBox();\n this._procField('entry_count', 'uint', 32);\n this._procSubBoxes('entries', this.entry_count);\n};\n\n// ISO/IEC 14496-12:202x - 8.4.6 Extended language tag\nISOBox.prototype._boxProcessors['elng'] = function() {\n this._procFullBox();\n this._procField('extended_language', 'utf8string');\n};\n\n// ISO/IEC 14496-12:2012 - 8.6.6 Edit List Box\nISOBox.prototype._boxProcessors['elst'] = function() {\n this._procFullBox();\n this._procField('entry_count', 'uint', 32);\n this._procEntries('entries', this.entry_count, function(entry) {\n this._procEntryField(entry, 'segment_duration', 'uint', (this.version === 1) ? 64 : 32);\n this._procEntryField(entry, 'media_time', 'int', (this.version === 1) ? 64 : 32);\n this._procEntryField(entry, 'media_rate_integer', 'int', 16);\n this._procEntryField(entry, 'media_rate_fraction', 'int', 16);\n });\n};\n\n// ISO/IEC 23009-1:2014 - 5.10.3.3 Event Message Box\nISOBox.prototype._boxProcessors['emsg'] = function() {\n this._procFullBox();\n if (this.version == 1) {\n this._procField('timescale', 'uint', 32);\n this._procField('presentation_time', 'uint', 64);\n this._procField('event_duration', 'uint', 32);\n this._procField('id', 'uint', 32);\n this._procField('scheme_id_uri', 'string', -1);\n this._procField('value', 'string', -1);\n } else {\n this._procField('scheme_id_uri', 'string', -1);\n this._procField('value', 'string', -1);\n this._procField('timescale', 'uint', 32);\n this._procField('presentation_time_delta', 'uint', 32);\n this._procField('event_duration', 'uint', 32);\n this._procField('id', 'uint', 32);\n }\n this._procField('message_data', 'data', -1);\n};\n// ISO/IEC 14496-12:2012 - 8.1.2 Free Space Box\nISOBox.prototype._boxProcessors['free'] = ISOBox.prototype._boxProcessors['skip'] = function() {\n this._procField('data', 'data', -1);\n};\n\n// ISO/IEC 14496-12:2012 - 8.12.2 Original Format Box\nISOBox.prototype._boxProcessors['frma'] = function() {\n this._procField('data_format', 'uint', 32);\n};\n// ISO/IEC 14496-12:2012 - 4.3 File Type Box / 8.16.2 Segment Type Box\nISOBox.prototype._boxProcessors['ftyp'] =\nISOBox.prototype._boxProcessors['styp'] = function() {\n this._procField('major_brand', 'string', 4);\n this._procField('minor_version', 'uint', 32);\n var nbCompatibleBrands = -1;\n if (this._parsing) {\n nbCompatibleBrands = (this._raw.byteLength - (this._cursor.offset - this._raw.byteOffset)) / 4;\n }\n this._procFieldArray('compatible_brands', nbCompatibleBrands, 'string', 4);\n};\n\n// ISO/IEC 14496-12:2012 - 8.4.3 Handler Reference Box\nISOBox.prototype._boxProcessors['hdlr'] = function() {\n this._procFullBox();\n this._procField('pre_defined', 'uint', 32);\n this._procField('handler_type', 'string', 4);\n this._procFieldArray('reserved', 3, 'uint', 32);\n this._procField('name', 'string', -1);\n};\n\n// ISO/IEC 14496-12:2012 - 9.1.4.1 Identified media data box\nISOBox.prototype._boxProcessors['imda'] = function() {\n this._procField('imda_identifier', 'uint', 32);\n // until the end of the box\n this._procField('data', 'data', -1);\n};\n\n// ISO/IEC 14496-12:202x - 8.10.4 Track kind box\nISOBox.prototype._boxProcessors['kind'] = function() {\n this._procFullBox();\n\n this._procField('schemeURI', 'utf8string');\n this._procField('value', 'utf8string');\n};\n\n// ISO/IEC 14496-12:202x - 8.10.5 Label box\nISOBox.prototype._boxProcessors['labl'] = function() {\n this._procFullBox();\n this.is_group_label = (this.flags & 0x1) != 0;\n this._procField('label_id', 'uint', 16);\n this._procField('language', 'utf8string');\n this._procField('label', 'utf8string');\n};\n\n// ISO/IEC 14496-12:2012 - 8.1.1 Media Data Box\nISOBox.prototype._boxProcessors['mdat'] = function() {\n this._procField('data', 'data', -1);\n};\n\n// ISO/IEC 14496-12:2012 - 8.4.2 Media Header Box\nISOBox.prototype._boxProcessors['mdhd'] = function() {\n this._procFullBox();\n this._procField('creation_time', 'uint', (this.version == 1) ? 64 : 32);\n this._procField('modification_time', 'uint', (this.version == 1) ? 64 : 32);\n this._procField('timescale', 'uint', 32);\n this._procField('duration', 'uint', (this.version == 1) ? 64 : 32);\n if (!this._parsing && typeof this.language === 'string') {\n // In case of writing and language has been set as a string, then convert it into char codes array\n this.language = ((this.language.charCodeAt(0) - 0x60) << 10) |\n ((this.language.charCodeAt(1) - 0x60) << 5) |\n ((this.language.charCodeAt(2) - 0x60));\n }\n this._procField('language', 'uint', 16);\n if (this._parsing) {\n this.language = String.fromCharCode(((this.language >> 10) & 0x1F) + 0x60,\n ((this.language >> 5) & 0x1F) + 0x60,\n (this.language & 0x1F) + 0x60);\n }\n this._procField('pre_defined', 'uint', 16);\n};\n\n// ISO/IEC 14496-12:2012 - 8.8.2 Movie Extends Header Box\nISOBox.prototype._boxProcessors['mehd'] = function() {\n this._procFullBox();\n this._procField('fragment_duration', 'uint', (this.version == 1) ? 64 : 32);\n};\n\n// ISO/IEC 14496-12:202x - 8.11.1 Meta box\nISOBox.prototype._boxProcessors['meta'] = function() {\n this._procFullBox();\n\n /* rest of the boxes will be read by _parseContainerBox */\n};\n\n// ISO/IEC 14496-12:2012 - 8.8.5 Movie Fragment Header Box\nISOBox.prototype._boxProcessors['mfhd'] = function() {\n this._procFullBox();\n this._procField('sequence_number', 'uint', 32);\n};\n\n// ISO/IEC 14496-12:2012 - 8.8.11 Movie Fragment Random Access Box\nISOBox.prototype._boxProcessors['mfro'] = function() {\n this._procFullBox();\n this._procField('mfra_size', 'uint', 32); // Called mfra_size to distinguish from the normal \"size\" attribute of a box\n};\n\n\n// ISO/IEC 14496-12:2012 - 8.5.2.2 mp4a box (use AudioSampleEntry definition and naming)\nISOBox.prototype._boxProcessors['mp4a'] = ISOBox.prototype._boxProcessors['enca'] = function() {\n // SampleEntry fields\n this._procFieldArray('reserved1', 6, 'uint', 8);\n this._procField('data_reference_index', 'uint', 16);\n // AudioSampleEntry fields\n this._procFieldArray('reserved2', 2, 'uint', 32);\n this._procField('channelcount', 'uint', 16);\n this._procField('samplesize', 'uint', 16);\n this._procField('pre_defined', 'uint', 16);\n this._procField('reserved3', 'uint', 16);\n this._procField('samplerate', 'template', 32);\n // ESDescriptor fields\n this._procField('esds', 'data', -1);\n};\n\n// ISO/IEC 14496-12:2012 - 8.2.2 Movie Header Box\nISOBox.prototype._boxProcessors['mvhd'] = function() {\n this._procFullBox();\n this._procField('creation_time', 'uint', (this.version == 1) ? 64 : 32);\n this._procField('modification_time', 'uint', (this.version == 1) ? 64 : 32);\n this._procField('timescale', 'uint', 32);\n this._procField('duration', 'uint', (this.version == 1) ? 64 : 32);\n this._procField('rate', 'template', 32);\n this._procField('volume', 'template', 16);\n this._procField('reserved1', 'uint', 16);\n this._procFieldArray('reserved2', 2, 'uint', 32);\n this._procFieldArray('matrix', 9, 'template', 32);\n this._procFieldArray('pre_defined', 6,'uint', 32);\n this._procField('next_track_ID', 'uint', 32);\n};\n\n// ISO/IEC 14496-30:2014 - WebVTT Cue Payload Box.\nISOBox.prototype._boxProcessors['payl'] = function() {\n this._procField('cue_text', 'utf8');\n};\n\n// ISO/IEC 14496-12:2012 - 8.16.5 Producer Reference Time\nISOBox.prototype._boxProcessors['prft'] = function() {\n this._procFullBox();\n this._procField('reference_track_ID', 'uint', 32);\n this._procField('ntp_timestamp_sec', 'uint', 32);\n this._procField('ntp_timestamp_frac', 'uint', 32);\n this._procField('media_time', 'uint', (this.version == 1) ? 64 : 32);\n};\n\n// ISO/IEC 14496-12:202x - 8.18.4.1 Preselection group box\nISOBox.prototype._boxProcessors['prsl'] = function() {\n this._procFullBox();\n this._procField('group_id', 'uint', 32);\n this._procField('num_entities_in_group', 'uint', 32);\n this._procEntries('entities', this.num_entities_in_group, function(entry) {\n this._procEntryField(entry, 'entity_id', 'uint', 32);\n });\n if (this.flags & 0x1000) this._procField('preselection_tag', 'utf8string');\n if (this.flags & 0x2000) this._procField('selection_priority', 'uint', 8);\n if (this.flags & 0x4000) this._procField('interleaving_tag', 'utf8string');\n\n /* rest of the boxes will be read by _parseContainerBox */\n};\n\n//ISO/IEC 23001-7:2011 - 8.1 Protection System Specific Header Box\nISOBox.prototype._boxProcessors['pssh'] = function() {\n this._procFullBox();\n \n this._procFieldArray('SystemID', 16, 'uint', 8);\n this._procField('DataSize', 'uint', 32);\n this._procFieldArray('Data', this.DataSize, 'uint', 8);\n};\n// ISO/IEC 14496-12:2012 - 8.12.5 Scheme Type Box\nISOBox.prototype._boxProcessors['schm'] = function() {\n this._procFullBox();\n \n this._procField('scheme_type', 'uint', 32);\n this._procField('scheme_version', 'uint', 32);\n\n if (this.flags & 0x000001) {\n this._procField('scheme_uri', 'string', -1);\n }\n};\n// ISO/IEC 14496-12:2012 - 8.6.4.1 sdtp box \nISOBox.prototype._boxProcessors['sdtp'] = function() {\n this._procFullBox();\n\n var sample_count = -1;\n if (this._parsing) {\n sample_count = (this._raw.byteLength - (this._cursor.offset - this._raw.byteOffset));\n }\n\n this._procFieldArray('sample_dependency_table', sample_count, 'uint', 8);\n};\n\n// ISO/IEC 14496-12:2012 - 8.16.3 Segment Index Box\nISOBox.prototype._boxProcessors['sidx'] = function() {\n this._procFullBox();\n this._procField('reference_ID', 'uint', 32);\n this._procField('timescale', 'uint', 32);\n this._procField('earliest_presentation_time', 'uint', (this.version == 1) ? 64 : 32);\n this._procField('first_offset', 'uint', (this.version == 1) ? 64 : 32);\n this._procField('reserved', 'uint', 16);\n this._procField('reference_count', 'uint', 16);\n this._procEntries('references', this.reference_count, function(entry) {\n if (!this._parsing) {\n entry.reference = (entry.reference_type & 0x00000001) << 31;\n entry.reference |= (entry.referenced_size & 0x7FFFFFFF);\n entry.sap = (entry.starts_with_SAP & 0x00000001) << 31;\n entry.sap |= (entry.SAP_type & 0x00000003) << 28;\n entry.sap |= (entry.SAP_delta_time & 0x0FFFFFFF);\n }\n this._procEntryField(entry, 'reference', 'uint', 32);\n this._procEntryField(entry, 'subsegment_duration', 'uint', 32);\n this._procEntryField(entry, 'sap', 'uint', 32);\n if (this._parsing) {\n entry.reference_type = (entry.reference >> 31) & 0x00000001;\n entry.referenced_size = entry.reference & 0x7FFFFFFF;\n entry.starts_with_SAP = (entry.sap >> 31) & 0x00000001;\n entry.SAP_type = (entry.sap >> 28) & 0x00000007;\n entry.SAP_delta_time = (entry.sap & 0x0FFFFFFF);\n }\n });\n};\n\n// ISO/IEC 14496-12:2012 - 8.4.5.3 Sound Media Header Box\nISOBox.prototype._boxProcessors['smhd'] = function() {\n this._procFullBox();\n this._procField('balance', 'uint', 16);\n this._procField('reserved', 'uint', 16);\n};\n\n// ISO/IEC 14496-12:2012 - 8.16.4 Subsegment Index Box\nISOBox.prototype._boxProcessors['ssix'] = function() {\n this._procFullBox();\n this._procField('subsegment_count', 'uint', 32);\n this._procEntries('subsegments', this.subsegment_count, function(subsegment) {\n this._procEntryField(subsegment, 'ranges_count', 'uint', 32);\n this._procSubEntries(subsegment, 'ranges', subsegment.ranges_count, function(range) {\n this._procEntryField(range, 'level', 'uint', 8);\n this._procEntryField(range, 'range_size', 'uint', 24);\n });\n });\n};\n\n// ISO/IEC 14496-12:2012 - 8.5.2 Sample Description Box\nISOBox.prototype._boxProcessors['stsd'] = function() {\n this._procFullBox();\n this._procField('entry_count', 'uint', 32);\n this._procSubBoxes('entries', this.entry_count);\n};\n\n// ISO/IEC 14496-30:2014 - WebVTT Cue Settings Box.\nISOBox.prototype._boxProcessors['sttg'] = function() {\n this._procField('settings', 'utf8');\n};\n\n// ISO/IEC 14496-12:2012 - 8.6.1.2 Decoding Time To Sample Box\nISOBox.prototype._boxProcessors['stts'] = function() {\n this._procFullBox();\n this._procField('entry_count', 'uint', 32);\n this._procEntries('entries', this.entry_count, function(entry) {\n this._procEntryField(entry, 'sample_count', 'uint', 32);\n this._procEntryField(entry, 'sample_delta', 'uint', 32);\n });\n};\n\n// ISO/IEC 14496-12:2015 - 8.7.7 Sub-Sample Information Box\nISOBox.prototype._boxProcessors['subs'] = function () {\n this._procFullBox();\n this._procField('entry_count', 'uint', 32);\n this._procEntries('entries', this.entry_count, function(entry) {\n this._procEntryField(entry, 'sample_delta', 'uint', 32);\n this._procEntryField(entry, 'subsample_count', 'uint', 16);\n this._procSubEntries(entry, 'subsamples', entry.subsample_count, function(subsample) {\n this._procEntryField(subsample, 'subsample_size', 'uint', (this.version === 1) ? 32 : 16);\n this._procEntryField(subsample, 'subsample_priority', 'uint', 8);\n this._procEntryField(subsample, 'discardable', 'uint', 8);\n this._procEntryField(subsample, 'codec_specific_parameters', 'uint', 32);\n });\n });\n};\n\n//ISO/IEC 23001-7:2011 - 8.2 Track Encryption Box\nISOBox.prototype._boxProcessors['tenc'] = function() {\n this._procFullBox();\n\n this._procField('default_IsEncrypted', 'uint', 24);\n this._procField('default_IV_size', 'uint', 8);\n this._procFieldArray('default_KID', 16, 'uint', 8);\n };\n\n// ISO/IEC 14496-12:2012 - 8.8.12 Track Fragmnent Decode Time\nISOBox.prototype._boxProcessors['tfdt'] = function() {\n this._procFullBox();\n this._procField('baseMediaDecodeTime', 'uint', (this.version == 1) ? 64 : 32);\n};\n\n// ISO/IEC 14496-12:2012 - 8.8.7 Track Fragment Header Box\nISOBox.prototype._boxProcessors['tfhd'] = function() {\n this._procFullBox();\n this._procField('track_ID', 'uint', 32);\n if (this.flags & 0x01) this._procField('base_data_offset', 'uint', 64);\n if (this.flags & 0x02) this._procField('sample_description_offset', 'uint', 32);\n if (this.flags & 0x08) this._procField('default_sample_duration', 'uint', 32);\n if (this.flags & 0x10) this._procField('default_sample_size', 'uint', 32);\n if (this.flags & 0x20) this._procField('default_sample_flags', 'uint', 32);\n};\n\n// ISO/IEC 14496-12:2012 - 8.8.10 Track Fragment Random Access Box\nISOBox.prototype._boxProcessors['tfra'] = function() {\n this._procFullBox();\n this._procField('track_ID', 'uint', 32);\n if (!this._parsing) {\n this.reserved = 0;\n this.reserved |= (this.length_size_of_traf_num & 0x00000030) << 4;\n this.reserved |= (this.length_size_of_trun_num & 0x0000000C) << 2;\n this.reserved |= (this.length_size_of_sample_num & 0x00000003);\n }\n this._procField('reserved', 'uint', 32);\n if (this._parsing) {\n this.length_size_of_traf_num = (this.reserved & 0x00000030) >> 4;\n this.length_size_of_trun_num = (this.reserved & 0x0000000C) >> 2;\n this.length_size_of_sample_num = (this.reserved & 0x00000003);\n }\n this._procField('number_of_entry', 'uint', 32);\n this._procEntries('entries', this.number_of_entry, function(entry) {\n this._procEntryField(entry, 'time', 'uint', (this.version === 1) ? 64 : 32);\n this._procEntryField(entry, 'moof_offset', 'uint', (this.version === 1) ? 64 : 32);\n this._procEntryField(entry, 'traf_number', 'uint', (this.length_size_of_traf_num + 1) * 8);\n this._procEntryField(entry, 'trun_number', 'uint', (this.length_size_of_trun_num + 1) * 8);\n this._procEntryField(entry, 'sample_number', 'uint', (this.length_size_of_sample_num + 1) * 8);\n });\n};\n\n// ISO/IEC 14496-12:2012 - 8.3.2 Track Header Box\nISOBox.prototype._boxProcessors['tkhd'] = function() {\n this._procFullBox();\n this._procField('creation_time', 'uint', (this.version == 1) ? 64 : 32);\n this._procField('modification_time', 'uint', (this.version == 1) ? 64 : 32);\n this._procField('track_ID', 'uint', 32);\n this._procField('reserved1', 'uint', 32);\n this._procField('duration', 'uint', (this.version == 1) ? 64 : 32);\n this._procFieldArray('reserved2', 2, 'uint', 32);\n this._procField('layer', 'uint', 16);\n this._procField('alternate_group', 'uint', 16);\n this._procField('volume', 'template', 16);\n this._procField('reserved3', 'uint', 16);\n this._procFieldArray('matrix', 9, 'template', 32);\n this._procField('width', 'template', 32);\n this._procField('height', 'template', 32);\n};\n\n// ISO/IEC 14496-12:2012 - 8.8.3 Track Extends Box\nISOBox.prototype._boxProcessors['trex'] = function() {\n this._procFullBox();\n this._procField('track_ID', 'uint', 32);\n this._procField('default_sample_description_index', 'uint', 32);\n this._procField('default_sample_duration', 'uint', 32);\n this._procField('default_sample_size', 'uint', 32);\n this._procField('default_sample_flags', 'uint', 32);\n};\n\n// ISO/IEC 14496-12:2012 - 8.8.8 Track Run Box\n// Note: the 'trun' box has a direct relation to the 'tfhd' box for defaults.\n// These defaults are not set explicitly here, but are left to resolve for the user.\nISOBox.prototype._boxProcessors['trun'] = function() {\n this._procFullBox();\n this._procField('sample_count', 'uint', 32);\n if (this.flags & 0x1) this._procField('data_offset', 'int', 32);\n if (this.flags & 0x4) this._procField('first_sample_flags', 'uint', 32);\n this._procEntries('samples', this.sample_count, function(sample) {\n if (this.flags & 0x100) this._procEntryField(sample, 'sample_duration', 'uint', 32);\n if (this.flags & 0x200) this._procEntryField(sample, 'sample_size', 'uint', 32);\n if (this.flags & 0x400) this._procEntryField(sample, 'sample_flags', 'uint', 32);\n if (this.flags & 0x800) this._procEntryField(sample, 'sample_composition_time_offset', (this.version === 1) ? 'int' : 'uint', 32);\n });\n};\n\n// ISO/IEC 14496-12:2012 - 8.7.2 Data Reference Box\nISOBox.prototype._boxProcessors['url '] = ISOBox.prototype._boxProcessors['urn '] = function() {\n this._procFullBox();\n if (this.type === 'urn ') {\n this._procField('name', 'string', -1);\n }\n this._procField('location', 'string', -1);\n};\n\n// ISO/IEC 14496-30:2014 - WebVTT Source Label Box\nISOBox.prototype._boxProcessors['vlab'] = function() {\n this._procField('source_label', 'utf8');\n};\n\n// ISO/IEC 14496-12:2012 - 8.4.5.2 Video Media Header Box\nISOBox.prototype._boxProcessors['vmhd'] = function() {\n this._procFullBox();\n this._procField('graphicsmode', 'uint', 16);\n this._procFieldArray('opcolor', 3, 'uint', 16);\n};\n\n// ISO/IEC 14496-30:2014 - WebVTT Configuration Box\nISOBox.prototype._boxProcessors['vttC'] = function() {\n this._procField('config', 'utf8');\n};\n\n// ISO/IEC 14496-30:2014 - WebVTT Empty Sample Box\nISOBox.prototype._boxProcessors['vtte'] = function() {\n // Nothing should happen here.\n};\n", "/************************************************************************************************************\n * Copyright (C) 2023-2025 by Dolby International AB.\n * All rights reserved.\n\n * Redistribution and use in source and binary forms, with or without modification, are permitted\n * provided that the following conditions are met:\n\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions\n * and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions\n * and the following disclaimer in the documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or\n * promote products derived from this software without specific prior written permission.\n\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n ************************************************************************************************************/\n\n/**\n * @module\n * @desc This file defines constant values representing the box types specified in the ISO Base Media File Format (ISOBMFF)\n */\n\n/**\n * @constant\n * @type {string}\n */\nexport const MOVIE = \"moov\";\n/**\n * @constant\n * @type {string}\n */\nexport const TRACK = \"trak\";\n/**\n * @constant\n * @type {string}\n */\nexport const TRACK_HEADER = \"tkhd\";\n/**\n * @constant\n * @type {string}\n */\nexport const META = \"meta\";\n/**\n * @constant\n * @type {string}\n */\nexport const GROUPS_LIST = \"grpl\";\n/**\n * @constant\n * @type {string}\n */\nexport const PRESELECTION_GROUP = \"prsl\";\n/**\n * @constant\n * @type {string}\n */\nexport const USER_DATA = \"udta\";\n/**\n * @constant\n * @type {string}\n */\nexport const DIALOG_PROCESSING = \"diap\";\n/**\n * @constant\n * @type {string}\n */\nexport const EXTENDED_LANGUAGE_TAG = \"elng\";\n/**\n * @constant\n * @type {string}\n */\nexport const AUDIO_RENDERING_INDICATION = \"ardi\";\n/**\n * @constant\n * @type {string}\n */\nexport const LABEL = \"labl\";\n/**\n * @constant\n * @type {string}\n */\nexport const KIND = \"kind\";\n/**\n * @constant\n * @type {string}\n */\nexport const MOVIE_FRAGMENT = \"moof\";\n/**\n * @constant\n * @type {string}\n */\nexport const TRACK_FRAGMENT = \"traf\";\n/**\n * @constant\n * @type {string}\n */\nexport const TRACK_FRAGMENT_HEADER = \"tfhd\";\n/**\n * @constant\n * @type {string}\n */\nexport const TRACK_FRAGMENT_RUN = \"trun\";\n", "/************************************************************************************************************\n * Copyright (C) 2023-2024 by Dolby International AB.\n * All rights reserved.\n\n * Redistribution and use in source and binary forms, with or without modification, are permitted\n * provided that the following conditions are met:\n\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions\n * and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions\n * and the following disclaimer in the documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or\n * promote products derived from this software without specific prior written permission.\n\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n ************************************************************************************************************/\n\n/**\n * @module\n * @desc This file defines constant values representing the AC-4 TOC elements defined in specification and custom elements that are out of the specification\n */\n\n/**\n * @constant\n * @type {string}\n */\nexport const B_PRESENTATION_ID = \"b_presentation_id\";\n/**\n * @constant\n * @type {string}\n */\nexport const PRESENTATION_ID = \"presentation_id\";\n/**\n * @constant\n * @type {string}\n */\nexport const PRESENTATION_LEVEL = \"presentation_level\";\n/**\n * @constant\n * @type {string}\n */\nexport const PAYLOAD_BASE_MINUS1 = \"payload_base_minus1\";\n/**\n * @constant\n * @type {string}\n */\nexport const BYTE_ALIGNMENT = \"byte_alignment\";\n/**\n * @constant\n * @type {string}\n */\nexport const AC4_TOC_END = \"ac4_toc_end\";\n", "/************************************************************************************************************\n * Copyright (C) 2024 by Dolby International AB.\n * All rights reserved.\n\n * Redistribution and use in source and binary forms, with or without modification, are permitted\n * provided that the following conditions are met:\n\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions\n * and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions\n * and the following disclaimer in the documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or\n * promote products derived from this software without specific prior written permission.\n\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n ************************************************************************************************************/\n\n/*global console*/\n\n/**\n * @module\n * @desc This file contains functions for performing bitwise operations on byte arrays (DataView objects).\n */\n\n/**\n * Shifts the specified range of bits left without shifting bits outside the range.\n * Zeros are pushed in from the right side to maintain width.\n *\n * @summary Shifts a range of bits within a byte array left by a specified amount.\n *\n * @param {DataView} data - The byte array containing the bits to shift\n * @param {number} offset - The start index of the bit range to shift (must be >= 0)\n * @param {number} width - The number of bits to shift (must be >= 0)\n * @param {number} shift - The number of positions to shift left (must be >= 0)\n * @returns {DataView} The same byte array with the bits shifted in-place\n *\n * @example\n * const arrayBuffer = new ArrayBuffer(1);\n * const dataView = new DataView(arrayBuffer);\n * dataView.setUint8(0, 0b01011101);\n * shiftLeft(dataView, 3, 3, 3)\n * // dataView = [0b01000001]\n */\nconst shiftLeft = (data, offset, width, shift) => {\n // Calculate start and end byte and bit indexes\n const startByte = offset >> 3;\n const endByte = (offset + width - 1) >> 3;\n const startBit = offset & 7;\n const endBit = (offset + width - 1) & 7;\n\n // Calculate bitmasks for start and end bytes\n const startMask = 0b11111111 >> startBit;\n const endMask = (0b11111111 << (7 - endBit)) & 0b11111111;\n\n // Accumulator for shifted bits across byte boundaries\n let shiftAcc = 0;\n\n // Iterate bytes from end to start\n for (let i = endByte; i >= startByte; i--) {\n // Get byte and mask\n const currByte = data.getUint8(i);\n let mask = 0b11111111;\n if (i === startByte) {\n mask &= startMask;\n }\n if (i === endByte) {\n mask &= endMask;\n }\n\n // Apply mask and shift\n const clearedByte = currByte & ~mask;\n const maskedCurrByte = currByte & mask;\n shiftAcc = (maskedCurrByte << shift) + shiftAcc;\n const shiftedCurrByte = clearedByte | (shiftAcc & 0b11111111 & mask);\n shiftAcc >>= 8;\n\n // Store shifted result\n data.setUint8(i, shiftedCurrByte);\n }\n return data;\n};\n\n/**\n * This function modifies a range of bits within a byte array by setting them to a given value. It handles cases where the bit range spans across maximum of two bytes.\n *\n * @summary Sets a range of bits within a byte array to a specified value.\n *\n * @param {DataView} data - The byte array in which the bits will be replaced\n * @param {number} offset - The start index of the bit range to set (must be >= 0)\n * @param {number} width - The number of bits to set (must be >= 0)\n * @param {number} value - The value to set the bits to (must fit within the specified width)\n *\n * @example\n * const arrayBuffer = new ArrayBuffer(2);\n * const dataView = new DataView(arrayBuffer);\n * dataView.setUint8(0, 0b10101010);\n * dataView.setUint8(1, 0b01010101);\n * setBits(dataView, 5, 4, 0b1011);\n * // dataView = [0b10101101, 0b11010101]\n */\nconst setBits = (data, offset, width, value) => {\n // Make sure the value is not too large to fit\n console.assert(value >> width === 0, `value is not a ${width} bit value`);\n\n // Offset in bytes and bits\n const byteOffset = offset >>> 3;\n const bitOffset = offset & 7;\n\n // Mask to mask out the presentation bits\n const mask = (((1 << width) - 1) << (16 - width)) >> bitOffset;\n\n // Read a 16-bit word\n let word = (data.getUint8(byteOffset) << 8) | data.getUint8(byteOffset + 1);\n\n // Zero out the bits in the mask\n word &= ~mask;\n\n // Stamp the value into word\n word |= value << (16 - width - bitOffset);\n\n // Write back into databuffer\n data.setUint8(byteOffset, word >>> 8);\n data.setUint8(byteOffset + 1, word & 0xff);\n};\n\nexport { shiftLeft, setBits };\n", "/************************************************************************************************************\n * Copyright (C) 2023-2024 by Dolby International AB.\n * All rights reserved.\n\n * Redistribution and use in source and binary forms, with or without modification, are permitted\n * provided that the following conditions are met:\n\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions\n * and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions\n * and the following disclaimer in the documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or\n * promote products derived from this software without specific prior written permission.\n\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n ************************************************************************************************************/\n\n/**\n * @module\n * @desc This file contains the function that calculates offsets and sizes of individual media samples.\n */\n\nimport * as isoBmffBox from \"./constants/isobmff_box_names.js\";\n\n/**\n * @typedef {Object} SampleData\n * @property {number} offset - offset to Sample\n * @property {number} size - Sample size\n */\n\n/**\n * Calculates offsets and sizes of individual samples within the media data.\n *\n * @param {ISOFile} parsedBuffer - The parsed buffer containing ISOBMFF boxes\n * @returns {SampleData[]} An array of objects containing the offset and size of each sample\n */\nconst getSampleOffsets = (parsedBuffer) => {\n const sampleOffsets = [];\n const DEFAULT_BASE_IS_MOOF_FLAG_OFFSET = 0x020000;\n // must be exactly one in a media segment\n const movieFragment = parsedBuffer.fetch(isoBmffBox.MOVIE_FRAGMENT);\n\n let isFirstTrackFragment = true;\n\n for (const trackFragment of parsedBuffer.fetchAll(isoBmffBox.TRACK_FRAGMENT)) {\n // Exactly one must be present per traf\n const trackFragmentHeader = trackFragment.boxes.find((box) => box.type === isoBmffBox.TRACK_FRAGMENT_HEADER);\n\n const baseDataOffset = trackFragmentHeader.base_data_offset || 0;\n const defaultBaseIsMoof = trackFragmentHeader.flags & DEFAULT_BASE_IS_MOOF_FLAG_OFFSET;\n\n if (baseDataOffset) {\n /* base_data_offset is relative to the file identified by the referenced data reference entry */\n throw Error(\n \"base_data_offset is relative to the file identified by the referenced data reference entry unsupported\",\n );\n }\n\n if (!defaultBaseIsMoof) {\n if (isFirstTrackFragment) {\n /* base_data_offset is relative to the first byte of the MovieFragmentBox containing this box */\n throw Error(\n \"base_data_offset is relative to the first byte of the MovieFragmentBox containing this box unsupported\",\n );\n }\n /* base_data_offset is relative to the end of the data defined by the preceding track fragment */\n throw Error(\n \"base_data_offset is relative to the end of the data defined by the preceding track fragment is unsupported\",\n );\n }\n\n /* base_data_offset is relative to the first byte of the MovieFragmentBox containing this box */\n const relative = movieFragment._offset;\n\n for (const trackFragmentRun of trackFragment.boxes.filter((box) => box.type === isoBmffBox.TRACK_FRAGMENT_RUN)) {\n let sampleOffset = relative + baseDataOffset + trackFragmentRun.data_offset;\n for (const sample of trackFragmentRun.samples) {\n sampleOffsets.push({ offset: sampleOffset, size: sample.sample_size });\n sampleOffset += sample.sample_size;\n }\n }\n\n isFirstTrackFragment = false;\n }\n\n return sampleOffsets;\n};\n\nexport { getSampleOffsets };\n", "/************************************************************************************************************\n * Copyright (C) 2024-2025 by Dolby International AB.\n * All rights reserved.\n\n * Redistribution and use in source and binary forms, with or without modification, are permitted\n * provided that the following conditions are met:\n\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions\n * and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions\n * and the following disclaimer in the documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or\n * promote products derived from this software without specific prior written permission.\n\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n ************************************************************************************************************/\n\n/*global console*/\n\n/**\n * @module\n * @desc This file provides a BitSource class for reading bits from a source that implements iterator protocol\n */\n\n/** Handles reading bits from the source that is an iterator */\nexport class BitSource {\n /**\n * Create the BitSource\n * @param {Iterator<number>} iterator - an iterator object\n */\n constructor(iterator) {\n this.iterator = iterator;\n this.cache = 0;\n this.bitsLeft = 0;\n }\n\n /**\n * This function reads n-bit value from the source, where \"n\" is the specified width.\n *\n * It works by keeping a 32 bit wide cache.\n * In the cache, the next bits are \"left/top aligned\".\n * That is to say, to read the next three bits, you take the three most significant bits.\n * This can be accomplished by right-shifting the cache by 32-3=29 bits, taking care that it is an unsigned shift and no sign extension takes place.\n * To \"expel\" the read bits from the cache, simple left-shift the cache by 3 bits.\n *\n * Before any bits are read from the cache, it needs to be filled.\n * We check if more bits are needed, and whether at least 8 can be filled in. If so, do it.\n * This means that the cache contains 25 bits at a minimum after it is filled.\n * Therefore, 25 bits are the most bits that the reader can deliver. We don't check for end of stream in the bit reader. That is better delegated elsewhere.\n *\n * @summary Get a value of specified width from the bit source\n *\n * @param {string} varname - Name of the variable being read (it serves only logging purposes)\n * @param {number} bitsWidth - Width of the value to be read (maximum 25 bits)\n * @returns {number} The value read from the bit source\n */\n get(varname, bitsWidth) {\n const MAX_SHIFT = 24;\n const MAX_SUPPORTED_WIDTH = 25;\n const BYTE_SIZE = 8;\n const INT_SIZE = 32;\n // make sure the BitSource supports reading value with given width\n if (bitsWidth > MAX_SUPPORTED_WIDTH) {\n console.warn(\n `BitSource.get getting value ${varname} with not supported width=${bitsWidth} (max supported width: 24)`,\n );\n }\n\n let width = bitsWidth;\n while (this.bitsLeft < width) {\n const nextByte = this.iterator.next();\n\n // calculate the shift to not overwrite the cache\n const nextByteShift = MAX_SHIFT - this.bitsLeft;\n\n this.cache |= nextByte.value << nextByteShift;\n this.bitsLeft += BYTE_SIZE;\n /*\n We may have an AC-4 stream with field width >= 25/32 bits,\n current tocparser implementation can not handle its value.\n Whenever we have such field we move iterator to proper bits\n */\n if (width > MAX_SUPPORTED_WIDTH) {\n this.cache <<= BYTE_SIZE;\n this.bitsLeft -= BYTE_SIZE;\n width -= BYTE_SIZE;\n }\n }\n\n // take the highest \"width\" bits, make sure unsigned shift is used\n const readValue = this.cache >>> (INT_SIZE - width);\n // clear out the highest \"width\" bits\n this.cache <<= width;\n this.bitsLeft -= width;\n\n return readValue;\n }\n\n /**\n * Get bits needed for byte alignment\n *\n * @param {number} numberOfBits - Number of bits to align\n * @returns {number} The value read for alignment\n */\n get_align(numberOfBits) {\n return this.get(\"align\", numberOfBits);\n }\n}\n", "/************************************************************************************************************\n * Copyright (C) 2023-2025 by Dolby International AB.\n * All rights reserved.\n\n * Redistribution and use in source and binary forms, with or without modification, are permitted\n * provided that the following conditions are met:\n\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions\n * and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions\n * and the following disclaimer in the documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or\n * promote products derived from this software without specific prior written permission.\n\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n ************************************************************************************************************/\n\n/**\n * @module\n * @desc This file provides a sink class for AC-4 TOC parser callback handling and filtering.\n */\n\nimport { BYTE_ALIGNMENT } from \"../constants/toc_elements.js\";\n\n/**\n * This callback is called when configured element is found while parsing\n *\n * @callback sinkCallback\n * @param {string} name\n * @param {number} value\n * @param {number} width\n * @param {number} position\n * @param {string} [handler]\n */\n\n/** Handles the callback and filtering functionality for AC-4 TOC parser */\nexport class FilterSink {\n /**\n * Create the Filter Sink\n * @param {string[]} elements - The AC-4 TOC elements to be filtered\n * @param {sinkCallback} callback - The callback function to be called for filtered elements\n */\n constructor(elements, callback) {\n this.elements = elements;\n this.callback = callback;\n }\n\n /**\n * Called before calling embedded BSDL function\n * @param {string} _fname - name of the BSDL function\n * @param {unknown} _params - parameters passed to the BSDL function\n * @param {string} name - name of the AC-4 TOC element\n * @param {number} position - position read before calling embedded BSDL function\n */\n before_call(_fname, _params, name, position) {\n if (this.elements.includes(name)) {\n this.callback(name, null, null, position, \"before_call\");\n }\n }\n\n /**\n * Called after calling embedded BSDL function. The position is written after field is read\n * @param {string} _fname - name of the BSDL function\n * @param {number} value - value returned by the BSDL function\n * @param {string} name - name of the AC-4 TOC element\n * @param {number} position - position read after calling embedded BSDL function\n */\n after_call(_fname, value, name, position) {\n if (this.elements.includes(name)) {\n this.callback(name, value, null, position, \"after_call\");\n }\n }\n\n /**\n * Called when assigning a variable.\n * @param {string} name - name of the AC-4 TOC element\n * @param {number} width - width of the AC-4 TOC element\n * @param {number} value - value of the AC-4 TOC element\n * @param {number} position - position of the AC-4 TOC element\n */\n write_uint(name, width, value, position) {\n if (this.elements.includes(name)) {\n this.callback(name, value, width, position);\n }\n }\n\n /**\n * Called when assigning byte alignment to a variable.\n * @param {number} width - width of the byte alignment field\n * @param {number} value - value of byte alignment field\n */\n write_align(width, value) {\n if (this.elements.includes(BYTE_ALIGNMENT)) {\n this.callback(BYTE_ALIGNMENT, value, width, null, \"write_align\");\n }\n }\n\n /**\n * Called after BSDL position() call to obtain bit position\n * @param {string} name - name of the variable that the position will be assigned to\n * @param {number} position - obtained position\n */\n after_position(name, position) {\n if (this.elements.includes(name)) {\n this.callback(name, null, null, position, \"after_position\");\n }\n }\n}\n", "/************************************************************************************************************\n * Copyright (C) 2023-2024 by Dolby International AB.\n * All rights reserved.\n\n * Redistribution and use in source and binary forms, with or without modification, are permitted\n * provided that the following conditions are met:\n\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions\n * and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions\n * and the following disclaimer in the documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or\n * promote products derived from this software without specific prior written permission.\n\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n ************************************************************************************************************/\n\n/**\n * @module\n * @desc Parse AC-4 frames, specifically the TOC. The code was generated automatically.\n */\n\nexport class ParseError extends Error {}\n\nexport class Parser\n{\n // Class field declarations\n v = null;\n content_classifier = null;\n i = null;\n frame_rate_factor = null;\n bk_substream_index = null;\n a_substream_indices = null;\n last_referenced_substream = null;\n referenced_substreams = null;\n protection_bits_primary_bits = null;\n protection_bits_secondary_bits = null;\n toc_i = null;\n OAMD_OBJECT_TYPE_BED = null;\n OAMD_OBJECT_TYPE_ISF = null;\n OAMD_OBJECT_TYPE_DYNAMIC = null;\n OAMD_OBJECT_TYPE_RESERVED = null;\n toc_j = null;\n vb = null;\n presentation_to_groups = null;\n group_frame_rate_factor = null;\n b_hsf_ext = null;\n b_single_substream = null;\n n_bed_objects = null;\n a_num_bed_objects = null;\n b_bed_objects_prev = null;\n num_lfe = null;\n n = null;\n n_skip_bytes = null;\n b_more_skip_bytes = null;\n n_bits_read_0 = null;\n n_bits_read_1 = null;\n n_bits_read = null;\n n_skip_bits = null;\n reserved = null;\n padding = null;\n CHANNEL_MODE_MONO = null;\n CHANNEL_MODE_STEREO = null;\n CHANNEL_MODE_30 = null;\n CHANNEL_MODE_50 = null;\n CHANNEL_MODE_51 = null;\n CHANNEL_MODE_70_34 = null;\n CHANNEL_MODE_71_34 = null;\n CHANNEL_MODE_70_52 = null;\n CHANNEL_MODE_71_52 = null;\n CHANNEL_MODE_70_322 = null;\n CHANNEL_MODE_71_322 = null;\n CHANNEL_MODE_704 = null;\n CHANNEL_MODE_714 = null;\n CHANNEL_MODE_904 = null;\n CHANNEL_MODE_914 = null;\n CHANNEL_MODE_222 = null;\n presentation_config = null;\n presentation_version = null;\n b_add_emdf_substreams = null;\n presentation_level = null;\n b_presentation_id = null;\n presentation_id = null;\n b_pre_virtualized = null;\n n_add_emdf_substreams = null;\n pi_i = null;\n b_single_substream_group = null;\n b_presentation_filter = null;\n b_enable_presentation = null;\n n_substream_groups = null;\n b_multi_pid = null;\n n_substream_groups_minus2 = null;\n sg = null;\n bitstream_version = null;\n fs_index = null;\n frame_rate_index = null;\n BAM_g_position = 0;\n BAM_g_table0 = [0, 2, 4, 6];\n BAM_g_table1 = [252, 253, 508, 509];\n BAM_g_table2 = [122, 123, 124, 125];\n BAM_g_table3 = [252, 253, 508, 509];\n BAM_g_table4 = [4, 6, 8, 10, 12, 14];\n BAM_g_table5 = [122, 123, 124, 125];\n BAM_g_table6 = [0, 0];\n BAM_g_table7 = [0, 1, 2, 3, 5, 0, 0, 0];\n BAM_g_table8 = [2, 3, 6, 8, 10, 8, 10, 12];\n BAM_g_table9 = [2, 1, 1, 2, 2, 2, 2, 2, 2, 1];\n BAM_g_table10 = [4, 8, 10, 14, 15, 30, -1, -1];\n BAM_g_table11 = [2, 3, 4, 5, 6, 7];\n BAM_g_table12 = [2, 1, 1, 2, 2, 2, 2, 2, 2, 1];\n BAM_g_table13 = [1920, 1920, 2048, 1536, 1536, 960, 960, 1024, 768, 768, 512, 384, 384, 2048];\n BAM_g_table14 = [2, 3, 4];\n BAM_g_table15 = {0: 2, 1: 4};\n BAM_g_table16 = [0, 1, 7, 8, 9];\n BAM_g_table17 = {0: 1, 1: 2};\n BAM_g_table18 = [5, 6, 7, 8, 9];\n BAM_g_table19 = [10, 11, 12];\n\n constructor (BAM_source, BAM_sink)\n {\n this.BAM_source = BAM_source;\n this.BAM_sink = BAM_sink;\n }\n\n F_channel_mode_contains_LFE (cm)\n {\n {\n if (cm == this.CHANNEL_MODE_51 || cm == this.CHANNEL_MODE_71_34 || cm == this.CHANNEL_MODE_71_52 || cm == this.CHANNEL_MODE_71_322)\n {\n return 1;\n }\n else\n {\n return 0;\n }\n }\n }\n\n F_bitrate_indicator ()\n {\n var bi;\n var factor;\n {\n {\n bi = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n if ((this.BAM_g_table0.slice(0).indexOf(bi) >= 0))\n {\n {\n bi = bi >> 1;\n }\n }\n else\n {\n {\n {\n this.v = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n {\n this.v = (bi << 2) + this.v;\n }\n {\n factor = Math.floor(this.v / 8);\n }\n {\n bi = this.v - factor * 4;\n }\n }\n }\n }\n }\n\n F_content_type ()\n {\n var b_serialized_language_tag;\n var n_language_tag_bytes;\n var language_tag_chunk;\n var language_tag_bytes;\n var b_language_indicator;\n var b_start_tag;\n {\n {\n this.content_classifier = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n {\n b_language_indicator = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_language_indicator)\n {\n {\n {\n b_serialized_language_tag = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_serialized_language_tag)\n {\n {\n {\n b_start_tag = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n language_tag_chunk = this.BAM_source.get(\"\", 16);\n this.BAM_g_position += 16;\n }\n }\n }\n else\n {\n {\n {\n n_language_tag_bytes = this.BAM_source.get(\"\", 6);\n this.BAM_g_position += 6;\n }\n for (this.i = 0; this.i < n_language_tag_bytes; this.i++)\n {\n {\n language_tag_bytes = this.BAM_source.get(\"\", 8);\n this.BAM_g_position += 8;\n }\n }\n }\n }\n }\n }\n }\n }\n\n F_ac4_substream_info_chan (asio_group_index, asio_gs_index, asio_b_substreams_present_chan)\n {\n var substream_index;\n var b_sf_multiplier;\n var b_bitrate_info;\n var si_ch_mode;\n var si_channel_mode;\n var top_channels_present;\n var b_4_back_channels_present;\n var si_b_iframe;\n var b_center_present;\n var b_lfe = null;\n var b_lfe;\n var sf_multiplier;\n var add_ch_base;\n {\n {\n this.F_define_channel_modes();\n }\n {\n this.F_define_oamd();\n }\n {\n si_channel_mode = this.F_channel_mode();\n if (si_channel_mode == null)\n {\n throw ParseError(\"F_channel_mode\", \"expected to return a value, returned None\");\n }\n }\n if (si_channel_mode == 511)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n si_channel_mode += this.v;\n }\n }\n }\n if ((this.BAM_g_table1.slice(0).indexOf(si_channel_mode) >= 0))\n {\n {\n {\n b_4_back_channels_present = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n b_center_present = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n top_channels_present = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n }\n }\n if (this.fs_index == 1)\n {\n {\n {\n b_sf_multiplier = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_sf_multiplier)\n {\n {\n sf_multiplier = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n }\n }\n {\n b_bitrate_info = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_bitrate_info)\n {\n {\n this.F_bitrate_indicator();\n }\n }\n if ((this.BAM_g_table2.slice(0).indexOf(si_channel_mode) >= 0))\n {\n {\n add_ch_base = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n {\n this.frame_rate_factor = this.group_frame_rate_factor[asio_group_index];\n }\n for (this.i = 0; this.i < this.frame_rate_factor; this.i++)\n {\n {\n si_b_iframe = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n if (asio_b_substreams_present_chan == 1)\n {\n {\n {\n substream_index = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (substream_index == 3)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n substream_index += this.v;\n }\n }\n }\n }\n }\n else\n {\n {\n {\n substream_index = this.bk_substream_index;\n }\n {\n this.bk_substream_index = this.bk_substream_index + 1;\n }\n }\n }\n {\n this.a_substream_indices.push(substream_index);\n }\n for (this.i = 0; this.i < this.frame_rate_factor; this.i++)\n {\n {\n if (asio_b_substreams_present_chan == 1)\n {\n {\n {\n this.last_referenced_substream = Math.max(this.last_referenced_substream, substream_index + this.i);\n }\n {\n this.referenced_substreams.push(substream_index + this.i);\n }\n }\n }\n if ((this.BAM_g_table3.slice(0).indexOf(si_channel_mode) >= 0))\n {\n }\n {\n si_ch_mode = this.F_get_ch_mode(si_channel_mode);\n if (si_ch_mode == null)\n {\n throw ParseError(\"F_get_ch_mode\", \"expected to return a value, returned None\");\n }\n }\n if ((this.BAM_g_table4.slice(0).indexOf(si_ch_mode) >= 0))\n {\n {\n if (b_lfe == null)\n {\n b_lfe = new Array((substream_index + this.i) + 1).fill(0);\n }\n else if ((b_lfe).length <= substream_index + this.i)\n {\n b_lfe.push.apply(b_lfe, new Array((substream_index + this.i) - (b_lfe).length + 1).fill(0));\n }\n b_lfe[substream_index + this.i] = 1;\n }\n }\n else\n {\n {\n if (b_lfe == null)\n {\n b_lfe = new Array((substream_index + this.i) + 1).fill(0);\n }\n else if ((b_lfe).length <= substream_index + this.i)\n {\n b_lfe.push.apply(b_lfe, new Array((substream_index + this.i) - (b_lfe).length + 1).fill(0));\n }\n b_lfe[substream_index + this.i] = 0;\n }\n }\n }\n }\n }\n }\n\n F_channel_mode ()\n {\n var value;\n var stereo_channel_mode;\n {\n {\n value = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (value == 1)\n {\n {\n {\n this.v = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n value = (value << 1) + this.v;\n }\n {\n stereo_channel_mode = 2;\n }\n if (value == 3)\n {\n {\n {\n this.v = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n {\n value = (value << 2) + this.v;\n }\n if (value == 15)\n {\n {\n {\n this.v = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n {\n value = (value << 3) + this.v;\n }\n if (value == 120 || value == 121)\n {\n {\n {\n stereo_channel_mode = value;\n }\n {\n value = 2;\n }\n }\n }\n if (value == 126)\n {\n {\n {\n this.v = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n value = (value << 1) + this.v;\n }\n }\n }\n if (value == 127)\n {\n {\n {\n this.v = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n {\n value = (value << 2) + this.v;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return value;\n }\n }\n\n F_ac4_substream_info (si_b_associated, si_b_dialog, si_ps_index)\n {\n var substream_index;\n var si_b_iframe;\n var b_sf_multiplier;\n var b_bitrate_info;\n var b_dialog_content;\n var si_channel_mode;\n var b_lfe = null;\n var b_lfe;\n var sf_multiplier;\n var add_ch_base;\n var b_associated_content;\n var b_content_type;\n {\n {\n this.F_define_channel_modes();\n }\n {\n si_channel_mode = this.F_channel_mode();\n if (si_channel_mode == null)\n {\n throw ParseError(\"F_channel_mode\", \"expected to return a value, returned None\");\n }\n }\n if (si_channel_mode == 511)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n si_channel_mode += this.v;\n }\n }\n }\n if (this.fs_index == 1)\n {\n {\n {\n b_sf_multiplier = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_sf_multiplier)\n {\n {\n sf_multiplier = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n }\n }\n {\n b_bitrate_info = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_bitrate_info)\n {\n {\n this.F_bitrate_indicator();\n }\n }\n if ((this.BAM_g_table5.slice(0).indexOf(si_channel_mode) >= 0))\n {\n {\n add_ch_base = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n {\n b_content_type = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_content_type)\n {\n {\n {\n this.F_content_type();\n }\n if ((this.content_classifier) == (0))\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (1))\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (2))\n {\n {\n {\n b_associated_content = 1;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (3))\n {\n {\n {\n b_associated_content = 1;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (4))\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 1;\n }\n }\n }\n else if ((this.content_classifier) == (5))\n {\n {\n {\n b_associated_content = 1;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (6))\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (7))\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n }\n }\n else\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n for (this.i = 0; this.i < this.frame_rate_factor; this.i++)\n {\n {\n si_b_iframe = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n {\n substream_index = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (substream_index == 3)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n substream_index += this.v;\n }\n }\n }\n {\n this.a_substream_indices.push(substream_index);\n }\n for (this.i = 0; this.i < this.frame_rate_factor; this.i++)\n {\n {\n {\n this.last_referenced_substream = Math.max(this.last_referenced_substream, substream_index + this.i);\n }\n {\n this.referenced_substreams.push(substream_index + this.i);\n }\n {\n if (b_lfe == null)\n {\n b_lfe = new Array((substream_index + 1) + 1).fill(0);\n }\n else if ((b_lfe).length <= substream_index + 1)\n {\n b_lfe.push.apply(b_lfe, new Array((substream_index + 1) - (b_lfe).length + 1).fill(0));\n }\n b_lfe[substream_index + 1] = this.F_channel_mode_contains_LFE(si_channel_mode);\n if (b_lfe[substream_index + 1] == null)\n {\n throw ParseError(\"F_channel_mode_contains_LFE\", \"expected to return a value, returned None\");\n }\n }\n }\n }\n }\n }\n\n F_emdf_protection ()\n {\n var protection_bits_secondary;\n var protection_length_secondary;\n var protection_length_primary;\n var protection_bits_primary;\n {\n {\n protection_length_primary = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n {\n protection_length_secondary = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if ((protection_length_primary) == (0))\n {\n if (1)\n {\n throw \"protection_length_primary == 0 is reserved\";\n }\n }\n else if ((protection_length_primary) == (1))\n {\n {\n this.protection_bits_primary_bits = 8;\n }\n }\n else if ((protection_length_primary) == (2))\n {\n {\n this.protection_bits_primary_bits = 32;\n }\n }\n else if ((protection_length_primary) == (3))\n {\n {\n this.protection_bits_primary_bits = 128;\n }\n }\n {\n protection_bits_primary = this.BAM_source.get(\"\", this.protection_bits_primary_bits);\n this.BAM_g_position += this.protection_bits_primary_bits;\n }\n if ((protection_length_secondary) == (0))\n {\n {\n this.protection_bits_secondary_bits = 0;\n }\n }\n else if ((protection_length_secondary) == (1))\n {\n {\n this.protection_bits_secondary_bits = 8;\n }\n }\n else if ((protection_length_secondary) == (2))\n {\n {\n this.protection_bits_secondary_bits = 32;\n }\n }\n else if ((protection_length_secondary) == (3))\n {\n {\n this.protection_bits_secondary_bits = 128;\n }\n }\n {\n protection_bits_secondary = this.BAM_source.get(\"\", this.protection_bits_secondary_bits);\n this.BAM_g_position += this.protection_bits_secondary_bits;\n }\n }\n }\n\n F_emdf_info ()\n {\n var key_id;\n var b_emdf_payloads_substream_info;\n var emdf_version;\n {\n {\n emdf_version = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (emdf_version == 3)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n emdf_version += this.v;\n }\n }\n }\n {\n key_id = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n if (key_id == 7)\n {\n {\n {\n this.v = this.F_variable_bits(3);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n key_id += this.v;\n }\n }\n }\n {\n b_emdf_payloads_substream_info = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_emdf_payloads_substream_info)\n {\n {\n this.F_emdf_payloads_substream_info(this.toc_i);\n }\n }\n {\n this.F_emdf_protection();\n }\n }\n }\n\n F_emdf_payloads_substream_info (toc_i)\n {\n var substream_index;\n {\n {\n substream_index = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (substream_index == 3)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n substream_index += this.v;\n }\n }\n }\n {\n this.last_referenced_substream = Math.max(this.last_referenced_substream, substream_index);\n }\n {\n this.referenced_substreams.push(substream_index);\n }\n {\n this.a_substream_indices.push(substream_index);\n }\n }\n }\n\n F_ac4_hsf_ext_substream_info (ahsf_b_substreams_present)\n {\n var substream_index;\n {\n if (ahsf_b_substreams_present == 1)\n {\n {\n {\n substream_index = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (substream_index == 3)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n substream_index += this.v;\n }\n }\n }\n }\n }\n else\n {\n {\n {\n substream_index = this.bk_substream_index;\n }\n {\n this.bk_substream_index = this.bk_substream_index + 1;\n }\n }\n }\n if (ahsf_b_substreams_present == 1)\n {\n {\n {\n this.last_referenced_substream = Math.max(this.last_referenced_substream, substream_index);\n }\n {\n this.referenced_substreams.push(substream_index);\n }\n }\n }\n }\n }\n\n F_oamd_common_data ()\n {\n var add_data_bits;\n var ocd_p1;\n var add_data;\n var ocd_p0;\n var bits_used;\n var b_bed_object_chan_distribute;\n var master_screen_size_ratio;\n var add_data_bytes_minus1;\n var add_data_bytes;\n var b_additional_data;\n var b_default_screen_size_ratio;\n {\n {\n b_default_screen_size_ratio = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_default_screen_size_ratio == 0)\n {\n {\n master_screen_size_ratio = this.BAM_source.get(\"\", 5);\n this.BAM_g_position += 5;\n }\n }\n {\n b_bed_object_chan_distribute = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n b_additional_data = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_additional_data)\n {\n {\n {\n add_data_bytes_minus1 = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n add_data_bytes = add_data_bytes_minus1 + 1;\n }\n if (add_data_bytes == 2)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n add_data_bytes += this.v;\n }\n }\n }\n {\n add_data_bits = add_data_bytes * 8;\n }\n {\n ocd_p0 = this.BAM_g_position;\n }\n {\n ocd_p1 = this.BAM_g_position;\n }\n {\n bits_used = ocd_p1 - ocd_p0;\n }\n {\n add_data_bits = add_data_bits - bits_used;\n }\n if (add_data_bits < 0)\n {\n throw \"Wrong add_data_bytes_minus1 size indication\";\n }\n {\n add_data = this.BAM_source.get(\"\", add_data_bits);\n this.BAM_g_position += add_data_bits;\n }\n }\n }\n }\n }\n\n F_define_oamd ()\n {\n var NUM_TRIM_CONFIGS;\n {\n {\n this.OAMD_OBJECT_TYPE_BED = 0;\n }\n {\n this.OAMD_OBJECT_TYPE_ISF = 1;\n }\n {\n this.OAMD_OBJECT_TYPE_DYNAMIC = 2;\n }\n {\n this.OAMD_OBJECT_TYPE_RESERVED = 3;\n }\n {\n NUM_TRIM_CONFIGS = 9;\n }\n }\n }\n\n F_ac4_substream_info_ajoc (asio_group_index, asio_gs_index_ajoc, asio_b_substreams_present)\n {\n var n_fullband_upmix_signals_minus1;\n var substream_index;\n var b_oamd_common_data_present;\n var b_sf_multiplier;\n var b_bitrate_info;\n var n_fullband_dmx_signals;\n var n_fullband_upmix_signals;\n var si_b_iframe;\n var num_objects_DYNAMIC = null;\n var num_objects_DYNAMIC;\n var ajoc_b_lfe;\n var n_fullband_dmx_signals_minus1;\n var b_lfe = null;\n var b_lfe;\n var si_channel_mode_j;\n var b_static_dmx;\n var sf_multiplier;\n {\n {\n num_objects_DYNAMIC = this.BAM_g_table6.slice(0);\n }\n {\n this.F_define_channel_modes();\n }\n {\n ajoc_b_lfe = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n b_static_dmx = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_static_dmx)\n {\n {\n {\n n_fullband_dmx_signals = 5;\n }\n if (ajoc_b_lfe)\n {\n {\n si_channel_mode_j = this.CHANNEL_MODE_51;\n }\n }\n else\n {\n {\n si_channel_mode_j = this.CHANNEL_MODE_50;\n }\n }\n }\n }\n else\n {\n {\n {\n n_fullband_dmx_signals_minus1 = this.BAM_source.get(\"\", 4);\n this.BAM_g_position += 4;\n }\n {\n n_fullband_dmx_signals = n_fullband_dmx_signals_minus1 + 1;\n }\n {\n this.F_bed_dyn_obj_assignment(n_fullband_dmx_signals, 0, ajoc_b_lfe);\n }\n }\n }\n {\n b_oamd_common_data_present = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_oamd_common_data_present)\n {\n {\n this.F_oamd_common_data();\n }\n }\n {\n n_fullband_upmix_signals_minus1 = this.BAM_source.get(\"\", 4);\n this.BAM_g_position += 4;\n }\n {\n n_fullband_upmix_signals = n_fullband_upmix_signals_minus1 + 1;\n }\n if (n_fullband_upmix_signals == 16)\n {\n {\n {\n this.v = this.F_variable_bits(3);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n n_fullband_upmix_signals = n_fullband_upmix_signals + this.v;\n }\n }\n }\n {\n this.F_bed_dyn_obj_assignment(n_fullband_upmix_signals, 1, ajoc_b_lfe);\n }\n if (this.fs_index == 1)\n {\n {\n {\n b_sf_multiplier = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_sf_multiplier)\n {\n {\n sf_multiplier = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n }\n }\n {\n b_bitrate_info = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_bitrate_info)\n {\n {\n this.F_bitrate_indicator();\n }\n }\n {\n this.frame_rate_factor = this.group_frame_rate_factor[asio_group_index];\n }\n for (this.i = 0; this.i < this.frame_rate_factor; this.i++)\n {\n {\n si_b_iframe = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n if (asio_b_substreams_present == 1)\n {\n {\n {\n substream_index = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (substream_index == 3)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n substream_index += this.v;\n }\n }\n }\n }\n }\n else\n {\n {\n {\n substream_index = this.bk_substream_index;\n }\n {\n this.bk_substream_index = this.bk_substream_index + 1;\n }\n }\n }\n {\n this.a_substream_indices.push(substream_index);\n }\n for (this.i = 0; this.i < this.frame_rate_factor; this.i++)\n {\n {\n if (asio_b_substreams_present == 1)\n {\n {\n {\n this.last_referenced_substream = Math.max(this.last_referenced_substream, substream_index + this.i);\n }\n {\n this.referenced_substreams.push(substream_index + this.i);\n }\n }\n }\n {\n if (b_lfe == null)\n {\n b_lfe = new Array((substream_index + this.i) + 1).fill(0);\n }\n else if ((b_lfe).length <= substream_index + this.i)\n {\n b_lfe.push.apply(b_lfe, new Array((substream_index + this.i) - (b_lfe).length + 1).fill(0));\n }\n b_lfe[substream_index + this.i] = ajoc_b_lfe;\n }\n }\n }\n }\n }\n\n F_ac4_sgi_specifier (asgi_b_associated, asgi_b_dialog, group_in_presentation_index)\n {\n var group_index;\n {\n if (this.bitstream_version == 1)\n {\n {\n {\n this.F_ac4_substream_group_info(this.toc_j);\n }\n {\n this.toc_j += 1;\n }\n }\n }\n else\n {\n {\n {\n group_index = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n if (group_index == 7)\n {\n {\n {\n this.vb = this.F_variable_bits(2);\n if (this.vb == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n group_index += this.vb;\n }\n }\n }\n {\n if (this.presentation_to_groups == null)\n {\n this.presentation_to_groups = new Array((this.toc_i) + 1).fill(null);\n }\n else if ((this.presentation_to_groups).length <= this.toc_i)\n {\n this.presentation_to_groups.push.apply(this.presentation_to_groups, new Array((this.toc_i) - (this.presentation_to_groups).length + 1).fill(null));\n }\n this.presentation_to_groups[this.toc_i].push(group_index);\n }\n {\n if (this.group_frame_rate_factor == null)\n {\n this.group_frame_rate_factor = new Array((group_index) + 1).fill(0);\n }\n else if ((this.group_frame_rate_factor).length <= group_index)\n {\n this.group_frame_rate_factor.push.apply(this.group_frame_rate_factor, new Array((group_index) - (this.group_frame_rate_factor).length + 1).fill(0));\n }\n this.group_frame_rate_factor[group_index] = this.frame_rate_factor;\n }\n }\n }\n }\n }\n\n F_ac4_substream_group_info (si_group_index)\n {\n var obj_index;\n var b_dialog_content;\n var sus;\n var n_lf_substreams;\n var b_substreams_present;\n var b_channel_coded;\n var b_ajoc;\n var n_lf_substreams_minus2;\n var sus_ver;\n var b_oamd_substream;\n var b_content_type;\n var b_associated_content;\n {\n {\n b_substreams_present = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n this.b_hsf_ext = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n this.b_single_substream = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (this.b_single_substream)\n {\n {\n n_lf_substreams = 1;\n }\n }\n else\n {\n {\n {\n n_lf_substreams_minus2 = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n {\n n_lf_substreams = n_lf_substreams_minus2 + 2;\n }\n if (n_lf_substreams == 5)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n n_lf_substreams += this.v;\n }\n }\n }\n }\n }\n {\n b_channel_coded = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n this.n_bed_objects = -1;\n }\n {\n this.a_num_bed_objects = [];\n }\n if (b_channel_coded)\n {\n {\n {\n b_ajoc = 0;\n }\n for (sus = 0; sus < n_lf_substreams; sus++)\n {\n {\n if (this.bitstream_version == 1)\n {\n {\n sus_ver = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n else\n {\n {\n sus_ver = 1;\n }\n }\n {\n this.F_ac4_substream_info_chan(si_group_index, sus, b_substreams_present);\n }\n if (this.b_hsf_ext)\n {\n {\n this.F_ac4_hsf_ext_substream_info(b_substreams_present);\n }\n }\n }\n }\n }\n }\n else\n {\n {\n {\n b_oamd_substream = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_oamd_substream)\n {\n {\n this.F_oamd_substream_info(b_substreams_present);\n }\n }\n {\n obj_index = 0;\n }\n {\n this.b_bed_objects_prev = 0;\n }\n for (sus = 0; sus < n_lf_substreams; sus++)\n {\n {\n {\n b_ajoc = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_ajoc)\n {\n {\n {\n this.F_ac4_substream_info_ajoc(si_group_index, sus, b_substreams_present);\n }\n if (this.b_hsf_ext)\n {\n {\n this.F_ac4_hsf_ext_substream_info(b_substreams_present);\n }\n }\n }\n }\n else\n {\n {\n {\n this.F_ac4_substream_info_obj(si_group_index, sus, obj_index, b_substreams_present);\n }\n {\n obj_index += 1;\n }\n if (this.b_hsf_ext)\n {\n {\n this.F_ac4_hsf_ext_substream_info(b_substreams_present);\n }\n }\n }\n }\n }\n }\n }\n }\n {\n b_content_type = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_content_type)\n {\n {\n {\n this.F_content_type();\n }\n if ((this.content_classifier) == (0))\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (1))\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (2))\n {\n {\n {\n b_associated_content = 1;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (3))\n {\n {\n {\n b_associated_content = 1;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (4))\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 1;\n }\n }\n }\n else if ((this.content_classifier) == (5))\n {\n {\n {\n b_associated_content = 1;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (6))\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (7))\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n }\n }\n else\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n }\n }\n\n F_oamd_substream_info (oamd_b_substreams_present)\n {\n var substream_index;\n var b_iframe_oamd;\n {\n {\n this.F_define_oamd();\n }\n {\n b_iframe_oamd = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (oamd_b_substreams_present == 1)\n {\n {\n {\n substream_index = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (substream_index == 3)\n {\n {\n {\n this.vb = this.F_variable_bits(2);\n if (this.vb == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n substream_index += this.vb;\n }\n }\n }\n }\n }\n else\n {\n {\n {\n substream_index = this.bk_substream_index;\n }\n {\n this.bk_substream_index = this.bk_substream_index + 1;\n }\n }\n }\n if (oamd_b_substreams_present == 1)\n {\n {\n {\n this.last_referenced_substream = Math.max(this.last_referenced_substream, substream_index);\n }\n {\n this.referenced_substreams.push(substream_index);\n }\n }\n }\n }\n }\n\n F_ac4_substream_info_obj (asio_group_index, asio_gs_index, asio_gs_index_obj, asio_b_substreams_present)\n {\n var obj_type;\n var b_nonstd_bed_channel_assignment;\n var res_bytes;\n var b_bed_start;\n var bed_chan_assign_code;\n var j;\n var si_b_iframe;\n var n_objs;\n var si_num_channels;\n var reserved_data;\n var b_isf_start;\n var n_objects_code;\n var isf_config;\n var substream_index;\n var b_sf_multiplier;\n var b_bed_objects;\n var b_dynamic_objects;\n var b_bitrate_info;\n var b_isf;\n var nonstd_bed_channel_assignment_mask;\n var b_ch_assign_code;\n var b_lfe = null;\n var b_lfe;\n var std_bed_channel_assignment_mask;\n var sf_multiplier;\n var si_b_lfe;\n {\n {\n n_objs = 0;\n }\n {\n this.F_define_oamd();\n }\n {\n this.F_define_channel_modes();\n }\n {\n n_objects_code = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n {\n si_num_channels = this.BAM_g_table7.slice(0)[n_objects_code];\n }\n {\n b_dynamic_objects = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_dynamic_objects)\n {\n {\n {\n si_b_lfe = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n obj_type = this.OAMD_OBJECT_TYPE_DYNAMIC;\n }\n {\n this.b_bed_objects_prev = 0;\n }\n }\n }\n else\n {\n {\n {\n b_bed_objects = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_bed_objects)\n {\n {\n if (this.b_bed_objects_prev && this.num_lfe == 2)\n {\n {\n si_b_lfe = 1;\n }\n }\n else\n {\n {\n si_b_lfe = 0;\n }\n }\n {\n this.b_bed_objects_prev = 1;\n }\n {\n this.num_lfe = 0;\n }\n {\n obj_type = this.OAMD_OBJECT_TYPE_BED;\n }\n {\n b_bed_start = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_bed_start)\n {\n {\n {\n b_ch_assign_code = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_ch_assign_code)\n {\n {\n {\n bed_chan_assign_code = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n for (this.i = 0; this.i < this.BAM_g_table8.slice(0)[bed_chan_assign_code]; this.i++)\n {\n {\n n_objs += 1;\n }\n }\n if (bed_chan_assign_code >= 2)\n {\n {\n si_b_lfe = 1;\n }\n }\n }\n }\n else\n {\n {\n {\n b_nonstd_bed_channel_assignment = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_nonstd_bed_channel_assignment)\n {\n {\n {\n nonstd_bed_channel_assignment_mask = this.BAM_source.get(\"\", 17);\n this.BAM_g_position += 17;\n }\n for (this.i = 0; this.i < 17; this.i++)\n {\n if ((nonstd_bed_channel_assignment_mask & 1 << this.i) != 0)\n {\n {\n if (this.i == 3 || this.i == 16)\n {\n {\n this.num_lfe += 1;\n }\n }\n {\n n_objs += 1;\n }\n }\n }\n }\n }\n }\n else\n {\n {\n {\n std_bed_channel_assignment_mask = this.BAM_source.get(\"\", 10);\n this.BAM_g_position += 10;\n }\n for (this.i = 0; this.i < 10; this.i++)\n {\n if ((std_bed_channel_assignment_mask & 1 << this.i) != 0)\n {\n for (j = 0; j < this.BAM_g_table9.slice(0)[this.i]; j++)\n {\n {\n if (this.i == 2 || this.i == 9)\n {\n {\n this.num_lfe += 1;\n }\n }\n {\n n_objs += 1;\n }\n }\n }\n }\n }\n }\n }\n if (this.num_lfe > 0)\n {\n {\n si_b_lfe = 1;\n }\n }\n }\n }\n {\n this.n_bed_objects = n_objs;\n }\n {\n this.a_num_bed_objects.push(this.n_bed_objects);\n }\n }\n }\n }\n }\n else\n {\n {\n {\n si_b_lfe = 0;\n }\n {\n this.b_bed_objects_prev = 0;\n }\n {\n b_isf = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_isf)\n {\n {\n {\n obj_type = this.OAMD_OBJECT_TYPE_ISF;\n }\n {\n b_isf_start = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_isf_start)\n {\n {\n isf_config = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n }\n }\n }\n else\n {\n {\n {\n res_bytes = this.BAM_source.get(\"\", 4);\n this.BAM_g_position += 4;\n }\n {\n reserved_data = this.BAM_source.get(\"\", 8 * res_bytes);\n this.BAM_g_position += 8 * res_bytes;\n }\n {\n obj_type = this.OAMD_OBJECT_TYPE_RESERVED;\n }\n if (si_num_channels == 0)\n {\n throw \"No non-LFE objects (of OAMD_OBJECT_TYPE_RESERVED) in substream!\";\n }\n }\n }\n }\n }\n }\n }\n if (this.fs_index == 1)\n {\n {\n {\n b_sf_multiplier = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_sf_multiplier)\n {\n {\n sf_multiplier = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n }\n }\n {\n b_bitrate_info = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_bitrate_info)\n {\n {\n this.F_bitrate_indicator();\n }\n }\n {\n this.frame_rate_factor = this.group_frame_rate_factor[asio_group_index];\n }\n for (this.i = 0; this.i < this.frame_rate_factor; this.i++)\n {\n {\n si_b_iframe = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n if (asio_b_substreams_present == 1)\n {\n {\n {\n substream_index = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (substream_index == 3)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n substream_index += this.v;\n }\n }\n }\n }\n }\n else\n {\n {\n {\n substream_index = this.bk_substream_index;\n }\n {\n this.bk_substream_index = this.bk_substream_index + 1;\n }\n }\n }\n {\n this.a_substream_indices.push(substream_index);\n }\n for (this.i = 0; this.i < this.frame_rate_factor; this.i++)\n {\n {\n if (asio_b_substreams_present == 1)\n {\n {\n {\n this.last_referenced_substream = Math.max(this.last_referenced_substream, substream_index + this.i);\n }\n {\n this.referenced_substreams.push(substream_index + this.i);\n }\n }\n }\n {\n if (b_lfe == null)\n {\n b_lfe = new Array((substream_index + this.i) + 1).fill(0);\n }\n else if ((b_lfe).length <= substream_index + this.i)\n {\n b_lfe.push.apply(b_lfe, new Array((substream_index + this.i) - (b_lfe).length + 1).fill(0));\n }\n b_lfe[substream_index + this.i] = si_b_lfe;\n }\n }\n }\n }\n }\n\n F_bed_dyn_obj_assignment (n_signals, b_upmix, bd_lfe)\n {\n var n_isf;\n var isf_config;\n var oc_num_channels;\n var obj_type;\n var n_bed_signals_minus1;\n var b_nonstd_bed_channel_assignment;\n var nonstd_bed_channel_assignment;\n var bed_chan_assign_code;\n var nonstd_bed_channel_assignment_mask;\n var lfe_signalled;\n var b_is_isf;\n var n_bed_signals;\n var bed_ch_bits;\n var b_ch_assign_code;\n var std_bed_channel_assignment_mask;\n var b_dyn_objects_only;\n var b_chan_assign_mask;\n var b;\n {\n {\n this.F_define_oamd();\n }\n {\n lfe_signalled = 0;\n }\n {\n b_dyn_objects_only = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_dyn_objects_only == 0)\n {\n {\n {\n b_is_isf = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_is_isf)\n {\n {\n {\n isf_config = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n {\n obj_type = this.OAMD_OBJECT_TYPE_ISF;\n }\n {\n n_isf = this.BAM_g_table10.slice(0)[isf_config];\n }\n }\n }\n else\n {\n {\n {\n obj_type = this.OAMD_OBJECT_TYPE_BED;\n }\n {\n b_ch_assign_code = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_ch_assign_code)\n {\n {\n {\n bed_chan_assign_code = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n if ((this.BAM_g_table11.slice(0).indexOf(bed_chan_assign_code) >= 0))\n {\n {\n lfe_signalled = 1;\n }\n }\n }\n }\n else\n {\n {\n {\n b_chan_assign_mask = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_chan_assign_mask)\n {\n {\n {\n b_nonstd_bed_channel_assignment = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_nonstd_bed_channel_assignment)\n {\n {\n {\n nonstd_bed_channel_assignment_mask = this.BAM_source.get(\"\", 17);\n this.BAM_g_position += 17;\n }\n for (this.i = 0; this.i < 17; this.i++)\n {\n if (nonstd_bed_channel_assignment_mask >> this.i & 1)\n {\n if (this.i == 3 || this.i == 16)\n {\n {\n lfe_signalled = 1;\n }\n }\n }\n }\n }\n }\n else\n {\n {\n {\n std_bed_channel_assignment_mask = this.BAM_source.get(\"\", 10);\n this.BAM_g_position += 10;\n }\n for (this.i = 0; this.i < 10; this.i++)\n {\n if (std_bed_channel_assignment_mask >> this.i & 1)\n {\n {\n if (this.i == 2 || this.i == 9)\n {\n {\n lfe_signalled = 1;\n }\n }\n {\n oc_num_channels = this.BAM_g_table12.slice(0)[this.i];\n }\n }\n }\n }\n }\n }\n }\n }\n else\n {\n {\n if (n_signals > 1)\n {\n {\n {\n bed_ch_bits = Math.ceil(Math.log(n_signals) / Math.log(2));\n }\n {\n n_bed_signals_minus1 = this.BAM_source.get(\"\", bed_ch_bits);\n this.BAM_g_position += bed_ch_bits;\n }\n {\n n_bed_signals = n_bed_signals_minus1 + 1;\n }\n }\n }\n else\n {\n {\n n_bed_signals = 1;\n }\n }\n for (b = 0; b < n_bed_signals; b++)\n {\n {\n {\n nonstd_bed_channel_assignment = this.BAM_source.get(\"\", 4);\n this.BAM_g_position += 4;\n }\n if (n_bed_signals == 3 || n_bed_signals == 16)\n {\n {\n lfe_signalled = 1;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n F_ac4_presentation_substream_info (aps_presentation_version)\n {\n var substream_index;\n var b_lfe = null;\n var b_lfe;\n var b_alternative;\n var b_iframe_pres;\n {\n {\n b_alternative = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n b_iframe_pres = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n substream_index = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (substream_index == 3)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n substream_index += this.v;\n }\n }\n }\n {\n if (b_lfe == null)\n {\n b_lfe = new Array((substream_index) + 1).fill(0);\n }\n else if ((b_lfe).length <= substream_index)\n {\n b_lfe.push.apply(b_lfe, new Array((substream_index) - (b_lfe).length + 1).fill(0));\n }\n b_lfe[substream_index] = 0;\n }\n {\n this.last_referenced_substream = Math.max(this.last_referenced_substream, substream_index);\n }\n {\n this.referenced_substreams.push(substream_index);\n }\n }\n }\n\n F_presentation_version ()\n {\n var val;\n var b_tmp;\n {\n {\n val = 0;\n }\n {\n b_tmp = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n while (b_tmp)\n {\n {\n {\n val = val + 1;\n }\n {\n b_tmp = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n }\n return val;\n }\n }\n\n F_get_ch_mode (cm)\n {\n {\n if ((cm) == (this.CHANNEL_MODE_MONO))\n {\n {\n this.n = 0;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_STEREO))\n {\n {\n this.n = 1;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_30))\n {\n {\n this.n = 2;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_50))\n {\n {\n this.n = 3;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_51))\n {\n {\n this.n = 4;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_70_34))\n {\n {\n this.n = 5;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_71_34))\n {\n {\n this.n = 6;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_70_52))\n {\n {\n this.n = 7;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_71_52))\n {\n {\n this.n = 8;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_70_322))\n {\n {\n this.n = 9;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_71_322))\n {\n {\n this.n = 10;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_704))\n {\n {\n this.n = 11;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_714))\n {\n {\n this.n = 12;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_904))\n {\n {\n this.n = 13;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_914))\n {\n {\n this.n = 14;\n }\n }\n else\n {\n if (1)\n {\n throw \"Unknown channel mode!\";\n }\n }\n return this.n;\n }\n }\n\n F_presentation_config_ext_info ()\n {\n {\n {\n this.n_skip_bytes = this.BAM_source.get(\"\", 5);\n this.BAM_g_position += 5;\n }\n {\n this.b_more_skip_bytes = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (this.b_more_skip_bytes)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n this.n_skip_bytes += this.v << 5;\n }\n }\n }\n if (0)\n {\n {\n {\n this.n_bits_read_0 = this.BAM_g_position;\n }\n {\n this.F_ac4_presentation_v2_info(this.toc_i);\n }\n {\n this.n_bits_read_1 = this.BAM_g_position;\n }\n {\n this.n_bits_read = this.n_bits_read_1 - this.n_bits_read_0;\n }\n if (((n_bits_read % 8) + 8) % 8)\n {\n {\n {\n this.n_skip_bits = 8 - ((n_bits_read % 8) + 8) % 8;\n }\n {\n this.reserved = this.BAM_source.get(\"\", this.n_skip_bits);\n this.BAM_g_position += this.n_skip_bits;\n }\n {\n this.n_bits_read += this.n_skip_bits;\n }\n }\n }\n {\n this.n_skip_bytes = this.n_skip_bytes - Math.floor(this.n_bits_read / 8);\n }\n }\n }\n if (this.bitstream_version >= 1 && this.presentation_config == 8)\n {\n {\n {\n this.n_bits_read_0 = this.BAM_g_position;\n }\n {\n this.n_bits_read_1 = this.BAM_g_position;\n }\n {\n this.padding = this.BAM_source.get(\"\", this.n_skip_bytes * 8 - (this.n_bits_read_1 - this.n_bits_read_0));\n this.BAM_g_position += this.n_skip_bytes * 8 - (this.n_bits_read_1 - this.n_bits_read_0);\n }\n }\n }\n else\n {\n for (this.i = 0; this.i < this.n_skip_bytes; this.i++)\n {\n {\n this.reserved = this.BAM_source.get(\"\", 8);\n this.BAM_g_position += 8;\n }\n }\n }\n }\n }\n\n F_define_channel_modes ()\n {\n var CHANNEL_MODE_7X_34 = null;\n var CHANNEL_MODE_7X_34;\n var CHANNEL_MODE_7X_322 = null;\n var CHANNEL_MODE_7X_322;\n var CHANNEL_MODE_7X = null;\n var CHANNEL_MODE_7X;\n var CHANNEL_MODE_7X_52 = null;\n var CHANNEL_MODE_7X_52;\n var CHANNEL_MODE_5X = null;\n var CHANNEL_MODE_5X;\n {\n {\n this.CHANNEL_MODE_MONO = 0;\n }\n {\n this.CHANNEL_MODE_STEREO = 2;\n }\n {\n this.CHANNEL_MODE_30 = 12;\n }\n {\n this.CHANNEL_MODE_50 = 13;\n }\n {\n this.CHANNEL_MODE_51 = 14;\n }\n {\n this.CHANNEL_MODE_70_34 = 120;\n }\n {\n this.CHANNEL_MODE_71_34 = 121;\n }\n {\n this.CHANNEL_MODE_70_52 = 122;\n }\n {\n this.CHANNEL_MODE_71_52 = 123;\n }\n {\n this.CHANNEL_MODE_70_322 = 124;\n }\n {\n this.CHANNEL_MODE_71_322 = 125;\n }\n {\n this.CHANNEL_MODE_704 = 252;\n }\n {\n this.CHANNEL_MODE_714 = 253;\n }\n {\n this.CHANNEL_MODE_904 = 508;\n }\n {\n this.CHANNEL_MODE_914 = 509;\n }\n {\n this.CHANNEL_MODE_222 = 510;\n }\n {\n CHANNEL_MODE_5X = [this.CHANNEL_MODE_50, this.CHANNEL_MODE_51];\n }\n {\n CHANNEL_MODE_7X_34 = [this.CHANNEL_MODE_70_34, this.CHANNEL_MODE_71_34];\n }\n {\n CHANNEL_MODE_7X_52 = [this.CHANNEL_MODE_70_52, this.CHANNEL_MODE_71_52];\n }\n {\n CHANNEL_MODE_7X_322 = [this.CHANNEL_MODE_70_322, this.CHANNEL_MODE_71_322];\n }\n {\n CHANNEL_MODE_7X = CHANNEL_MODE_7X_34 + CHANNEL_MODE_7X_52 + CHANNEL_MODE_7X_322;\n }\n }\n }\n\n F_channel_mode_to_ch_mode (cm)\n {\n {\n if ((cm) == (this.CHANNEL_MODE_MONO))\n {\n return 0;\n }\n else if ((cm) == (this.CHANNEL_MODE_STEREO))\n {\n return 1;\n }\n else if ((cm) == (this.CHANNEL_MODE_30))\n {\n return 2;\n }\n else if ((cm) == (this.CHANNEL_MODE_50))\n {\n return 3;\n }\n else if ((cm) == (this.CHANNEL_MODE_51))\n {\n return 4;\n }\n else if ((cm) == (this.CHANNEL_MODE_70_34))\n {\n return 5;\n }\n else if ((cm) == (this.CHANNEL_MODE_71_34))\n {\n return 6;\n }\n else if ((cm) == (this.CHANNEL_MODE_70_52))\n {\n return 7;\n }\n else if ((cm) == (this.CHANNEL_MODE_71_52))\n {\n return 8;\n }\n else if ((cm) == (this.CHANNEL_MODE_70_322))\n {\n return 9;\n }\n else if ((cm) == (this.CHANNEL_MODE_71_322))\n {\n return 10;\n }\n else if ((cm) == (this.CHANNEL_MODE_704))\n {\n return 11;\n }\n else if ((cm) == (this.CHANNEL_MODE_714))\n {\n return 12;\n }\n else if ((cm) == (this.CHANNEL_MODE_904))\n {\n return 13;\n }\n else if ((cm) == (this.CHANNEL_MODE_914))\n {\n return 14;\n }\n else if ((cm) == (this.CHANNEL_MODE_222))\n {\n return 15;\n }\n else\n {\n if (1)\n {\n throw \"Cannot convert extended channel mode to ch_mode!\";\n }\n }\n }\n }\n\n F_variable_bits (n_bits)\n {\n var read;\n var value;\n var b_read_more;\n {\n {\n value = 0;\n }\n {\n b_read_more = 1;\n }\n while (b_read_more)\n {\n {\n {\n read = this.BAM_source.get(\"\", n_bits);\n this.BAM_g_position += n_bits;\n }\n {\n value += read;\n }\n {\n b_read_more = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_read_more)\n {\n {\n {\n value <<= n_bits;\n }\n {\n value += 1 << n_bits;\n }\n }\n }\n }\n }\n return value;\n }\n }\n\n F_raw_ac4_frame_toc_only ()\n {\n var ac4_toc_end;\n var ac4_toc_begin;\n var frame_len_base;\n {\n {\n ac4_toc_begin = this.BAM_g_position;\n }\n {\n this.F_ac4_toc();\n }\n {\n ac4_toc_end = this.BAM_g_position;\n this.BAM_sink.after_position(\"ac4_toc_end\", ac4_toc_end);\n }\n {\n frame_len_base = this.BAM_g_table13.slice(0)[this.frame_rate_index];\n }\n }\n }\n\n F_ac4_presentation_info ()\n {\n {\n {\n this.b_single_substream = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (this.b_single_substream != 1)\n {\n {\n {\n this.presentation_config = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n if (this.presentation_config == 7)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n this.presentation_config += this.v;\n }\n }\n }\n }\n }\n {\n this.presentation_version = this.F_presentation_version();\n if (this.presentation_version == null)\n {\n throw ParseError(\"F_presentation_version\", \"expected to return a value, returned None\");\n }\n }\n if (this.b_single_substream != 1 && this.presentation_config == 6)\n {\n {\n this.b_add_emdf_substreams = 1;\n }\n }\n else\n {\n {\n {\n this.presentation_level = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n this.BAM_sink.write_uint(\"presentation_level\", 3, this.presentation_level, this.BAM_g_position);\n }\n {\n this.b_presentation_id = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n this.BAM_sink.write_uint(\"b_presentation_id\", 1, this.b_presentation_id, this.BAM_g_position);\n }\n if (this.b_presentation_id)\n {\n {\n this.BAM_sink.before_call(\"variable_bits\", [2], \"presentation_id\", this.BAM_g_position);\n this.presentation_id = this.F_variable_bits(2);\n if (this.presentation_id == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n this.BAM_sink.after_call(\"variable_bits\", this.presentation_id, \"presentation_id\", this.BAM_g_position);\n }\n }\n {\n this.F_frame_rate_multiply_info();\n }\n {\n this.F_emdf_info();\n }\n if (this.b_single_substream == 1)\n {\n {\n this.F_ac4_substream_info(0, 0, 0);\n }\n }\n else\n {\n {\n {\n this.b_hsf_ext = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if ((this.presentation_config) == (0))\n {\n {\n {\n this.F_ac4_substream_info(0, 0, 0);\n }\n if (this.b_hsf_ext)\n {\n {\n this.F_ac4_hsf_ext_substream_info(1);\n }\n }\n {\n this.F_ac4_substream_info(0, 1, 1);\n }\n }\n }\n else if ((this.presentation_config) == (1))\n {\n {\n {\n this.F_ac4_substream_info(0, 0, 0);\n }\n if (this.b_hsf_ext)\n {\n {\n this.F_ac4_hsf_ext_substream_info(1);\n }\n }\n {\n this.F_ac4_substream_info(0, 0, 1);\n }\n }\n }\n else if ((this.presentation_config) == (2))\n {\n {\n {\n this.F_ac4_substream_info(0, 0, 0);\n }\n if (this.b_hsf_ext)\n {\n {\n this.F_ac4_hsf_ext_substream_info(1);\n }\n }\n {\n this.F_ac4_substream_info(1, 0, 1);\n }\n }\n }\n else if ((this.presentation_config) == (3))\n {\n {\n {\n this.F_ac4_substream_info(0, 0, 0);\n }\n if (this.b_hsf_ext)\n {\n {\n this.F_ac4_hsf_ext_substream_info(1);\n }\n }\n {\n this.F_ac4_substream_info(0, 1, 1);\n }\n {\n this.F_ac4_substream_info(1, 0, 2);\n }\n }\n }\n else if ((this.presentation_config) == (4))\n {\n {\n {\n this.F_ac4_substream_info(0, 0, 0);\n }\n if (this.b_hsf_ext)\n {\n {\n this.F_ac4_hsf_ext_substream_info(1);\n }\n }\n {\n this.F_ac4_substream_info(0, 0, 1);\n }\n {\n this.F_ac4_substream_info(1, 0, 2);\n }\n }\n }\n else if ((this.presentation_config) == (5))\n {\n {\n {\n this.F_ac4_substream_info(0, 0, 0);\n }\n if (this.b_hsf_ext)\n {\n {\n this.F_ac4_hsf_ext_substream_info(1);\n }\n }\n }\n }\n else\n {\n {\n this.F_presentation_config_ext_info();\n }\n }\n }\n }\n {\n this.b_pre_virtualized = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n this.b_add_emdf_substreams = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n }\n if (this.b_add_emdf_substreams)\n {\n {\n {\n this.n_add_emdf_substreams = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (this.n_add_emdf_substreams == 0)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n this.n_add_emdf_substreams = this.v + 4;\n }\n }\n }\n for (this.pi_i = 0; this.pi_i < this.n_add_emdf_substreams; this.pi_i++)\n {\n {\n this.F_emdf_info();\n }\n }\n }\n }\n }\n }\n\n F_substream_index_table ()\n {\n var b_size_present;\n var substream_type = null;\n var substream_type;\n var b_substream_type_known = null;\n var b_substream_type_known;\n var substream_size = null;\n var substream_size;\n var n_substreams;\n var s;\n var b_more_bits;\n {\n {\n n_substreams = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (n_substreams == 0)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n n_substreams = this.v + 4;\n }\n }\n }\n if (n_substreams - 1 < this.last_referenced_substream)\n {\n throw \"Number of substreams (n_substreams) indicated by substream_index_table is less than last referenced substream in TOC (last_referenced_substream).\";\n }\n if (n_substreams - 1 > this.last_referenced_substream)\n {\n {\n {\n if (b_substream_type_known == null)\n {\n b_substream_type_known = new Array((n_substreams - 1) + 1).fill(0);\n }\n else if ((b_substream_type_known).length <= n_substreams - 1)\n {\n b_substream_type_known.push.apply(b_substream_type_known, new Array((n_substreams - 1) - (b_substream_type_known).length + 1).fill(0));\n }\n b_substream_type_known[n_substreams - 1] = 0;\n }\n {\n if (substream_type == null)\n {\n substream_type = new Array((n_substreams - 1) + 1).fill(null);\n }\n else if ((substream_type).length <= n_substreams - 1)\n {\n substream_type.push.apply(substream_type, new Array((n_substreams - 1) - (substream_type).length + 1).fill(null));\n }\n substream_type[n_substreams - 1] = \"unknown\";\n }\n }\n }\n if (n_substreams == 1)\n {\n {\n b_size_present = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n else\n {\n {\n b_size_present = 1;\n }\n }\n if (b_size_present)\n {\n for (s = 0; s < n_substreams; s++)\n {\n {\n {\n b_more_bits = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n if (substream_size == null)\n {\n substream_size = new Array((s) + 1).fill(0);\n }\n else if ((substream_size).length <= s)\n {\n substream_size.push.apply(substream_size, new Array((s) - (substream_size).length + 1).fill(0));\n }\n substream_size[s] = this.BAM_source.get(\"\", 10);\n this.BAM_g_position += 10;\n }\n if (b_more_bits)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n if (substream_size == null)\n {\n substream_size = new Array((s) + 1).fill(0);\n }\n else if ((substream_size).length <= s)\n {\n substream_size.push.apply(substream_size, new Array((s) - (substream_size).length + 1).fill(0));\n }\n substream_size[s] += this.v << 10;\n }\n }\n }\n }\n }\n }\n }\n }\n\n F_ac4_presentation_v2_info (apv_toc_i)\n {\n {\n {\n if (this.presentation_to_groups == null)\n {\n this.presentation_to_groups = new Array((this.toc_i) + 1).fill(null);\n }\n else if ((this.presentation_to_groups).length <= this.toc_i)\n {\n this.presentation_to_groups.push.apply(this.presentation_to_groups, new Array((this.toc_i) - (this.presentation_to_groups).length + 1).fill(null));\n }\n this.presentation_to_groups[this.toc_i] = [];\n }\n {\n this.b_single_substream_group = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (this.b_single_substream_group != 1)\n {\n {\n {\n this.presentation_config = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n if (this.presentation_config == 7)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n this.presentation_config += this.v;\n }\n }\n }\n }\n }\n if (this.bitstream_version != 1)\n {\n {\n this.presentation_version = this.F_presentation_version();\n if (this.presentation_version == null)\n {\n throw ParseError(\"F_presentation_version\", \"expected to return a value, returned None\");\n }\n }\n }\n if (this.b_single_substream_group != 1 && this.presentation_config == 6)\n {\n {\n this.b_add_emdf_substreams = 1;\n }\n }\n else\n {\n {\n if (this.bitstream_version != 1)\n {\n {\n this.presentation_level = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n this.BAM_sink.write_uint(\"presentation_level\", 3, this.presentation_level, this.BAM_g_position);\n }\n }\n {\n this.b_presentation_id = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n this.BAM_sink.write_uint(\"b_presentation_id\", 1, this.b_presentation_id, this.BAM_g_position);\n }\n if (this.b_presentation_id)\n {\n {\n this.BAM_sink.before_call(\"variable_bits\", [2], \"presentation_id\", this.BAM_g_position);\n this.presentation_id = this.F_variable_bits(2);\n if (this.presentation_id == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n this.BAM_sink.after_call(\"variable_bits\", this.presentation_id, \"presentation_id\", this.BAM_g_position);\n }\n }\n {\n this.F_frame_rate_multiply_info();\n }\n {\n this.F_frame_rate_fractions_info();\n }\n {\n this.F_emdf_info();\n }\n {\n this.b_presentation_filter = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (this.b_presentation_filter)\n {\n {\n this.b_enable_presentation = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n if (this.b_single_substream_group == 1)\n {\n {\n {\n this.F_ac4_sgi_specifier(0, 0, 0);\n }\n {\n this.n_substream_groups = 1;\n }\n }\n }\n else\n {\n {\n {\n this.b_multi_pid = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if ((this.presentation_config) == (0))\n {\n {\n {\n this.F_ac4_sgi_specifier(0, 0, 0);\n }\n {\n this.F_ac4_sgi_specifier(0, 1, 1);\n }\n {\n this.n_substream_groups = 2;\n }\n }\n }\n else if ((this.presentation_config) == (1))\n {\n {\n {\n this.F_ac4_sgi_specifier(0, 0, 0);\n }\n {\n this.F_ac4_sgi_specifier(0, 0, 1);\n }\n {\n this.n_substream_groups = 1;\n }\n }\n }\n else if ((this.presentation_config) == (2))\n {\n {\n {\n this.F_ac4_sgi_specifier(0, 0, 0);\n }\n {\n this.F_ac4_sgi_specifier(1, 0, 1);\n }\n {\n this.n_substream_groups = 2;\n }\n }\n }\n else if ((this.presentation_config) == (3))\n {\n {\n {\n this.F_ac4_sgi_specifier(0, 0, 0);\n }\n {\n this.F_ac4_sgi_specifier(0, 1, 1);\n }\n {\n this.F_ac4_sgi_specifier(1, 0, 2);\n }\n {\n this.n_substream_groups = 3;\n }\n }\n }\n else if ((this.presentation_config) == (4))\n {\n {\n {\n this.F_ac4_sgi_specifier(0, 0, 0);\n }\n {\n this.F_ac4_sgi_specifier(0, 0, 1);\n }\n {\n this.F_ac4_sgi_specifier(1, 0, 2);\n }\n {\n this.n_substream_groups = 2;\n }\n }\n }\n else if ((this.presentation_config) == (5))\n {\n {\n {\n this.n_substream_groups_minus2 = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n {\n this.n_substream_groups = this.n_substream_groups_minus2 + 2;\n }\n if (this.n_substream_groups == 5)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n this.n_substream_groups += this.v;\n }\n }\n }\n for (this.sg = 0; this.sg < this.n_substream_groups; this.sg++)\n {\n {\n this.F_ac4_sgi_specifier(0, 0, 0);\n }\n }\n }\n }\n else\n {\n {\n {\n this.n_substream_groups = 0;\n }\n {\n this.F_presentation_config_ext_info();\n }\n }\n }\n }\n }\n {\n this.b_pre_virtualized = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n this.b_add_emdf_substreams = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n this.F_ac4_presentation_substream_info(this.presentation_version);\n }\n }\n }\n if (this.b_add_emdf_substreams)\n {\n {\n {\n this.n_add_emdf_substreams = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (this.n_add_emdf_substreams == 0)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n this.n_add_emdf_substreams = this.v + 4;\n }\n }\n }\n for (this.pi_i = 0; this.pi_i < this.n_add_emdf_substreams; this.pi_i++)\n {\n {\n this.F_emdf_info();\n }\n }\n }\n }\n }\n }\n\n F_frame_size ()\n {\n var frame_size;\n {\n {\n frame_size = this.BAM_source.get(\"\", 16);\n this.BAM_g_position += 16;\n }\n if (frame_size == 65535)\n {\n {\n frame_size = this.BAM_source.get(\"\", 24);\n this.BAM_g_position += 24;\n }\n }\n }\n }\n\n F_ac4_toc ()\n {\n var b_wait_frames;\n var payload_base_minus1;\n var n_presentations;\n var wait_frames;\n var b_payload_base;\n var program_uuid;\n var total_n_substream_groups;\n var payload_base;\n var b_program_uuid_present;\n var b_single_presentation;\n var b_iframe_global;\n var sequence_counter;\n var b_program_id;\n var b_more_presentations;\n var short_program_id;\n {\n {\n this.bitstream_version = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (this.bitstream_version == 3)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n this.bitstream_version += this.v;\n }\n }\n }\n {\n sequence_counter = this.BAM_source.get(\"\", 10);\n this.BAM_g_position += 10;\n }\n {\n b_wait_frames = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_wait_frames)\n {\n {\n {\n wait_frames = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n if (wait_frames > 0)\n {\n {\n this.reserved = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n }\n }\n }\n {\n this.fs_index = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n this.frame_rate_index = this.BAM_source.get(\"\", 4);\n this.BAM_g_position += 4;\n }\n if (this.frame_rate_index > 13)\n {\n throw \"frame_rate_index must be in range 0..13\";\n }\n if (this.fs_index == 0 && this.frame_rate_index != 13)\n {\n throw \"44.1kHz sampling rate && frame rates other than 13 are illegal. See table 84 in the ETSI spec.\";\n }\n {\n b_iframe_global = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n b_single_presentation = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_single_presentation)\n {\n {\n n_presentations = 1;\n }\n }\n else\n {\n {\n {\n b_more_presentations = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_more_presentations)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n n_presentations = this.v + 2;\n }\n }\n }\n else\n {\n {\n n_presentations = 0;\n }\n }\n }\n }\n {\n payload_base = 0;\n }\n {\n b_payload_base = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_payload_base)\n {\n {\n {\n payload_base_minus1 = this.BAM_source.get(\"\", 5);\n this.BAM_g_position += 5;\n this.BAM_sink.write_uint(\"payload_base_minus1\", 5, payload_base_minus1, this.BAM_g_position);\n }\n {\n payload_base = payload_base_minus1 + 1;\n }\n if (payload_base == 32)\n {\n {\n {\n this.v = this.F_variable_bits(3);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n payload_base += this.v;\n }\n }\n }\n }\n }\n {\n this.a_substream_indices = [];\n }\n {\n this.last_referenced_substream = -1;\n }\n {\n this.referenced_substreams = [];\n }\n {\n this.bk_substream_index = 100;\n }\n if (this.bitstream_version <= 1)\n {\n {\n {\n this.toc_j = 0;\n }\n for (this.toc_i = 0; this.toc_i < n_presentations; this.toc_i++)\n {\n {\n this.F_ac4_presentation_info();\n }\n }\n }\n }\n else\n {\n {\n {\n b_program_id = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_program_id)\n {\n {\n {\n short_program_id = this.BAM_source.get(\"\", 16);\n this.BAM_g_position += 16;\n }\n {\n b_program_uuid_present = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_program_uuid_present)\n {\n {\n program_uuid = this.BAM_source.get(\"\", 16 * 8);\n this.BAM_g_position += 16 * 8;\n }\n }\n }\n }\n {\n total_n_substream_groups = 0;\n }\n for (this.toc_i = 0; this.toc_i < n_presentations; this.toc_i++)\n {\n {\n {\n this.F_ac4_presentation_v2_info(this.toc_i);\n }\n for (this.i = 0; this.i < (this.presentation_to_groups[this.toc_i]).length; this.i++)\n {\n {\n total_n_substream_groups = Math.max(total_n_substream_groups, 1 + this.presentation_to_groups[this.toc_i][this.i]);\n }\n }\n }\n }\n for (this.toc_j = 0; this.toc_j < total_n_substream_groups; this.toc_j++)\n {\n {\n this.F_ac4_substream_group_info(this.toc_j);\n }\n }\n }\n }\n {\n this.F_substream_index_table();\n }\n {\n this.BAM_l_align = ((8 - ((this.BAM_g_position % 8) + 8) % 8 % 8) + 8) % 8;\n this.BAM_l_align_val = this.BAM_source.get_align(this.BAM_l_align);\n this.BAM_sink.write_align(((8 - ((this.BAM_g_position % 8) + 8) % 8 % 8) + 8) % 8, this.BAM_l_align_val);\n this.BAM_g_position += this.BAM_l_align;\n }\n }\n }\n\n F_get_num_channels (cm)\n {\n {\n if ((cm) == (this.CHANNEL_MODE_MONO))\n {\n {\n this.n = 1;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_STEREO))\n {\n {\n this.n = 2;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_30))\n {\n {\n this.n = 3;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_50))\n {\n {\n this.n = 5;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_51))\n {\n {\n this.n = 6;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_70_34))\n {\n {\n this.n = 7;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_71_34))\n {\n {\n this.n = 8;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_70_52))\n {\n {\n this.n = 7;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_71_52))\n {\n {\n this.n = 8;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_70_322))\n {\n {\n this.n = 7;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_71_322))\n {\n {\n this.n = 8;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_704))\n {\n {\n this.n = 11;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_714))\n {\n {\n this.n = 12;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_904))\n {\n {\n this.n = 13;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_914))\n {\n {\n this.n = 14;\n }\n }\n else\n {\n if (1)\n {\n throw \"Unknown channel mode!\";\n }\n }\n return this.n;\n }\n }\n\n F_frame_rate_multiply_info ()\n {\n var multiplier_bit;\n var b_multiplier;\n {\n if ((this.BAM_g_table14.slice(0).indexOf(this.frame_rate_index) >= 0))\n {\n {\n {\n b_multiplier = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_multiplier)\n {\n {\n {\n multiplier_bit = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n this.frame_rate_factor = this.BAM_g_table15[multiplier_bit];\n }\n }\n }\n else\n {\n {\n this.frame_rate_factor = 1;\n }\n }\n }\n }\n else\n {\n if ((this.BAM_g_table16.slice(0).indexOf(this.frame_rate_index) >= 0))\n {\n {\n {\n b_multiplier = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n this.frame_rate_factor = this.BAM_g_table17[b_multiplier];\n }\n }\n }\n else\n {\n {\n this.frame_rate_factor = 1;\n }\n }\n }\n }\n }\n\n F_frame_rate_fractions_info ()\n {\n var b_frame_rate_fraction_is_4;\n var frame_rate_fraction;\n var b_frame_rate_fraction;\n {\n {\n frame_rate_fraction = 1;\n }\n if ((this.BAM_g_table18.slice(0).indexOf(this.frame_rate_index) >= 0))\n {\n if (this.frame_rate_factor == 1)\n {\n {\n {\n b_frame_rate_fraction = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_frame_rate_fraction == 1)\n {\n {\n frame_rate_fraction = 2;\n }\n }\n }\n }\n }\n if ((this.BAM_g_table19.slice(0).indexOf(this.frame_rate_index) >= 0))\n {\n {\n {\n b_frame_rate_fraction = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_frame_rate_fraction == 1)\n {\n {\n {\n b_frame_rate_fraction_is_4 = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_frame_rate_fraction_is_4 == 1)\n {\n {\n frame_rate_fraction = 4;\n }\n }\n else\n {\n {\n frame_rate_fraction = 2;\n }\n }\n }\n }\n }\n }\n }\n }\n}\nexport default Parser;\n", "/************************************************************************************************************\n * Copyright (C) 2023-2025 by Dolby International AB.\n * All rights reserved.\n\n * Redistribution and use in source and binary forms, with or without modification, are permitted\n * provided that the following conditions are met:\n\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions\n * and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions\n * and the following disclaimer in the documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or\n * promote products derived from this software without specific prior written permission.\n\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n ************************************************************************************************************/\n\n/*global console*/\n\n/**\n * @module\n * @desc This file provides a wrapper function to the AC-4 TOC parser, allowing to parse the TOC from an AC-4 bitstream and filter specific elements of interest.\n */\n\nimport { BitSource } from \"./bitsource.js\";\nimport { FilterSink } from \"./filtersink.js\";\nimport { Parser } from \"../ac4_toc_parser.js\";\n\n/**\n * Object containing parsed information about parsed element\n * @typedef {Object} ElementData\n * @property {string} name\n * @property {number} value\n * @property {number} pos\n * @property {number} width\n * @property {string} handler\n */\n\n/**\n * Parses the TOC from an AC-4 bitstream with filtering specified elements\n * @param {DataView} data - DataView that represents individual media sample\n * @param {string[]} elements - The AC-4 TOC elements to be filtered\n * @returns {ElementData[]|null} An array of objects containing the parsed elements\n */\nconst parseTocElements = (data, elements) => {\n let parsedElements = [];\n let index = 0;\n\n const bitSourceIterator = {\n next() {\n if (index < data.byteLength) {\n return { value: data.getUint8(index), done: ++index >= data.byteLength };\n }\n return { value: undefined, done: true };\n },\n };\n\n const sinkCallback = (name, value, width, position, handler) => {\n // subtract width because we are called after the position has been updated\n const pos = position - width;\n parsedElements.push({ handler, name, pos, value, width });\n };\n\n const bitSource = new BitSource(bitSourceIterator);\n const sink = new FilterSink(elements, sinkCallback);\n\n const parser = new Parser(bitSource, sink);\n\n // in case of parsing errors log them and set parsed elements to null (which will result in returning unmodified buffer)\n try {\n parser.F_raw_ac4_frame_toc_only();\n } catch (err) {\n console.error(err);\n parsedElements = null;\n }\n\n return parsedElements;\n};\n\nexport { parseTocElements };\n", "/************************************************************************************************************\n * Copyright (C) 2023-2025 by Dolby International AB.\n * All rights reserved.\n\n * Redistribution and use in source and binary forms, with or without modification, are permitted\n * provided that the following conditions are met:\n\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions\n * and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions\n * and the following disclaimer in the documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or\n * promote products derived from this software without specific prior written permission.\n\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n ************************************************************************************************************/\n\n/*global console*/\n\n/**\n * @module\n * @desc AlpsCore\n */\n\nimport * as isoBmffBox from \"./constants/isobmff_box_names.js\";\nimport * as tocElements from \"./constants/toc_elements.js\";\nimport { setBits, shiftLeft } from \"./bitwise_operations.js\";\nimport { getSampleOffsets } from \"./get_sample_offsets.js\";\nimport { parseTocElements } from \"./ac4_toc_parser_wrapper/index.js\";\n\nconst PRESENTATION_LEVEL_WIDTH = 3;\nconst UNDECODABLE_PRESENTATION_LEVEL = 7;\nconst BITS_TO_SHIFT_TO_DIVIDE_BY_8 = 3;\nconst MINIMUM_PRESENTATIONS_AMOUNT = 2;\nconst DIALOG_GAIN_ADJUSTMENT_FACTOR = 256;\n\nconst elementsToParse = [\n tocElements.PRESENTATION_LEVEL,\n tocElements.B_PRESENTATION_ID,\n tocElements.PRESENTATION_ID,\n tocElements.PAYLOAD_BASE_MINUS1,\n tocElements.BYTE_ALIGNMENT,\n tocElements.AC4_TOC_END,\n];\n\n/**\n * Provides the core functionality of the library. It allows to process ISOBMFF segments and manage presentations.\n */\n/**\n * Process an ISOBMFF Init segment buffer\n * @param {ISOBoxer} parsedSegmentBuffer - The ISOBMFF segment buffer to process\n * @returns {import('./types').Presentation[]} - List of presentations read from Init ISOBMFF Segment\n */\nconst processIsoBmffInitSegment = (parsedSegmentBuffer) => {\n // parse the segment that was just handed in\n const movie = parsedSegmentBuffer.fetch(isoBmffBox.MOVIE);\n const meta = parsedSegmentBuffer.fetch(isoBmffBox.META);\n\n console.log(\"ALPS::processIsoBmffSegment - found init segment\");\n\n // Any new init segment replaces the old contents entirely.\n const presentations = [];\n const groupsList = meta && meta.boxes.find((box) => box.type === isoBmffBox.GROUPS_LIST);\n const preselectionGroups = groupsList && groupsList.boxes.filter((box) => box.type === isoBmffBox.PRESELECTION_GROUP);\n const tracks = movie && movie.boxes.filter((box) => box.type === isoBmffBox.TRACK);\n const trackIds =\n tracks?.map((track) => {\n const trackHeader = track.boxes.find((box) => box.type === isoBmffBox.TRACK_HEADER);\n return trackHeader.track_ID;\n }) ?? [];\n\n if (Array.isArray(preselectionGroups)) {\n for (const preselectionGroup of preselectionGroups) {\n // filter out those preselection groups that reference tracks only from within this file\n // (that is, where every entity_ID is also the ID of a track in the file)\n if (preselectionGroup.entities.every((entity) => trackIds.includes(entity.entity_id))) {\n const parsedPreselectionTag = parseInt(preselectionGroup.preselection_tag, 10);\n const id = isNaN(parsedPreselectionTag) ? null : parsedPreselectionTag;\n\n const selectionPriority = preselectionGroup.selection_priority ?? null;\n\n const udtaBox = preselectionGroup.boxes.find((box) => box.type === isoBmffBox.USER_DATA);\n const diapBox = udtaBox?.boxes.find((box) => box.type === isoBmffBox.DIALOG_PROCESSING);\n const dialogGain = Number.isInteger(diapBox?.dialog_gain)\n ? diapBox.dialog_gain / DIALOG_GAIN_ADJUSTMENT_FACTOR\n : null;\n\n const languageBox = preselectionGroup.boxes.find((box) => box.type === isoBmffBox.EXTENDED_LANGUAGE_TAG);\n const extendedLanguage = languageBox?.extended_language ?? null;\n\n const audioRenderingIndicationBox = preselectionGroup.boxes.find(\n (box) => box.type === isoBmffBox.AUDIO_RENDERING_INDICATION,\n );\n const audioRenderingIndication = audioRenderingIndicationBox?.audio_rendering_indication ?? null;\n\n const labelBoxes = preselectionGroup.boxes.filter((box) => box.type === isoBmffBox.LABEL);\n const labels = labelBoxes.map((labelBox) => ({\n isGroupLabel: labelBox.is_group_label,\n label: labelBox.label,\n labelId: labelBox.label_id,\n language: labelBox.language,\n }));\n\n const kindBoxes = preselectionGroup.boxes.filter((box) => box.type === isoBmffBox.KIND);\n const kinds = kindBoxes.map((kindBox) => ({\n schemeURI: kindBox.schemeURI,\n value: kindBox.value,\n }));\n\n // append parsed presentation object\n presentations.push({\n audioRenderingIndication,\n dialogGain,\n extendedLanguage,\n id,\n kinds,\n labels,\n selectionPriority,\n });\n }\n }\n } else {\n console.log(\"ALPS::processIsoBmffSegment - no preselection group found\");\n }\n\n return presentations;\n};\n\n/**\n * Process an ISOBMFF media segment buffer\n * @param {ISOBoxer} parsedSegmentBuffer - The ISOBMFF segment buffer to process\n * @param {number} activePresentationId - Presentation ID that should be selected for processing\n * @returns {number|null} Presentation ID of enforced presentation\n */\nconst processIsoBmffMediaSegment = (parsedSegmentBuffer, activePresentationId) => {\n // parse the segment that was just handed in\n console.log(`ALPS::processIsoBmffSegment - processing moof media. ActivePresentation: ${activePresentationId}`);\n\n // this is the data segment\n // determine the offsets to all samples\n const sampleOffsets = getSampleOffsets(parsedSegmentBuffer);\n\n console.log(`ALPS::processIsoBmffSegment - obtained ${sampleOffsets.length} sample offsets`);\n\n for (const sampleOffset of sampleOffsets) {\n const sampleData = new DataView(parsedSegmentBuffer._raw.buffer, sampleOffset.offset, sampleOffset.size);\n const parsedElements = parseTocElements(sampleData, elementsToParse);\n\n if (parsedElements === null) {\n console.log(\"ALPS::processIsobmffSegment - parsing error\");\n return null;\n }\n\n const payloadBaseMinus1 = parsedElements.find((element) => element.name === tocElements.PAYLOAD_BASE_MINUS1);\n if (!payloadBaseMinus1) {\n console.log(\"ALPS::processIsobmffSegment - payloadBaseMinus1 field not found, returning unmodified buffer\");\n return null;\n }\n\n let accumulatedShift = 0;\n const byteAlignment = parsedElements.find((element) => element.name === tocElements.BYTE_ALIGNMENT);\n if (byteAlignment) {\n accumulatedShift = byteAlignment.width;\n }\n\n const ac4TocEnd = parsedElements.find((element) => element.name === tocElements.AC4_TOC_END);\n\n // filter the table to produce a list of preselections complete with ID, a list of b_presentation_ids and a list of presentation_ids\n const presentationOffsets = [];\n const bPresentationIds = [];\n\n parsedElements.forEach((element) => {\n switch (element.name) {\n case tocElements.PRESENTATION_LEVEL: {\n presentationOffsets.push({ pos: element.pos, value: element.value, width: element.width });\n break;\n }\n case tocElements.PRESENTATION_ID: {\n const lastPresentationOffset = presentationOffsets[presentationOffsets.length - 1];\n\n // modify last seen presentation. If there was none, this is an error:\n // a presentation_id would always follow, never preceed, the level\n if (presentationOffsets.length === 0) {\n console.error(\"Encountered a presentationID without a presentation\");\n }\n if (element.handler === \"before_call\") {\n lastPresentationOffset.presentationIdPos = element.pos;\n }\n if (element.handler === \"after_call\") {\n lastPresentationOffset.presentationId = element.value;\n const width = element.pos - lastPresentationOffset.presentationIdPos;\n lastPresentationOffset.presentationIdWidth = width;\n accumulatedShift += width;\n }\n break;\n }\n case tocElements.B_PRESENTATION_ID: {\n bPresentationIds.push(element);\n break;\n }\n case tocElements.PAYLOAD_BASE_MINUS1:\n case tocElements.BYTE_ALIGNMENT:\n case tocElements.AC4_TOC_END: {\n break;\n }\n default: {\n console.error(`Unknown TOC parsed element: ${element.name}`);\n }\n }\n });\n\n // if there are less than 2 presentations in TOC - return unmodified buffer\n if (presentationOffsets.length < MINIMUM_PRESENTATIONS_AMOUNT) {\n console.log(\"ALPS::processIsobmffSegment - less then 2 presentations found\");\n return null;\n }\n\n // check that all presentations carry an ID\n if (presentationOffsets.some((presentation) => presentation.presentationId === undefined)) {\n console.error(\"Not every presentation carries an ID\");\n return null;\n }\n\n if (presentationOffsets.every((offset) => offset.presentationId !== activePresentationId)) {\n console.log(\"ALPS::processIsobmffSegment - activePresentationId not found in TOC\");\n return null;\n }\n\n // set presentation level to 7 for inactive presentations\n presentationOffsets.forEach((presentation) => {\n const presentationId = presentation.presentationId;\n\n if (presentation.width !== PRESENTATION_LEVEL_WIDTH) {\n console.warn(`Presentation level has unexpected width: ${presentation.width}`);\n }\n\n // in all presentations except the selected one, overwrite presentation level with \"7\"\n if (activePresentationId !== presentationId) {\n // updating inactive presentation with undecodable presentation level\n setBits(sampleData, presentation.pos, presentation.width, UNDECODABLE_PRESENTATION_LEVEL);\n }\n });\n\n // add available bytes to payload_base_minus1 (>>> is more efficient than Math.floor)\n const availableAdditionalBytes = accumulatedShift >>> BITS_TO_SHIFT_TO_DIVIDE_BY_8;\n\n // update payloadbase_minus_1\n setBits(\n sampleData,\n payloadBaseMinus1.pos,\n payloadBaseMinus1.width,\n payloadBaseMinus1.value + availableAdditionalBytes,\n );\n\n // set all b_presentation_id fields to 0\n bPresentationIds.forEach((bPresentationId) => {\n setBits(sampleData, bPresentationId.pos, bPresentationId.width, 0);\n });\n\n // bit shifting\n presentationOffsets\n .slice()\n .reverse()\n .forEach((presentation) => {\n const shiftWidth = ac4TocEnd.pos - presentation.presentationIdPos;\n shiftLeft(sampleData, presentation.presentationIdPos, shiftWidth, presentation.presentationIdWidth);\n });\n }\n\n console.log(\"ALPS::processIsoBmffSegment - done\");\n\n return activePresentationId;\n};\n\nexport { processIsoBmffInitSegment, processIsoBmffMediaSegment };\n", "/************************************************************************************************************\n * Copyright (C) 2023-2025 by Dolby International AB.\n * All rights reserved.\n\n * Redistribution and use in source and binary forms, with or without modification, are permitted\n * provided that the following conditions are met:\n\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions\n * and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions\n * and the following disclaimer in the documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or\n * promote products derived from this software without specific prior written permission.\n\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n ************************************************************************************************************/\n\n/*global console*/\n\n/**\n * @module\n * @desc The main entry point for the ALPS library. This file exports the `Alps` class, which provides the core functionality of the library.\n */\n\nimport * as isoBmffBox from \"./constants/isobmff_box_names.js\";\n\nimport { processIsoBmffInitSegment, processIsoBmffMediaSegment } from \"./alps_core.js\";\n\nimport ISOBoxer from \"codem-isoboxer\";\n\nconst SEGMENT_TYPES = {\n INIT: \"init\",\n MEDIA: \"media\",\n};\n\n/* eslint-disable */\nISOBoxer.addBoxProcessor(\"diap\", function () {\n this._procFullBox();\n this._procField(\"dialog_gain\", \"int\", 16);\n});\n/* eslint-enable */\n\n/**\n * This callback is called when list of presentations changes, e.g. new init segment is processed for multi-period DASH contents.\n * @callback presentationsChangedCallback\n * @param {PresentationsChangedEvent} event\n */\n\n/**\n * Event data for presentationsChangedCallback\n * @typedef {Object} PresentationsChangedEvent\n * @property {string|null} streamId - ID of the stream for which the presentations were parsed\n */\n\n/**\n * ALPS Data for stream\n * @typedef {Object} Stream\n * @property {import('./types.js').Presentation[]} presentations - presentation related to the stream\n * @property {number|undefined} activePresentationId - current active presentation ID for the stream\n */\n\n/**\n * Buffer processing result for init segment.\n * @typedef {Object} ProcessIsoBmffInitSegmentResult\n * @property {\"init\"} segmentType - \"init\" indicating that segment is an init segment\n * @property {import('./types.js').Presentation[]} presentations - list of presentations read from ISOBMFF init segment\n * @property {null} forcedPresentationId - always null for init segments\n */\n\n/**\n * Buffer processing result for media segment.\n * @typedef {Object} ProcessIsoBmffMediaSegmentResult\n * @property {\"media\"} segmentType - \"media\" indicating that segment is a media segment\n * @property {null} presentations - null for media segments\n * @property {number|null} forcedPresentationId - ID of presentation selected in bitstream, null when no presentation was selected\n */\n\n/**\n * Buffer processing result for unknown segment.\n * @typedef {Object} ProcessIsoBmffUnknownSegmentResult\n * @property {null} segmentType - null indicating that segment type is unknown\n * @property {null} presentations - null for unknown segments\n * @property {null} forcedPresentationId - null for unknown segments\n */\n\n/**\n * Buffer processing result.\n * @typedef {ProcessIsoBmffInitSegmentResult|ProcessIsoBmffMediaSegmentResult|ProcessIsoBmffUnknownSegmentResult} ProcessIsoBmffSegmentResult\n */\n\n// Export shared types\nexport * from \"./types.js\";\n\n/**\n * Provides the core functionality of the library. It allows to process ISOBMFF segments and manage presentations.\n */\nexport class Alps {\n /** @type {Record<string,Stream>} */\n #streams = {};\n /** @type {presentationsChangedCallback|undefined} */\n #presentationsChangedEventHandler;\n\n #initializeStream(streamId) {\n if (this.#streams[streamId] === undefined) {\n this.#streams[streamId] = { activePresentationId: -1, presentations: [] };\n }\n }\n\n /**\n * Create the ALPS object\n */\n constructor() {\n console.log(\"ALPS::constructor\");\n }\n\n /**\n * Get presentation and activePresentationId for all streams\n * @returns {Record<string,Stream>} Data for all streams present in current ALPS state\n */\n getStreams() {\n return this.#streams;\n }\n\n /**\n * Clear data for unused stream\n * @param {string|null} streamId Stream ID which should be deleted, null for non-multi-period use\n */\n clearStream(streamId = null) {\n delete this.#streams[streamId];\n }\n\n /**\n * Set presentationsChangedEventHandler\n * @param {presentationsChangedCallback} presentationsChangedEventHandler Callback function that will be called if the list of presentations changes\n */\n setPresentationsChangedEventHandler(presentationsChangedEventHandler) {\n console.log(\"ALPS::setPresentationsChangedEventHandler\");\n this.#presentationsChangedEventHandler = presentationsChangedEventHandler;\n }\n\n /**\n * Get the list of available presentations\n * @param {string|null} streamId The ID of the stream, null for non-multi-period use\n * @returns {import('./types.js').Presentation[]} An array of presentation objects\n */\n getPresentations(streamId = null) {\n this.#initializeStream(streamId);\n console.log(\n `ALPS::getPresentations - List of presentations: ${JSON.stringify(this.#streams[streamId].presentations)}`,\n );\n return this.#streams[streamId].presentations;\n }\n\n /**\n * Get the ID of the currently active presentation\n * @param {string|null} streamId The ID of the stream, null for non-multi-period use\n * @returns {number|undefined} The ID of the active presentation, -1 if no presentation is set, undefined if no stream data exists\n */\n getActivePresentationId(streamId = null) {\n console.log(`ALPS::getActivePresentation - activePresentation: ${this.#streams[streamId]?.activePresentationId}`);\n return this.#streams[streamId]?.activePresentationId;\n }\n\n /**\n * Set the ID of the active presentation\n * @param {number|undefined} presentationId - The ID of the presentation to set as active, -1 to select the default presentation or undefined to clear any active presentation\n * @param {string|null} streamId The ID of the stream, null for non-multi-period use\n */\n setActivePresentationId(presentationId, streamId = null) {\n console.log(`ALPS::setActivePresentation - new activePresentation: ${presentationId}`);\n this.#initializeStream(streamId);\n this.#streams[streamId].activePresentationId = presentationId;\n }\n\n /**\n * Process an ISOBMFF segment buffer\n * @param {ArrayBuffer} segmentBuffer - The ISOBMFF segment buffer to process\n * @param {string|null} streamId - Stream ID for Segment buffer, null for non-multi-period use\n * @param {number|undefined} activePresentationId - Forced presentation ID that should be selected for processing, use -1 for TV default, and leave undefined to use value set by setActivePresentationId. This parameter takes precedence over this.activePresentationId\n * @returns {ProcessIsoBmffSegmentResult} Data retrieved from processed segment\n */\n processIsoBmffSegment(segmentBuffer, streamId = null, activePresentationId = undefined) {\n // parse the segment that was just handed in\n console.log(\"ALPS::processIsoBmffSegment\");\n\n let forcedPresentationId = null;\n let presentations = null;\n let segmentType = null;\n\n const parsedSegmentBuffer = ISOBoxer.parseBuffer(segmentBuffer);\n\n const movie = parsedSegmentBuffer.fetch(isoBmffBox.MOVIE);\n const meta = parsedSegmentBuffer.fetch(isoBmffBox.META);\n const movieFragment = parsedSegmentBuffer.fetch(isoBmffBox.MOVIE_FRAGMENT);\n\n this.#initializeStream(streamId);\n const stream = this.#streams[streamId];\n\n // if this is the init segment - parse presentations\n if (movie && meta) {\n presentations = processIsoBmffInitSegment(parsedSegmentBuffer);\n stream.presentations = presentations;\n\n if (this.#presentationsChangedEventHandler) {\n this.#presentationsChangedEventHandler({ streamId });\n }\n segmentType = SEGMENT_TYPES.INIT;\n }\n\n if (movieFragment) {\n forcedPresentationId = processIsoBmffMediaSegment(\n parsedSegmentBuffer,\n activePresentationId ?? stream.activePresentationId,\n );\n segmentType = SEGMENT_TYPES.MEDIA;\n }\n console.log(\"ALPS::processIsoBmffSegment - done\");\n return {\n forcedPresentationId,\n presentations,\n segmentType,\n };\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;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BAAc,cAAc;AAAA,IAC9B;AAEA,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;AA7HE;AAEA;AAJK;AAML,sBAAiB,SAAC,UAAU;AAC1B,MAAI,mBAAK,UAAS,QAAQ,MAAM,QAAW;AACzC,uBAAK,UAAS,QAAQ,IAAI,EAAE,sBAAsB,IAAI,eAAe,CAAC,EAAE;AAAA,EAC1E;AACF;",
|
|
4
|
+
"sourcesContent": ["/*! codem-isoboxer v0.3.10 https://github.com/madebyhiro/codem-isoboxer/blob/master/LICENSE.txt */\nvar ISOBoxer = {};\n\nISOBoxer.parseBuffer = function(arrayBuffer) {\n return new ISOFile(arrayBuffer).parse();\n};\n\nISOBoxer.addBoxProcessor = function(type, parser) {\n if (typeof type !== 'string' || typeof parser !== 'function') {\n return;\n }\n ISOBox.prototype._boxProcessors[type] = parser;\n};\n\nISOBoxer.createFile = function() {\n return new ISOFile();\n};\n\n// See ISOBoxer.append() for 'pos' parameter syntax\nISOBoxer.createBox = function(type, parent, pos) {\n var newBox = ISOBox.create(type);\n if (parent) {\n parent.append(newBox, pos);\n }\n return newBox;\n};\n\n// See ISOBoxer.append() for 'pos' parameter syntax\nISOBoxer.createFullBox = function(type, parent, pos) {\n var newBox = ISOBoxer.createBox(type, parent, pos);\n newBox.version = 0;\n newBox.flags = 0;\n return newBox;\n};\n\nISOBoxer.Utils = {};\nISOBoxer.Utils.dataViewToString = function(dataView, encoding) {\n var impliedEncoding = encoding || 'utf-8';\n if (typeof TextDecoder !== 'undefined') {\n return new TextDecoder(impliedEncoding).decode(dataView);\n }\n var a = [];\n var i = 0;\n\n if (impliedEncoding === 'utf-8') {\n /* The following algorithm is essentially a rewrite of the UTF8.decode at\n http://bannister.us/weblog/2007/simple-base64-encodedecode-javascript/\n */\n\n while (i < dataView.byteLength) {\n var c = dataView.getUint8(i++);\n if (c < 0x80) {\n // 1-byte character (7 bits)\n } else if (c < 0xe0) {\n // 2-byte character (11 bits)\n c = (c & 0x1f) << 6;\n c |= (dataView.getUint8(i++) & 0x3f);\n } else if (c < 0xf0) {\n // 3-byte character (16 bits)\n c = (c & 0xf) << 12;\n c |= (dataView.getUint8(i++) & 0x3f) << 6;\n c |= (dataView.getUint8(i++) & 0x3f);\n } else {\n // 4-byte character (21 bits)\n c = (c & 0x7) << 18;\n c |= (dataView.getUint8(i++) & 0x3f) << 12;\n c |= (dataView.getUint8(i++) & 0x3f) << 6;\n c |= (dataView.getUint8(i++) & 0x3f);\n }\n a.push(String.fromCharCode(c));\n }\n } else { // Just map byte-by-byte (probably wrong)\n while (i < dataView.byteLength) {\n a.push(String.fromCharCode(dataView.getUint8(i++)));\n }\n }\n return a.join('');\n};\n\nISOBoxer.Utils.utf8ToByteArray = function(string) {\n // Only UTF-8 encoding is supported by TextEncoder\n var u, i;\n if (typeof TextEncoder !== 'undefined') {\n u = new TextEncoder().encode(string);\n } else {\n u = [];\n for (i = 0; i < string.length; ++i) {\n var c = string.charCodeAt(i);\n if (c < 0x80) {\n u.push(c);\n } else if (c < 0x800) {\n u.push(0xC0 | (c >> 6));\n u.push(0x80 | (63 & c));\n } else if (c < 0x10000) {\n u.push(0xE0 | (c >> 12));\n u.push(0x80 | (63 & (c >> 6)));\n u.push(0x80 | (63 & c));\n } else {\n u.push(0xF0 | (c >> 18));\n u.push(0x80 | (63 & (c >> 12)));\n u.push(0x80 | (63 & (c >> 6)));\n u.push(0x80 | (63 & c));\n }\n }\n }\n return u;\n};\n\n// Method to append a box in the list of child boxes\n// The 'pos' parameter can be either:\n// - (number) a position index at which to insert the new box\n// - (string) the type of the box after which to insert the new box\n// - (object) the box after which to insert the new box\nISOBoxer.Utils.appendBox = function(parent, box, pos) {\n box._offset = parent._cursor.offset;\n box._root = (parent._root ? parent._root : parent);\n box._raw = parent._raw;\n box._parent = parent;\n\n if (pos === -1) {\n // The new box is a sub-box of the parent but not added in boxes array,\n // for example when the new box is set as an entry (see dref and stsd for example)\n return;\n }\n\n if (pos === undefined || pos === null) {\n parent.boxes.push(box);\n return;\n }\n\n var index = -1,\n type;\n\n if (typeof pos === \"number\") {\n index = pos;\n } else {\n if (typeof pos === \"string\") {\n type = pos;\n } else if (typeof pos === \"object\" && pos.type) {\n type = pos.type;\n } else {\n parent.boxes.push(box);\n return;\n }\n\n for (var i = 0; i < parent.boxes.length; i++) {\n if (type === parent.boxes[i].type) {\n index = i + 1;\n break;\n }\n }\n }\n parent.boxes.splice(index, 0, box);\n};\n\nif (typeof exports !== 'undefined') {\n exports.parseBuffer = ISOBoxer.parseBuffer;\n exports.addBoxProcessor = ISOBoxer.addBoxProcessor;\n exports.createFile = ISOBoxer.createFile;\n exports.createBox = ISOBoxer.createBox;\n exports.createFullBox = ISOBoxer.createFullBox;\n exports.Utils = ISOBoxer.Utils;\n}\n\nISOBoxer.Cursor = function(initialOffset) {\n this.offset = (typeof initialOffset == 'undefined' ? 0 : initialOffset);\n};\n\nvar ISOFile = function(arrayBuffer) {\n this._cursor = new ISOBoxer.Cursor();\n this.boxes = [];\n if (arrayBuffer) {\n this._raw = new DataView(arrayBuffer);\n }\n};\n\nISOFile.prototype.fetch = function(type) {\n var result = this.fetchAll(type, true);\n return (result.length ? result[0] : null);\n};\n\nISOFile.prototype.fetchAll = function(type, returnEarly) {\n var result = [];\n ISOFile._sweep.call(this, type, result, returnEarly);\n return result;\n};\n\nISOFile.prototype.parse = function() {\n this._cursor.offset = 0;\n this.boxes = [];\n while (this._cursor.offset < this._raw.byteLength) {\n var box = ISOBox.parse(this);\n\n // Box could not be parsed\n if (typeof box.type === 'undefined') break;\n\n this.boxes.push(box);\n }\n return this;\n};\n\nISOFile._sweep = function(type, result, returnEarly) {\n if (this.type && this.type == type) result.push(this);\n for (var box in this.boxes) {\n if (result.length && returnEarly) return;\n ISOFile._sweep.call(this.boxes[box], type, result, returnEarly);\n }\n};\n\nISOFile.prototype.write = function() {\n\n var length = 0,\n i;\n\n for (i = 0; i < this.boxes.length; i++) {\n length += this.boxes[i].getLength(false);\n }\n\n var bytes = new Uint8Array(length);\n this._rawo = new DataView(bytes.buffer);\n this.bytes = bytes;\n this._cursor.offset = 0;\n\n for (i = 0; i < this.boxes.length; i++) {\n this.boxes[i].write();\n }\n\n return bytes.buffer;\n};\n\nISOFile.prototype.append = function(box, pos) {\n ISOBoxer.Utils.appendBox(this, box, pos);\n};\nvar ISOBox = function() {\n this._cursor = new ISOBoxer.Cursor();\n};\n\nISOBox.parse = function(parent) {\n var newBox = new ISOBox();\n newBox._offset = parent._cursor.offset;\n newBox._root = (parent._root ? parent._root : parent);\n newBox._raw = parent._raw;\n newBox._parent = parent;\n newBox._parseBox();\n parent._cursor.offset = newBox._raw.byteOffset + newBox._raw.byteLength;\n return newBox;\n};\n\nISOBox.create = function(type) {\n var newBox = new ISOBox();\n newBox.type = type;\n newBox.boxes = [];\n return newBox;\n};\n\nISOBox.prototype._boxContainers = ['dinf', 'edts', 'mdia', 'meco', 'mfra', 'minf', 'moof', 'moov', 'mvex', 'stbl', 'strk', 'traf', 'trak', 'tref', 'udta', 'vttc', 'sinf', 'schi', 'encv', 'enca','meta','grpl','prsl'];\n\nISOBox.prototype._boxProcessors = {};\n\n///////////////////////////////////////////////////////////////////////////////////////////////////\n// Generic read/write functions\n\nISOBox.prototype._procField = function (name, type, size) {\n if (this._parsing) {\n this[name] = this._readField(type, size);\n }\n else {\n this._writeField(type, size, this[name]);\n }\n};\n\nISOBox.prototype._procFieldArray = function (name, length, type, size) {\n var i;\n if (this._parsing) {\n this[name] = [];\n for (i = 0; i < length; i++) {\n this[name][i] = this._readField(type, size);\n }\n }\n else {\n for (i = 0; i < this[name].length; i++) {\n this._writeField(type, size, this[name][i]);\n }\n }\n};\n\nISOBox.prototype._procFullBox = function() {\n this._procField('version', 'uint', 8);\n this._procField('flags', 'uint', 24);\n};\n\nISOBox.prototype._procEntries = function(name, length, fn) {\n var i;\n if (this._parsing) {\n this[name] = [];\n for (i = 0; i < length; i++) {\n this[name].push({});\n fn.call(this, this[name][i]);\n }\n }\n else {\n for (i = 0; i < length; i++) {\n fn.call(this, this[name][i]);\n }\n }\n};\n\nISOBox.prototype._procSubEntries = function(entry, name, length, fn) {\n var i;\n if (this._parsing) {\n entry[name] = [];\n for (i = 0; i < length; i++) {\n entry[name].push({});\n fn.call(this, entry[name][i]);\n }\n }\n else {\n for (i = 0; i < length; i++) {\n fn.call(this, entry[name][i]);\n }\n }\n};\n\nISOBox.prototype._procEntryField = function (entry, name, type, size) {\n if (this._parsing) {\n entry[name] = this._readField(type, size);\n }\n else {\n this._writeField(type, size, entry[name]);\n }\n};\n\nISOBox.prototype._procSubBoxes = function(name, length) {\n var i;\n if (this._parsing) {\n this[name] = [];\n for (i = 0; i < length; i++) {\n this[name].push(ISOBox.parse(this));\n }\n }\n else {\n for (i = 0; i < length; i++) {\n if (this._rawo) {\n this[name][i].write();\n } else {\n this.size += this[name][i].getLength();\n }\n }\n }\n};\n\n///////////////////////////////////////////////////////////////////////////////////////////////////\n// Read/parse functions\n\nISOBox.prototype._readField = function(type, size) {\n switch (type) {\n case 'uint':\n return this._readUint(size);\n case 'int':\n return this._readInt(size);\n case 'template':\n return this._readTemplate(size);\n case 'string':\n return (size === -1) ? this._readTerminatedString() : this._readString(size);\n case 'data':\n return this._readData(size);\n case 'utf8':\n return this._readUTF8String();\n case 'utf8string':\n return this._readUTF8TerminatedString();\n default:\n return -1;\n }\n};\n\nISOBox.prototype._readInt = function(size) {\n var result = null,\n offset = this._cursor.offset - this._raw.byteOffset;\n switch(size) {\n case 8:\n result = this._raw.getInt8(offset);\n break;\n case 16:\n result = this._raw.getInt16(offset);\n break;\n case 32:\n result = this._raw.getInt32(offset);\n break;\n case 64:\n // Warning: JavaScript cannot handle 64-bit integers natively.\n // This will give unexpected results for integers >= 2^53\n var s1 = this._raw.getInt32(offset);\n var s2 = this._raw.getInt32(offset + 4);\n result = (s1 * Math.pow(2,32)) + s2;\n break;\n }\n this._cursor.offset += (size >> 3);\n return result;\n};\n\nISOBox.prototype._readUint = function(size) {\n var result = null,\n offset = this._cursor.offset - this._raw.byteOffset,\n s1, s2;\n switch(size) {\n case 8:\n result = this._raw.getUint8(offset);\n break;\n case 16:\n result = this._raw.getUint16(offset);\n break;\n case 24:\n s1 = this._raw.getUint16(offset);\n s2 = this._raw.getUint8(offset + 2);\n result = (s1 << 8) + s2;\n break;\n case 32:\n result = this._raw.getUint32(offset);\n break;\n case 64:\n // Warning: JavaScript cannot handle 64-bit integers natively.\n // This will give unexpected results for integers >= 2^53\n s1 = this._raw.getUint32(offset);\n s2 = this._raw.getUint32(offset + 4);\n result = (s1 * Math.pow(2,32)) + s2;\n break;\n }\n this._cursor.offset += (size >> 3);\n return result;\n};\n\nISOBox.prototype._readString = function(length) {\n var str = '';\n for (var c = 0; c < length; c++) {\n var char = this._readUint(8);\n str += String.fromCharCode(char);\n }\n return str;\n};\n\nISOBox.prototype._readTemplate = function(size) {\n var pre = this._readUint(size / 2);\n var post = this._readUint(size / 2);\n return pre + (post / Math.pow(2, size / 2));\n};\n\nISOBox.prototype._readTerminatedString = function() {\n var str = '';\n while (this._cursor.offset - this._offset < this._raw.byteLength) {\n var char = this._readUint(8);\n if (char === 0) break;\n str += String.fromCharCode(char);\n }\n return str;\n};\n\nISOBox.prototype._readData = function(size) {\n var length = (size > 0) ? size : (this._raw.byteLength - (this._cursor.offset - this._offset));\n if (length > 0) {\n var data = new Uint8Array(this._raw.buffer, this._cursor.offset, length);\n\n this._cursor.offset += length;\n return data;\n }\n else {\n return null;\n }\n};\n\nISOBox.prototype._readUTF8String = function() {\n var length = this._raw.byteLength - (this._cursor.offset - this._offset);\n var data = null;\n if (length > 0) {\n data = new DataView(this._raw.buffer, this._cursor.offset, length);\n this._cursor.offset += length;\n }\n \n return data ? ISOBoxer.Utils.dataViewToString(data) : data;\n};\n\nISOBox.prototype._readUTF8TerminatedString = function() {\n var length = this._raw.byteLength - (this._cursor.offset - this._offset);\n var data = null;\n if (length > 0) {\n data = new DataView(this._raw.buffer, this._cursor.offset, length);\n\n var l;\n for (l=0; l<length; l++)\n if (data.getUint8(l) === 0)\n break;\n\n // remap the Dataview with the actual length\n data = new DataView(this._raw.buffer, this._cursor.offset, l);\n this._cursor.offset += Math.min(l+1, length);\n }\n\n return data ? ISOBoxer.Utils.dataViewToString(data) : data;\n};\n\nISOBox.prototype._parseBox = function() {\n this._parsing = true;\n this._cursor.offset = this._offset;\n\n // return immediately if there are not enough bytes to read the header\n if (this._offset + 8 > this._raw.buffer.byteLength) {\n this._root._incomplete = true;\n return;\n }\n\n this._procField('size', 'uint', 32);\n this._procField('type', 'string', 4);\n\n if (this.size === 1) { this._procField('largesize', 'uint', 64); }\n if (this.type === 'uuid') { this._procFieldArray('usertype', 16, 'uint', 8); }\n\n switch(this.size) {\n case 0:\n // Size zero indicates last box in the file. Consume remaining buffer.\n this._raw = new DataView(this._raw.buffer, this._offset);\n break;\n case 1:\n if (this._offset + this.size > this._raw.buffer.byteLength) {\n this._incomplete = true;\n this._root._incomplete = true;\n } else {\n this._raw = new DataView(this._raw.buffer, this._offset, this.largesize);\n }\n break;\n default:\n if (this._offset + this.size > this._raw.buffer.byteLength) {\n this._incomplete = true;\n this._root._incomplete = true;\n } else {\n this._raw = new DataView(this._raw.buffer, this._offset, this.size);\n }\n }\n\n // additional parsing\n if (!this._incomplete) {\n if (this._boxProcessors[this.type]) {\n this._boxProcessors[this.type].call(this);\n }\n if (this._boxContainers.indexOf(this.type) !== -1) {\n this._parseContainerBox();\n } else{\n // Unknown box => read and store box content\n this._data = this._readData();\n }\n }\n};\n\nISOBox.prototype._parseFullBox = function() {\n this.version = this._readUint(8);\n this.flags = this._readUint(24);\n};\n\nISOBox.prototype._parseContainerBox = function() {\n this.boxes = [];\n while (this._cursor.offset - this._raw.byteOffset < this._raw.byteLength) {\n this.boxes.push(ISOBox.parse(this));\n }\n};\n\n///////////////////////////////////////////////////////////////////////////////////////////////////\n// Write functions\n\nISOBox.prototype.append = function(box, pos) {\n ISOBoxer.Utils.appendBox(this, box, pos);\n};\n\nISOBox.prototype.getLength = function() {\n this._parsing = false;\n this._rawo = null;\n\n this.size = 0;\n this._procField('size', 'uint', 32);\n this._procField('type', 'string', 4);\n\n if (this.size === 1) { this._procField('largesize', 'uint', 64); }\n if (this.type === 'uuid') { this._procFieldArray('usertype', 16, 'uint', 8); }\n\n if (this._boxProcessors[this.type]) {\n this._boxProcessors[this.type].call(this);\n }\n\n if (this._boxContainers.indexOf(this.type) !== -1) {\n for (var i = 0; i < this.boxes.length; i++) {\n this.size += this.boxes[i].getLength();\n }\n } \n\n if (this._data) {\n this._writeData(this._data);\n }\n\n return this.size;\n};\n\nISOBox.prototype.write = function() {\n this._parsing = false;\n this._cursor.offset = this._parent._cursor.offset;\n\n switch(this.size) {\n case 0:\n this._rawo = new DataView(this._parent._rawo.buffer, this._cursor.offset, (this.parent._rawo.byteLength - this._cursor.offset));\n break;\n case 1:\n this._rawo = new DataView(this._parent._rawo.buffer, this._cursor.offset, this.largesize);\n break;\n default:\n this._rawo = new DataView(this._parent._rawo.buffer, this._cursor.offset, this.size);\n }\n\n this._procField('size', 'uint', 32);\n this._procField('type', 'string', 4);\n\n if (this.size === 1) { this._procField('largesize', 'uint', 64); }\n if (this.type === 'uuid') { this._procFieldArray('usertype', 16, 'uint', 8); }\n\n if (this._boxProcessors[this.type]) {\n this._boxProcessors[this.type].call(this);\n }\n\n if (this._boxContainers.indexOf(this.type) !== -1) {\n for (var i = 0; i < this.boxes.length; i++) {\n this.boxes[i].write();\n }\n } \n\n if (this._data) {\n this._writeData(this._data);\n }\n\n this._parent._cursor.offset += this.size;\n\n return this.size;\n};\n\nISOBox.prototype._writeInt = function(size, value) {\n if (this._rawo) {\n var offset = this._cursor.offset - this._rawo.byteOffset;\n switch(size) {\n case 8:\n this._rawo.setInt8(offset, value);\n break;\n case 16:\n this._rawo.setInt16(offset, value);\n break;\n case 32:\n this._rawo.setInt32(offset, value);\n break;\n case 64:\n // Warning: JavaScript cannot handle 64-bit integers natively.\n // This will give unexpected results for integers >= 2^53\n var s1 = Math.floor(value / Math.pow(2,32));\n var s2 = value - (s1 * Math.pow(2,32));\n this._rawo.setUint32(offset, s1);\n this._rawo.setUint32(offset + 4, s2);\n break;\n }\n this._cursor.offset += (size >> 3);\n } else {\n this.size += (size >> 3);\n }\n};\n\nISOBox.prototype._writeUint = function(size, value) {\n\n if (this._rawo) {\n var offset = this._cursor.offset - this._rawo.byteOffset,\n s1, s2;\n switch(size) {\n case 8:\n this._rawo.setUint8(offset, value);\n break;\n case 16:\n this._rawo.setUint16(offset, value);\n break;\n case 24:\n s1 = (value & 0xFFFF00) >> 8;\n s2 = (value & 0x0000FF);\n this._rawo.setUint16(offset, s1);\n this._rawo.setUint8(offset + 2, s2);\n break;\n case 32:\n this._rawo.setUint32(offset, value);\n break;\n case 64:\n // Warning: JavaScript cannot handle 64-bit integers natively.\n // This will give unexpected results for integers >= 2^53\n s1 = Math.floor(value / Math.pow(2,32));\n s2 = value - (s1 * Math.pow(2,32));\n this._rawo.setUint32(offset, s1);\n this._rawo.setUint32(offset + 4, s2);\n break;\n }\n this._cursor.offset += (size >> 3);\n } else {\n this.size += (size >> 3);\n }\n};\n\nISOBox.prototype._writeString = function(size, str) {\n for (var c = 0; c < size; c++) {\n this._writeUint(8, str.charCodeAt(c));\n }\n};\n\nISOBox.prototype._writeTerminatedString = function(str) {\n if (str.length === 0) {\n return;\n }\n for (var c = 0; c < str.length; c++) {\n this._writeUint(8, str.charCodeAt(c));\n }\n this._writeUint(8, 0);\n};\n\nISOBox.prototype._writeTemplate = function(size, value) {\n var pre = Math.floor(value);\n var post = (value - pre) * Math.pow(2, size / 2);\n this._writeUint(size / 2, pre);\n this._writeUint(size / 2, post);\n};\n\nISOBox.prototype._writeData = function(data) {\n var i;\n //data to copy\n if (data) {\n if (this._rawo) {\n //Array and Uint8Array has also to be managed\n if (data instanceof Array) {\n var offset = this._cursor.offset - this._rawo.byteOffset;\n for (var i = 0; i < data.length; i++) {\n this._rawo.setInt8(offset + i, data[i]);\n }\n this._cursor.offset += data.length;\n } \n\n if (data instanceof Uint8Array) {\n this._root.bytes.set(data, this._cursor.offset);\n this._cursor.offset += data.length;\n }\n\n } else {\n //nothing to copy only size to compute\n this.size += data.length;\n }\n }\n};\n\nISOBox.prototype._writeUTF8String = function(string) {\n var u = ISOBoxer.Utils.utf8ToByteArray(string);\n if (this._rawo) {\n var dataView = new DataView(this._rawo.buffer, this._cursor.offset, u.length);\n for (var i = 0; i < u.length; i++) {\n dataView.setUint8(i, u[i]);\n }\n } else {\n this.size += u.length;\n }\n};\n\nISOBox.prototype._writeField = function(type, size, value) {\n switch (type) {\n case 'uint':\n this._writeUint(size, value);\n break;\n case 'int':\n this._writeInt(size, value);\n break;\n case 'template':\n this._writeTemplate(size, value);\n break;\n case 'string':\n if (size == -1) {\n this._writeTerminatedString(value);\n } else {\n this._writeString(size, value);\n }\n break;\n case 'data':\n this._writeData(value);\n break;\n case 'utf8':\n this._writeUTF8String(value);\n break;\n default:\n break;\n }\n};\n\n// ISO/IEC 14496-12:202x - 12.2.8 Audio rendering indication box\nISOBox.prototype._boxProcessors['ardi'] = function() {\n this._procFullBox();\n this._procField('audio_rendering_indication', 'uint', 8);\n};\n\n// ISO/IEC 14496-15:2014 - avc1/2/3/4, hev1, hvc1, encv\nISOBox.prototype._boxProcessors['avc1'] =\nISOBox.prototype._boxProcessors['avc2'] =\nISOBox.prototype._boxProcessors['avc3'] =\nISOBox.prototype._boxProcessors['avc4'] =\nISOBox.prototype._boxProcessors['hvc1'] =\nISOBox.prototype._boxProcessors['hev1'] =\nISOBox.prototype._boxProcessors['encv'] = function() {\n // SampleEntry fields\n this._procFieldArray('reserved1', 6, 'uint', 8);\n this._procField('data_reference_index', 'uint', 16);\n // VisualSampleEntry fields\n this._procField('pre_defined1', 'uint', 16);\n this._procField('reserved2', 'uint', 16);\n this._procFieldArray('pre_defined2', 3, 'uint', 32);\n this._procField('width', 'uint', 16);\n this._procField('height', 'uint', 16);\n this._procField('horizresolution', 'template', 32);\n this._procField('vertresolution', 'template', 32);\n this._procField('reserved3', 'uint', 32);\n this._procField('frame_count', 'uint', 16);\n this._procFieldArray('compressorname', 32,'uint', 8);\n this._procField('depth', 'uint', 16);\n this._procField('pre_defined3', 'int', 16);\n // Codec-specific fields\n this._procField('config', 'data', -1);\n};\n\n// ISO/IEC 14496-12:2012 - 8.6.1.3 Composition Time To Sample Box\nISOBox.prototype._boxProcessors['ctts'] = function() {\n this._procFullBox();\n this._procField('entry_count', 'uint', 32);\n this._procEntries('entries', this.entry_count, function(entry) {\n this._procEntryField(entry, 'sample_count', 'uint', 32);\n this._procEntryField(entry, 'sample_offset', (this.version === 1) ? 'int' : 'uint', 32);\n });\n};\n\n// ISO/IEC 14496-12:2012 - 8.7.2 Data Reference Box\nISOBox.prototype._boxProcessors['dref'] = function() {\n this._procFullBox();\n this._procField('entry_count', 'uint', 32);\n this._procSubBoxes('entries', this.entry_count);\n};\n\n// ISO/IEC 14496-12:202x - 8.4.6 Extended language tag\nISOBox.prototype._boxProcessors['elng'] = function() {\n this._procFullBox();\n this._procField('extended_language', 'utf8string');\n};\n\n// ISO/IEC 14496-12:2012 - 8.6.6 Edit List Box\nISOBox.prototype._boxProcessors['elst'] = function() {\n this._procFullBox();\n this._procField('entry_count', 'uint', 32);\n this._procEntries('entries', this.entry_count, function(entry) {\n this._procEntryField(entry, 'segment_duration', 'uint', (this.version === 1) ? 64 : 32);\n this._procEntryField(entry, 'media_time', 'int', (this.version === 1) ? 64 : 32);\n this._procEntryField(entry, 'media_rate_integer', 'int', 16);\n this._procEntryField(entry, 'media_rate_fraction', 'int', 16);\n });\n};\n\n// ISO/IEC 23009-1:2014 - 5.10.3.3 Event Message Box\nISOBox.prototype._boxProcessors['emsg'] = function() {\n this._procFullBox();\n if (this.version == 1) {\n this._procField('timescale', 'uint', 32);\n this._procField('presentation_time', 'uint', 64);\n this._procField('event_duration', 'uint', 32);\n this._procField('id', 'uint', 32);\n this._procField('scheme_id_uri', 'string', -1);\n this._procField('value', 'string', -1);\n } else {\n this._procField('scheme_id_uri', 'string', -1);\n this._procField('value', 'string', -1);\n this._procField('timescale', 'uint', 32);\n this._procField('presentation_time_delta', 'uint', 32);\n this._procField('event_duration', 'uint', 32);\n this._procField('id', 'uint', 32);\n }\n this._procField('message_data', 'data', -1);\n};\n// ISO/IEC 14496-12:2012 - 8.1.2 Free Space Box\nISOBox.prototype._boxProcessors['free'] = ISOBox.prototype._boxProcessors['skip'] = function() {\n this._procField('data', 'data', -1);\n};\n\n// ISO/IEC 14496-12:2012 - 8.12.2 Original Format Box\nISOBox.prototype._boxProcessors['frma'] = function() {\n this._procField('data_format', 'uint', 32);\n};\n// ISO/IEC 14496-12:2012 - 4.3 File Type Box / 8.16.2 Segment Type Box\nISOBox.prototype._boxProcessors['ftyp'] =\nISOBox.prototype._boxProcessors['styp'] = function() {\n this._procField('major_brand', 'string', 4);\n this._procField('minor_version', 'uint', 32);\n var nbCompatibleBrands = -1;\n if (this._parsing) {\n nbCompatibleBrands = (this._raw.byteLength - (this._cursor.offset - this._raw.byteOffset)) / 4;\n }\n this._procFieldArray('compatible_brands', nbCompatibleBrands, 'string', 4);\n};\n\n// ISO/IEC 14496-12:2012 - 8.4.3 Handler Reference Box\nISOBox.prototype._boxProcessors['hdlr'] = function() {\n this._procFullBox();\n this._procField('pre_defined', 'uint', 32);\n this._procField('handler_type', 'string', 4);\n this._procFieldArray('reserved', 3, 'uint', 32);\n this._procField('name', 'string', -1);\n};\n\n// ISO/IEC 14496-12:2012 - 9.1.4.1 Identified media data box\nISOBox.prototype._boxProcessors['imda'] = function() {\n this._procField('imda_identifier', 'uint', 32);\n // until the end of the box\n this._procField('data', 'data', -1);\n};\n\n// ISO/IEC 14496-12:202x - 8.10.4 Track kind box\nISOBox.prototype._boxProcessors['kind'] = function() {\n this._procFullBox();\n\n this._procField('schemeURI', 'utf8string');\n this._procField('value', 'utf8string');\n};\n\n// ISO/IEC 14496-12:202x - 8.10.5 Label box\nISOBox.prototype._boxProcessors['labl'] = function() {\n this._procFullBox();\n this.is_group_label = (this.flags & 0x1) != 0;\n this._procField('label_id', 'uint', 16);\n this._procField('language', 'utf8string');\n this._procField('label', 'utf8string');\n};\n\n// ISO/IEC 14496-12:2012 - 8.1.1 Media Data Box\nISOBox.prototype._boxProcessors['mdat'] = function() {\n this._procField('data', 'data', -1);\n};\n\n// ISO/IEC 14496-12:2012 - 8.4.2 Media Header Box\nISOBox.prototype._boxProcessors['mdhd'] = function() {\n this._procFullBox();\n this._procField('creation_time', 'uint', (this.version == 1) ? 64 : 32);\n this._procField('modification_time', 'uint', (this.version == 1) ? 64 : 32);\n this._procField('timescale', 'uint', 32);\n this._procField('duration', 'uint', (this.version == 1) ? 64 : 32);\n if (!this._parsing && typeof this.language === 'string') {\n // In case of writing and language has been set as a string, then convert it into char codes array\n this.language = ((this.language.charCodeAt(0) - 0x60) << 10) |\n ((this.language.charCodeAt(1) - 0x60) << 5) |\n ((this.language.charCodeAt(2) - 0x60));\n }\n this._procField('language', 'uint', 16);\n if (this._parsing) {\n this.language = String.fromCharCode(((this.language >> 10) & 0x1F) + 0x60,\n ((this.language >> 5) & 0x1F) + 0x60,\n (this.language & 0x1F) + 0x60);\n }\n this._procField('pre_defined', 'uint', 16);\n};\n\n// ISO/IEC 14496-12:2012 - 8.8.2 Movie Extends Header Box\nISOBox.prototype._boxProcessors['mehd'] = function() {\n this._procFullBox();\n this._procField('fragment_duration', 'uint', (this.version == 1) ? 64 : 32);\n};\n\n// ISO/IEC 14496-12:202x - 8.11.1 Meta box\nISOBox.prototype._boxProcessors['meta'] = function() {\n this._procFullBox();\n\n /* rest of the boxes will be read by _parseContainerBox */\n};\n\n// ISO/IEC 14496-12:2012 - 8.8.5 Movie Fragment Header Box\nISOBox.prototype._boxProcessors['mfhd'] = function() {\n this._procFullBox();\n this._procField('sequence_number', 'uint', 32);\n};\n\n// ISO/IEC 14496-12:2012 - 8.8.11 Movie Fragment Random Access Box\nISOBox.prototype._boxProcessors['mfro'] = function() {\n this._procFullBox();\n this._procField('mfra_size', 'uint', 32); // Called mfra_size to distinguish from the normal \"size\" attribute of a box\n};\n\n\n// ISO/IEC 14496-12:2012 - 8.5.2.2 mp4a box (use AudioSampleEntry definition and naming)\nISOBox.prototype._boxProcessors['mp4a'] = ISOBox.prototype._boxProcessors['enca'] = function() {\n // SampleEntry fields\n this._procFieldArray('reserved1', 6, 'uint', 8);\n this._procField('data_reference_index', 'uint', 16);\n // AudioSampleEntry fields\n this._procFieldArray('reserved2', 2, 'uint', 32);\n this._procField('channelcount', 'uint', 16);\n this._procField('samplesize', 'uint', 16);\n this._procField('pre_defined', 'uint', 16);\n this._procField('reserved3', 'uint', 16);\n this._procField('samplerate', 'template', 32);\n // ESDescriptor fields\n this._procField('esds', 'data', -1);\n};\n\n// ISO/IEC 14496-12:2012 - 8.2.2 Movie Header Box\nISOBox.prototype._boxProcessors['mvhd'] = function() {\n this._procFullBox();\n this._procField('creation_time', 'uint', (this.version == 1) ? 64 : 32);\n this._procField('modification_time', 'uint', (this.version == 1) ? 64 : 32);\n this._procField('timescale', 'uint', 32);\n this._procField('duration', 'uint', (this.version == 1) ? 64 : 32);\n this._procField('rate', 'template', 32);\n this._procField('volume', 'template', 16);\n this._procField('reserved1', 'uint', 16);\n this._procFieldArray('reserved2', 2, 'uint', 32);\n this._procFieldArray('matrix', 9, 'template', 32);\n this._procFieldArray('pre_defined', 6,'uint', 32);\n this._procField('next_track_ID', 'uint', 32);\n};\n\n// ISO/IEC 14496-30:2014 - WebVTT Cue Payload Box.\nISOBox.prototype._boxProcessors['payl'] = function() {\n this._procField('cue_text', 'utf8');\n};\n\n// ISO/IEC 14496-12:2012 - 8.16.5 Producer Reference Time\nISOBox.prototype._boxProcessors['prft'] = function() {\n this._procFullBox();\n this._procField('reference_track_ID', 'uint', 32);\n this._procField('ntp_timestamp_sec', 'uint', 32);\n this._procField('ntp_timestamp_frac', 'uint', 32);\n this._procField('media_time', 'uint', (this.version == 1) ? 64 : 32);\n};\n\n// ISO/IEC 14496-12:202x - 8.18.4.1 Preselection group box\nISOBox.prototype._boxProcessors['prsl'] = function() {\n this._procFullBox();\n this._procField('group_id', 'uint', 32);\n this._procField('num_entities_in_group', 'uint', 32);\n this._procEntries('entities', this.num_entities_in_group, function(entry) {\n this._procEntryField(entry, 'entity_id', 'uint', 32);\n });\n if (this.flags & 0x1000) this._procField('preselection_tag', 'utf8string');\n if (this.flags & 0x2000) this._procField('selection_priority', 'uint', 8);\n if (this.flags & 0x4000) this._procField('interleaving_tag', 'utf8string');\n\n /* rest of the boxes will be read by _parseContainerBox */\n};\n\n//ISO/IEC 23001-7:2011 - 8.1 Protection System Specific Header Box\nISOBox.prototype._boxProcessors['pssh'] = function() {\n this._procFullBox();\n \n this._procFieldArray('SystemID', 16, 'uint', 8);\n this._procField('DataSize', 'uint', 32);\n this._procFieldArray('Data', this.DataSize, 'uint', 8);\n};\n// ISO/IEC 14496-12:2012 - 8.12.5 Scheme Type Box\nISOBox.prototype._boxProcessors['schm'] = function() {\n this._procFullBox();\n \n this._procField('scheme_type', 'uint', 32);\n this._procField('scheme_version', 'uint', 32);\n\n if (this.flags & 0x000001) {\n this._procField('scheme_uri', 'string', -1);\n }\n};\n// ISO/IEC 14496-12:2012 - 8.6.4.1 sdtp box \nISOBox.prototype._boxProcessors['sdtp'] = function() {\n this._procFullBox();\n\n var sample_count = -1;\n if (this._parsing) {\n sample_count = (this._raw.byteLength - (this._cursor.offset - this._raw.byteOffset));\n }\n\n this._procFieldArray('sample_dependency_table', sample_count, 'uint', 8);\n};\n\n// ISO/IEC 14496-12:2012 - 8.16.3 Segment Index Box\nISOBox.prototype._boxProcessors['sidx'] = function() {\n this._procFullBox();\n this._procField('reference_ID', 'uint', 32);\n this._procField('timescale', 'uint', 32);\n this._procField('earliest_presentation_time', 'uint', (this.version == 1) ? 64 : 32);\n this._procField('first_offset', 'uint', (this.version == 1) ? 64 : 32);\n this._procField('reserved', 'uint', 16);\n this._procField('reference_count', 'uint', 16);\n this._procEntries('references', this.reference_count, function(entry) {\n if (!this._parsing) {\n entry.reference = (entry.reference_type & 0x00000001) << 31;\n entry.reference |= (entry.referenced_size & 0x7FFFFFFF);\n entry.sap = (entry.starts_with_SAP & 0x00000001) << 31;\n entry.sap |= (entry.SAP_type & 0x00000003) << 28;\n entry.sap |= (entry.SAP_delta_time & 0x0FFFFFFF);\n }\n this._procEntryField(entry, 'reference', 'uint', 32);\n this._procEntryField(entry, 'subsegment_duration', 'uint', 32);\n this._procEntryField(entry, 'sap', 'uint', 32);\n if (this._parsing) {\n entry.reference_type = (entry.reference >> 31) & 0x00000001;\n entry.referenced_size = entry.reference & 0x7FFFFFFF;\n entry.starts_with_SAP = (entry.sap >> 31) & 0x00000001;\n entry.SAP_type = (entry.sap >> 28) & 0x00000007;\n entry.SAP_delta_time = (entry.sap & 0x0FFFFFFF);\n }\n });\n};\n\n// ISO/IEC 14496-12:2012 - 8.4.5.3 Sound Media Header Box\nISOBox.prototype._boxProcessors['smhd'] = function() {\n this._procFullBox();\n this._procField('balance', 'uint', 16);\n this._procField('reserved', 'uint', 16);\n};\n\n// ISO/IEC 14496-12:2012 - 8.16.4 Subsegment Index Box\nISOBox.prototype._boxProcessors['ssix'] = function() {\n this._procFullBox();\n this._procField('subsegment_count', 'uint', 32);\n this._procEntries('subsegments', this.subsegment_count, function(subsegment) {\n this._procEntryField(subsegment, 'ranges_count', 'uint', 32);\n this._procSubEntries(subsegment, 'ranges', subsegment.ranges_count, function(range) {\n this._procEntryField(range, 'level', 'uint', 8);\n this._procEntryField(range, 'range_size', 'uint', 24);\n });\n });\n};\n\n// ISO/IEC 14496-12:2012 - 8.5.2 Sample Description Box\nISOBox.prototype._boxProcessors['stsd'] = function() {\n this._procFullBox();\n this._procField('entry_count', 'uint', 32);\n this._procSubBoxes('entries', this.entry_count);\n};\n\n// ISO/IEC 14496-30:2014 - WebVTT Cue Settings Box.\nISOBox.prototype._boxProcessors['sttg'] = function() {\n this._procField('settings', 'utf8');\n};\n\n// ISO/IEC 14496-12:2012 - 8.6.1.2 Decoding Time To Sample Box\nISOBox.prototype._boxProcessors['stts'] = function() {\n this._procFullBox();\n this._procField('entry_count', 'uint', 32);\n this._procEntries('entries', this.entry_count, function(entry) {\n this._procEntryField(entry, 'sample_count', 'uint', 32);\n this._procEntryField(entry, 'sample_delta', 'uint', 32);\n });\n};\n\n// ISO/IEC 14496-12:2015 - 8.7.7 Sub-Sample Information Box\nISOBox.prototype._boxProcessors['subs'] = function () {\n this._procFullBox();\n this._procField('entry_count', 'uint', 32);\n this._procEntries('entries', this.entry_count, function(entry) {\n this._procEntryField(entry, 'sample_delta', 'uint', 32);\n this._procEntryField(entry, 'subsample_count', 'uint', 16);\n this._procSubEntries(entry, 'subsamples', entry.subsample_count, function(subsample) {\n this._procEntryField(subsample, 'subsample_size', 'uint', (this.version === 1) ? 32 : 16);\n this._procEntryField(subsample, 'subsample_priority', 'uint', 8);\n this._procEntryField(subsample, 'discardable', 'uint', 8);\n this._procEntryField(subsample, 'codec_specific_parameters', 'uint', 32);\n });\n });\n};\n\n//ISO/IEC 23001-7:2011 - 8.2 Track Encryption Box\nISOBox.prototype._boxProcessors['tenc'] = function() {\n this._procFullBox();\n\n this._procField('default_IsEncrypted', 'uint', 24);\n this._procField('default_IV_size', 'uint', 8);\n this._procFieldArray('default_KID', 16, 'uint', 8);\n };\n\n// ISO/IEC 14496-12:2012 - 8.8.12 Track Fragmnent Decode Time\nISOBox.prototype._boxProcessors['tfdt'] = function() {\n this._procFullBox();\n this._procField('baseMediaDecodeTime', 'uint', (this.version == 1) ? 64 : 32);\n};\n\n// ISO/IEC 14496-12:2012 - 8.8.7 Track Fragment Header Box\nISOBox.prototype._boxProcessors['tfhd'] = function() {\n this._procFullBox();\n this._procField('track_ID', 'uint', 32);\n if (this.flags & 0x01) this._procField('base_data_offset', 'uint', 64);\n if (this.flags & 0x02) this._procField('sample_description_offset', 'uint', 32);\n if (this.flags & 0x08) this._procField('default_sample_duration', 'uint', 32);\n if (this.flags & 0x10) this._procField('default_sample_size', 'uint', 32);\n if (this.flags & 0x20) this._procField('default_sample_flags', 'uint', 32);\n};\n\n// ISO/IEC 14496-12:2012 - 8.8.10 Track Fragment Random Access Box\nISOBox.prototype._boxProcessors['tfra'] = function() {\n this._procFullBox();\n this._procField('track_ID', 'uint', 32);\n if (!this._parsing) {\n this.reserved = 0;\n this.reserved |= (this.length_size_of_traf_num & 0x00000030) << 4;\n this.reserved |= (this.length_size_of_trun_num & 0x0000000C) << 2;\n this.reserved |= (this.length_size_of_sample_num & 0x00000003);\n }\n this._procField('reserved', 'uint', 32);\n if (this._parsing) {\n this.length_size_of_traf_num = (this.reserved & 0x00000030) >> 4;\n this.length_size_of_trun_num = (this.reserved & 0x0000000C) >> 2;\n this.length_size_of_sample_num = (this.reserved & 0x00000003);\n }\n this._procField('number_of_entry', 'uint', 32);\n this._procEntries('entries', this.number_of_entry, function(entry) {\n this._procEntryField(entry, 'time', 'uint', (this.version === 1) ? 64 : 32);\n this._procEntryField(entry, 'moof_offset', 'uint', (this.version === 1) ? 64 : 32);\n this._procEntryField(entry, 'traf_number', 'uint', (this.length_size_of_traf_num + 1) * 8);\n this._procEntryField(entry, 'trun_number', 'uint', (this.length_size_of_trun_num + 1) * 8);\n this._procEntryField(entry, 'sample_number', 'uint', (this.length_size_of_sample_num + 1) * 8);\n });\n};\n\n// ISO/IEC 14496-12:2012 - 8.3.2 Track Header Box\nISOBox.prototype._boxProcessors['tkhd'] = function() {\n this._procFullBox();\n this._procField('creation_time', 'uint', (this.version == 1) ? 64 : 32);\n this._procField('modification_time', 'uint', (this.version == 1) ? 64 : 32);\n this._procField('track_ID', 'uint', 32);\n this._procField('reserved1', 'uint', 32);\n this._procField('duration', 'uint', (this.version == 1) ? 64 : 32);\n this._procFieldArray('reserved2', 2, 'uint', 32);\n this._procField('layer', 'uint', 16);\n this._procField('alternate_group', 'uint', 16);\n this._procField('volume', 'template', 16);\n this._procField('reserved3', 'uint', 16);\n this._procFieldArray('matrix', 9, 'template', 32);\n this._procField('width', 'template', 32);\n this._procField('height', 'template', 32);\n};\n\n// ISO/IEC 14496-12:2012 - 8.8.3 Track Extends Box\nISOBox.prototype._boxProcessors['trex'] = function() {\n this._procFullBox();\n this._procField('track_ID', 'uint', 32);\n this._procField('default_sample_description_index', 'uint', 32);\n this._procField('default_sample_duration', 'uint', 32);\n this._procField('default_sample_size', 'uint', 32);\n this._procField('default_sample_flags', 'uint', 32);\n};\n\n// ISO/IEC 14496-12:2012 - 8.8.8 Track Run Box\n// Note: the 'trun' box has a direct relation to the 'tfhd' box for defaults.\n// These defaults are not set explicitly here, but are left to resolve for the user.\nISOBox.prototype._boxProcessors['trun'] = function() {\n this._procFullBox();\n this._procField('sample_count', 'uint', 32);\n if (this.flags & 0x1) this._procField('data_offset', 'int', 32);\n if (this.flags & 0x4) this._procField('first_sample_flags', 'uint', 32);\n this._procEntries('samples', this.sample_count, function(sample) {\n if (this.flags & 0x100) this._procEntryField(sample, 'sample_duration', 'uint', 32);\n if (this.flags & 0x200) this._procEntryField(sample, 'sample_size', 'uint', 32);\n if (this.flags & 0x400) this._procEntryField(sample, 'sample_flags', 'uint', 32);\n if (this.flags & 0x800) this._procEntryField(sample, 'sample_composition_time_offset', (this.version === 1) ? 'int' : 'uint', 32);\n });\n};\n\n// ISO/IEC 14496-12:2012 - 8.7.2 Data Reference Box\nISOBox.prototype._boxProcessors['url '] = ISOBox.prototype._boxProcessors['urn '] = function() {\n this._procFullBox();\n if (this.type === 'urn ') {\n this._procField('name', 'string', -1);\n }\n this._procField('location', 'string', -1);\n};\n\n// ISO/IEC 14496-30:2014 - WebVTT Source Label Box\nISOBox.prototype._boxProcessors['vlab'] = function() {\n this._procField('source_label', 'utf8');\n};\n\n// ISO/IEC 14496-12:2012 - 8.4.5.2 Video Media Header Box\nISOBox.prototype._boxProcessors['vmhd'] = function() {\n this._procFullBox();\n this._procField('graphicsmode', 'uint', 16);\n this._procFieldArray('opcolor', 3, 'uint', 16);\n};\n\n// ISO/IEC 14496-30:2014 - WebVTT Configuration Box\nISOBox.prototype._boxProcessors['vttC'] = function() {\n this._procField('config', 'utf8');\n};\n\n// ISO/IEC 14496-30:2014 - WebVTT Empty Sample Box\nISOBox.prototype._boxProcessors['vtte'] = function() {\n // Nothing should happen here.\n};\n", "/************************************************************************************************************\n * Copyright (C) 2023-2025 by Dolby International AB.\n * All rights reserved.\n\n * Redistribution and use in source and binary forms, with or without modification, are permitted\n * provided that the following conditions are met:\n\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions\n * and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions\n * and the following disclaimer in the documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or\n * promote products derived from this software without specific prior written permission.\n\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n ************************************************************************************************************/\n\n/**\n * @module\n * @desc This file defines constant values representing the box types specified in the ISO Base Media File Format (ISOBMFF)\n */\n\n/**\n * @constant\n * @type {string}\n */\nexport const MOVIE = \"moov\";\n/**\n * @constant\n * @type {string}\n */\nexport const TRACK = \"trak\";\n/**\n * @constant\n * @type {string}\n */\nexport const TRACK_HEADER = \"tkhd\";\n/**\n * @constant\n * @type {string}\n */\nexport const META = \"meta\";\n/**\n * @constant\n * @type {string}\n */\nexport const GROUPS_LIST = \"grpl\";\n/**\n * @constant\n * @type {string}\n */\nexport const PRESELECTION_GROUP = \"prsl\";\n/**\n * @constant\n * @type {string}\n */\nexport const USER_DATA = \"udta\";\n/**\n * @constant\n * @type {string}\n */\nexport const DIALOG_PROCESSING = \"diap\";\n/**\n * @constant\n * @type {string}\n */\nexport const EXTENDED_LANGUAGE_TAG = \"elng\";\n/**\n * @constant\n * @type {string}\n */\nexport const AUDIO_RENDERING_INDICATION = \"ardi\";\n/**\n * @constant\n * @type {string}\n */\nexport const LABEL = \"labl\";\n/**\n * @constant\n * @type {string}\n */\nexport const KIND = \"kind\";\n/**\n * @constant\n * @type {string}\n */\nexport const MOVIE_FRAGMENT = \"moof\";\n/**\n * @constant\n * @type {string}\n */\nexport const TRACK_FRAGMENT = \"traf\";\n/**\n * @constant\n * @type {string}\n */\nexport const TRACK_FRAGMENT_HEADER = \"tfhd\";\n/**\n * @constant\n * @type {string}\n */\nexport const TRACK_FRAGMENT_RUN = \"trun\";\n", "/************************************************************************************************************\n * Copyright (C) 2023-2024 by Dolby International AB.\n * All rights reserved.\n\n * Redistribution and use in source and binary forms, with or without modification, are permitted\n * provided that the following conditions are met:\n\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions\n * and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions\n * and the following disclaimer in the documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or\n * promote products derived from this software without specific prior written permission.\n\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n ************************************************************************************************************/\n\n/**\n * @module\n * @desc This file defines constant values representing the AC-4 TOC elements defined in specification and custom elements that are out of the specification\n */\n\n/**\n * @constant\n * @type {string}\n */\nexport const B_PRESENTATION_ID = \"b_presentation_id\";\n/**\n * @constant\n * @type {string}\n */\nexport const PRESENTATION_ID = \"presentation_id\";\n/**\n * @constant\n * @type {string}\n */\nexport const PRESENTATION_LEVEL = \"presentation_level\";\n/**\n * @constant\n * @type {string}\n */\nexport const PAYLOAD_BASE_MINUS1 = \"payload_base_minus1\";\n/**\n * @constant\n * @type {string}\n */\nexport const BYTE_ALIGNMENT = \"byte_alignment\";\n/**\n * @constant\n * @type {string}\n */\nexport const AC4_TOC_END = \"ac4_toc_end\";\n\n/**\n * @constant\n * @type {string}\n */\nexport const PAYLOAD_BASE = \"payload_base\";\n", "/************************************************************************************************************\n * Copyright (C) 2024 by Dolby International AB.\n * All rights reserved.\n\n * Redistribution and use in source and binary forms, with or without modification, are permitted\n * provided that the following conditions are met:\n\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions\n * and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions\n * and the following disclaimer in the documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or\n * promote products derived from this software without specific prior written permission.\n\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n ************************************************************************************************************/\n\n/*global console*/\n\n/**\n * @module\n * @desc This file contains functions for performing bitwise operations on byte arrays (DataView objects).\n */\n\n/**\n * Reverses the bit order of a single byte using a parallel bit-swap technique.\n * Each step swaps groups of bits at halving granularity:\n * 1. swap the two nibbles (4-bit groups)\n * 2. swap 2-bit pairs (2-bit groups)\n * 3. swap adjacent bits (1-bit groups)\n *\n * @param {number} byte - An unsigned byte value (0\u2013255)\n * @returns {number} The byte with its bits reversed\n *\n * @example\n * rev(0b10000000) // \u2192 0b00000001 (1)\n * rev(0b10110001) // \u2192 0b10001101 (141)\n */\nconst rev = (byte) => {\n // swap nibbles\n let result = ((byte & 0xf0) >>> 4) | ((byte & 0x0f) << 4);\n // swap bit pairs\n result = ((result & 0xcc) >>> 2) | ((result & 0x33) << 2);\n // swap adjacent bits\n result = ((result & 0xaa) >>> 1) | ((result & 0x55) << 1);\n return result;\n};\n\n/**\n * Shifts the specified range of bits left without shifting bits outside the range.\n * Zeros are pushed in from the right side to maintain width.\n *\n * @summary Shifts a range of bits within a byte array left by a specified amount.\n *\n * @param {DataView} data - The byte array containing the bits to shift\n * @param {number} offset - The start index of the bit range to shift (must be >= 0)\n * @param {number} width - The number of bits to shift (must be >= 0)\n * @param {number} shift - The number of positions to shift left (must be >= 0)\n * @returns {DataView} The same byte array with the bits shifted in-place\n *\n * @example\n * const arrayBuffer = new ArrayBuffer(1);\n * const dataView = new DataView(arrayBuffer);\n * dataView.setUint8(0, 0b01011101);\n * shiftLeft(dataView, 3, 3, 3)\n * // dataView = [0b01000001]\n */\nconst shiftLeft = (data, offset, width, shift) => {\n if (width === 0) return data;\n\n const startByte = offset >> 3;\n const endByte = (offset + width - 1) >> 3;\n const startMask = 0xff >> (offset & 7);\n const endMask = (0xff << (7 - ((offset + width - 1) & 7))) & 0xff;\n\n // For shift < 24 the accumulator stays below 2^31 so plain bitwise << and\n // unsigned >>> are exact. For shift >= 24 we fall back to IEEE-754 double\n // multiplication which is exact up to 2^53.\n const useBitwise = shift < 24;\n const shiftMul = useBitwise ? 0 : 2 ** shift;\n let shiftAcc = 0;\n\n // Iterate end\u2192start: carry propagates naturally from LSB side toward MSB.\n for (let i = endByte; i >= startByte; i--) {\n let mask = 0xff;\n if (i === startByte) mask &= startMask;\n if (i === endByte) mask &= endMask;\n\n const byte = data.getUint8(i);\n if (useBitwise) {\n shiftAcc = ((byte & mask) << shift) + shiftAcc;\n data.setUint8(i, (byte & ~mask) | (shiftAcc & 0xff & mask));\n shiftAcc >>>= 8;\n } else {\n shiftAcc = (byte & mask) * shiftMul + shiftAcc;\n data.setUint8(i, (byte & ~mask) | (shiftAcc % 256 & mask));\n shiftAcc = Math.trunc(shiftAcc / 256);\n }\n }\n return data;\n};\n\n/**\n * Shifts the specified range of bits right without shifting bits outside the range.\n * Zeros are pushed in from the left side to maintain width.\n *\n * @summary Shifts a range of bits within a byte array right by a specified amount.\n *\n * @param {DataView} data - The byte array containing the bits to shift\n * @param {number} offset - The start index of the bit range to shift (must be >= 0)\n * @param {number} width - The number of bits to shift (must be >= 0)\n * @param {number} shift - The number of positions to shift right (must be >= 0)\n * @returns {DataView} The same byte array with the bits shifted in-place\n *\n * @example\n * const arrayBuffer = new ArrayBuffer(1);\n * const dataView = new DataView(arrayBuffer);\n * dataView.setUint8(0, 0b01011101);\n * shiftRight(dataView, 3, 3, 2);\n * // Only bits 5,4,3 = '111' are shifted right by 2 \u2192 become '001'\n * // Result: 0b01000101\n */\nconst shiftRight = (data, offset, width, shift) => {\n if (width === 0) return data;\n\n const startByte = offset >> 3;\n const endByte = (offset + width - 1) >> 3;\n const startMask = 0xff >> (offset & 7);\n const endMask = (0xff << (7 - ((offset + width - 1) & 7))) & 0xff;\n\n // Same fast/slow split as shiftLeft; rev() mirrors the carry direction.\n const useBitwise = shift < 24;\n const shiftMul = useBitwise ? 0 : 2 ** shift;\n let shiftAcc = 0;\n\n // Iterate start\u2192end: rev() maps MSB carry into LSB carry for the reversed bytes.\n for (let i = startByte; i <= endByte; i++) {\n let mask = 0xff;\n if (i === startByte) mask &= startMask;\n if (i === endByte) mask &= endMask;\n\n const byte = data.getUint8(i);\n if (useBitwise) {\n shiftAcc = (rev(byte & mask) << shift) + shiftAcc;\n data.setUint8(i, (byte & ~mask) | (rev(shiftAcc & 0xff) & mask));\n shiftAcc >>>= 8;\n } else {\n shiftAcc = rev(byte & mask) * shiftMul + shiftAcc;\n data.setUint8(i, (byte & ~mask) | (rev(shiftAcc % 256) & mask));\n shiftAcc = Math.trunc(shiftAcc / 256);\n }\n }\n return data;\n};\n\n/**\n * This function modifies a range of bits within a byte array by setting them to a given value. It handles cases where the bit range spans across maximum of two bytes.\n *\n * @summary Sets a range of bits within a byte array to a specified value.\n *\n * @param {DataView} data - The byte array in which the bits will be replaced\n * @param {number} offset - The start index of the bit range to set (must be >= 0)\n * @param {number} width - The number of bits to set (must be >= 0)\n * @param {number} value - The value to set the bits to (must fit within the specified width)\n *\n * @example\n * const arrayBuffer = new ArrayBuffer(2);\n * const dataView = new DataView(arrayBuffer);\n * dataView.setUint8(0, 0b10101010);\n * dataView.setUint8(1, 0b01010101);\n * setBits(dataView, 5, 4, 0b1011);\n * // dataView = [0b10101101, 0b11010101]\n */\nconst setBits = (data, offset, width, value) => {\n // Make sure the value is not too large to fit\n console.assert(value >> width === 0, `value is not a ${width} bit value`);\n\n // Offset in bytes and bits\n const byteOffset = offset >>> 3;\n const bitOffset = offset & 7;\n\n // Mask to mask out the presentation bits\n const mask = (((1 << width) - 1) << (16 - width)) >> bitOffset;\n\n // Read a 16-bit word\n let word = (data.getUint8(byteOffset) << 8) | data.getUint8(byteOffset + 1);\n\n // Zero out the bits in the mask\n word &= ~mask;\n\n // Stamp the value into word\n word |= value << (16 - width - bitOffset);\n\n // Write back into databuffer\n data.setUint8(byteOffset, word >>> 8);\n data.setUint8(byteOffset + 1, word & 0xff);\n};\n\nexport { rev, shiftLeft, shiftRight, setBits };\n", "/************************************************************************************************************\n * Copyright (C) 2023-2024 by Dolby International AB.\n * All rights reserved.\n\n * Redistribution and use in source and binary forms, with or without modification, are permitted\n * provided that the following conditions are met:\n\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions\n * and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions\n * and the following disclaimer in the documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or\n * promote products derived from this software without specific prior written permission.\n\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n ************************************************************************************************************/\n\n/**\n * @module\n * @desc This file contains the function that calculates offsets and sizes of individual media samples.\n */\n\nimport * as isoBmffBox from \"./constants/isobmff_box_names.js\";\n\n/**\n * @typedef {Object} SampleData\n * @property {number} offset - offset to Sample\n * @property {number} size - Sample size\n */\n\n/**\n * Calculates offsets and sizes of individual samples within the media data.\n *\n * @param {ISOFile} parsedBuffer - The parsed buffer containing ISOBMFF boxes\n * @returns {SampleData[]} An array of objects containing the offset and size of each sample\n */\nconst getSampleOffsets = (parsedBuffer) => {\n const sampleOffsets = [];\n const DEFAULT_BASE_IS_MOOF_FLAG_OFFSET = 0x020000;\n // must be exactly one in a media segment\n const movieFragment = parsedBuffer.fetch(isoBmffBox.MOVIE_FRAGMENT);\n\n let isFirstTrackFragment = true;\n\n for (const trackFragment of parsedBuffer.fetchAll(isoBmffBox.TRACK_FRAGMENT)) {\n // Exactly one must be present per traf\n const trackFragmentHeader = trackFragment.boxes.find((box) => box.type === isoBmffBox.TRACK_FRAGMENT_HEADER);\n\n const baseDataOffset = trackFragmentHeader.base_data_offset || 0;\n const defaultBaseIsMoof = trackFragmentHeader.flags & DEFAULT_BASE_IS_MOOF_FLAG_OFFSET;\n\n if (baseDataOffset) {\n /* base_data_offset is relative to the file identified by the referenced data reference entry */\n throw Error(\n \"base_data_offset is relative to the file identified by the referenced data reference entry unsupported\",\n );\n }\n\n if (!defaultBaseIsMoof) {\n if (isFirstTrackFragment) {\n /* base_data_offset is relative to the first byte of the MovieFragmentBox containing this box */\n throw Error(\n \"base_data_offset is relative to the first byte of the MovieFragmentBox containing this box unsupported\",\n );\n }\n /* base_data_offset is relative to the end of the data defined by the preceding track fragment */\n throw Error(\n \"base_data_offset is relative to the end of the data defined by the preceding track fragment is unsupported\",\n );\n }\n\n /* base_data_offset is relative to the first byte of the MovieFragmentBox containing this box */\n const relative = movieFragment._offset;\n\n for (const trackFragmentRun of trackFragment.boxes.filter((box) => box.type === isoBmffBox.TRACK_FRAGMENT_RUN)) {\n let sampleOffset = relative + baseDataOffset + trackFragmentRun.data_offset;\n for (const sample of trackFragmentRun.samples) {\n sampleOffsets.push({ offset: sampleOffset, size: sample.sample_size });\n sampleOffset += sample.sample_size;\n }\n }\n\n isFirstTrackFragment = false;\n }\n\n return sampleOffsets;\n};\n\nexport { getSampleOffsets };\n", "/************************************************************************************************************\n * Copyright (C) 2024-2025 by Dolby International AB.\n * All rights reserved.\n\n * Redistribution and use in source and binary forms, with or without modification, are permitted\n * provided that the following conditions are met:\n\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions\n * and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions\n * and the following disclaimer in the documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or\n * promote products derived from this software without specific prior written permission.\n\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n ************************************************************************************************************/\n\n/*global console*/\n\n/**\n * @module\n * @desc This file provides a BitSource class for reading bits from a source that implements iterator protocol\n */\n\n/** Handles reading bits from the source that is an iterator */\nexport class BitSource {\n /**\n * Create the BitSource\n * @param {Iterator<number>} iterator - an iterator object\n */\n constructor(iterator) {\n this.iterator = iterator;\n this.cache = 0;\n this.bitsLeft = 0;\n }\n\n /**\n * This function reads n-bit value from the source, where \"n\" is the specified width.\n *\n * It works by keeping a 32 bit wide cache.\n * In the cache, the next bits are \"left/top aligned\".\n * That is to say, to read the next three bits, you take the three most significant bits.\n * This can be accomplished by right-shifting the cache by 32-3=29 bits, taking care that it is an unsigned shift and no sign extension takes place.\n * To \"expel\" the read bits from the cache, simple left-shift the cache by 3 bits.\n *\n * Before any bits are read from the cache, it needs to be filled.\n * We check if more bits are needed, and whether at least 8 can be filled in. If so, do it.\n * This means that the cache contains 25 bits at a minimum after it is filled.\n * Therefore, 25 bits are the most bits that the reader can deliver. We don't check for end of stream in the bit reader. That is better delegated elsewhere.\n *\n * @summary Get a value of specified width from the bit source\n *\n * @param {string} varname - Name of the variable being read (it serves only logging purposes)\n * @param {number} bitsWidth - Width of the value to be read (maximum 25 bits)\n * @returns {number} The value read from the bit source\n */\n get(varname, bitsWidth) {\n const MAX_SHIFT = 24;\n const MAX_SUPPORTED_WIDTH = 25;\n const BYTE_SIZE = 8;\n const INT_SIZE = 32;\n // make sure the BitSource supports reading value with given width\n if (bitsWidth > MAX_SUPPORTED_WIDTH) {\n console.warn(\n `BitSource.get getting value ${varname} with not supported width=${bitsWidth} (max supported width: 24)`,\n );\n }\n\n let width = bitsWidth;\n while (this.bitsLeft < width) {\n const nextByte = this.iterator.next();\n\n // calculate the shift to not overwrite the cache\n const nextByteShift = MAX_SHIFT - this.bitsLeft;\n\n this.cache |= nextByte.value << nextByteShift;\n this.bitsLeft += BYTE_SIZE;\n /*\n We may have an AC-4 stream with field width >= 25/32 bits,\n current tocparser implementation can not handle its value.\n Whenever we have such field we move iterator to proper bits\n */\n if (width > MAX_SUPPORTED_WIDTH) {\n this.cache <<= BYTE_SIZE;\n this.bitsLeft -= BYTE_SIZE;\n width -= BYTE_SIZE;\n }\n }\n\n // take the highest \"width\" bits, make sure unsigned shift is used\n const readValue = this.cache >>> (INT_SIZE - width);\n // clear out the highest \"width\" bits\n this.cache <<= width;\n this.bitsLeft -= width;\n\n return readValue;\n }\n\n /**\n * Get bits needed for byte alignment\n *\n * @param {number} numberOfBits - Number of bits to align\n * @returns {number} The value read for alignment\n */\n get_align(numberOfBits) {\n return this.get(\"align\", numberOfBits);\n }\n}\n", "/************************************************************************************************************\n * Copyright (C) 2023-2025 by Dolby International AB.\n * All rights reserved.\n\n * Redistribution and use in source and binary forms, with or without modification, are permitted\n * provided that the following conditions are met:\n\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions\n * and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions\n * and the following disclaimer in the documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or\n * promote products derived from this software without specific prior written permission.\n\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n ************************************************************************************************************/\n\n/**\n * @module\n * @desc This file provides a sink class for AC-4 TOC parser callback handling and filtering.\n */\n\nimport { BYTE_ALIGNMENT } from \"../constants/toc_elements.js\";\n\n/**\n * This callback is called when configured element is found while parsing\n *\n * @callback sinkCallback\n * @param {string} name\n * @param {number} value\n * @param {number} width\n * @param {number} position\n * @param {string} [handler]\n */\n\n/** Handles the callback and filtering functionality for AC-4 TOC parser */\nexport class FilterSink {\n /**\n * Create the Filter Sink\n * @param {string[]} elements - The AC-4 TOC elements to be filtered\n * @param {sinkCallback} callback - The callback function to be called for filtered elements\n */\n constructor(elements, callback) {\n this.elements = elements;\n this.callback = callback;\n }\n\n /**\n * Called before calling embedded BSDL function\n * @param {string} _fname - name of the BSDL function\n * @param {unknown} _params - parameters passed to the BSDL function\n * @param {string} name - name of the AC-4 TOC element\n * @param {number} position - position read before calling embedded BSDL function\n */\n before_call(_fname, _params, name, position) {\n if (this.elements.includes(name)) {\n this.callback(name, null, null, position, \"before_call\");\n }\n }\n\n /**\n * Called after calling embedded BSDL function. The position is written after field is read\n * @param {string} _fname - name of the BSDL function\n * @param {number} value - value returned by the BSDL function\n * @param {string} name - name of the AC-4 TOC element\n * @param {number} position - position read after calling embedded BSDL function\n */\n after_call(_fname, value, name, position) {\n if (this.elements.includes(name)) {\n this.callback(name, value, null, position, \"after_call\");\n }\n }\n\n /**\n * Called when assigning a variable.\n * @param {string} name - name of the AC-4 TOC element\n * @param {number} width - width of the AC-4 TOC element\n * @param {number} value - value of the AC-4 TOC element\n * @param {number} position - position of the AC-4 TOC element\n */\n write_uint(name, width, value, position) {\n if (this.elements.includes(name)) {\n this.callback(name, value, width, position);\n }\n }\n\n /**\n * Called when assigning byte alignment to a variable.\n * @param {number} width - width of the byte alignment field\n * @param {number} value - value of byte alignment field\n */\n write_align(width, value) {\n if (this.elements.includes(BYTE_ALIGNMENT)) {\n this.callback(BYTE_ALIGNMENT, value, width, null, \"write_align\");\n }\n }\n\n /**\n * Called after BSDL position() call to obtain bit position\n * @param {string} name - name of the variable that the position will be assigned to\n * @param {number} position - obtained position\n */\n after_position(name, position) {\n if (this.elements.includes(name)) {\n this.callback(name, null, null, position, \"after_position\");\n }\n }\n\n /**\n * Called after a derived/computed value is assigned to a variable (e.g. when\n * `payload_base` is extended beyond the initial 5-bit field).\n * @param {string} name - name of the AC-4 TOC element\n * @param {number} value - final computed value of the element\n */\n after_add(name, value) {\n if (this.elements.includes(name)) {\n this.callback(name, value, null, null, \"after_add\");\n }\n }\n}\n", "/************************************************************************************************************\n * Copyright (C) 2023-2024 by Dolby International AB.\n * All rights reserved.\n\n * Redistribution and use in source and binary forms, with or without modification, are permitted\n * provided that the following conditions are met:\n\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions\n * and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions\n * and the following disclaimer in the documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or\n * promote products derived from this software without specific prior written permission.\n\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n ************************************************************************************************************/\n\n/**\n * @module\n * @desc Parse AC-4 frames, specifically the TOC. The code was generated automatically.\n */\n\nexport class ParseError extends Error {}\n\nexport class Parser\n{\n // Class field declarations\n v = null;\n content_classifier = null;\n i = null;\n frame_rate_factor = null;\n bk_substream_index = null;\n a_substream_indices = null;\n last_referenced_substream = null;\n referenced_substreams = null;\n protection_bits_primary_bits = null;\n protection_bits_secondary_bits = null;\n toc_i = null;\n OAMD_OBJECT_TYPE_BED = null;\n OAMD_OBJECT_TYPE_ISF = null;\n OAMD_OBJECT_TYPE_DYNAMIC = null;\n OAMD_OBJECT_TYPE_RESERVED = null;\n toc_j = null;\n vb = null;\n presentation_to_groups = null;\n group_frame_rate_factor = null;\n b_hsf_ext = null;\n b_single_substream = null;\n n_bed_objects = null;\n a_num_bed_objects = null;\n b_bed_objects_prev = null;\n num_lfe = null;\n n = null;\n n_skip_bytes = null;\n b_more_skip_bytes = null;\n n_bits_read_0 = null;\n n_bits_read_1 = null;\n n_bits_read = null;\n n_skip_bits = null;\n reserved = null;\n padding = null;\n CHANNEL_MODE_MONO = null;\n CHANNEL_MODE_STEREO = null;\n CHANNEL_MODE_30 = null;\n CHANNEL_MODE_50 = null;\n CHANNEL_MODE_51 = null;\n CHANNEL_MODE_70_34 = null;\n CHANNEL_MODE_71_34 = null;\n CHANNEL_MODE_70_52 = null;\n CHANNEL_MODE_71_52 = null;\n CHANNEL_MODE_70_322 = null;\n CHANNEL_MODE_71_322 = null;\n CHANNEL_MODE_704 = null;\n CHANNEL_MODE_714 = null;\n CHANNEL_MODE_904 = null;\n CHANNEL_MODE_914 = null;\n CHANNEL_MODE_222 = null;\n presentation_config = null;\n presentation_version = null;\n b_add_emdf_substreams = null;\n presentation_level = null;\n b_presentation_id = null;\n presentation_id = null;\n b_pre_virtualized = null;\n n_add_emdf_substreams = null;\n pi_i = null;\n b_single_substream_group = null;\n b_presentation_filter = null;\n b_enable_presentation = null;\n n_substream_groups = null;\n b_multi_pid = null;\n n_substream_groups_minus2 = null;\n sg = null;\n bitstream_version = null;\n fs_index = null;\n frame_rate_index = null;\n BAM_g_position = 0;\n BAM_g_table0 = [0, 2, 4, 6];\n BAM_g_table1 = [252, 253, 508, 509];\n BAM_g_table2 = [122, 123, 124, 125];\n BAM_g_table3 = [252, 253, 508, 509];\n BAM_g_table4 = [4, 6, 8, 10, 12, 14];\n BAM_g_table5 = [122, 123, 124, 125];\n BAM_g_table6 = [0, 0];\n BAM_g_table7 = [0, 1, 2, 3, 5, 0, 0, 0];\n BAM_g_table8 = [2, 3, 6, 8, 10, 8, 10, 12];\n BAM_g_table9 = [2, 1, 1, 2, 2, 2, 2, 2, 2, 1];\n BAM_g_table10 = [4, 8, 10, 14, 15, 30, -1, -1];\n BAM_g_table11 = [2, 3, 4, 5, 6, 7];\n BAM_g_table12 = [2, 1, 1, 2, 2, 2, 2, 2, 2, 1];\n BAM_g_table13 = [1920, 1920, 2048, 1536, 1536, 960, 960, 1024, 768, 768, 512, 384, 384, 2048];\n BAM_g_table14 = [2, 3, 4];\n BAM_g_table15 = {0: 2, 1: 4};\n BAM_g_table16 = [0, 1, 7, 8, 9];\n BAM_g_table17 = {0: 1, 1: 2};\n BAM_g_table18 = [5, 6, 7, 8, 9];\n BAM_g_table19 = [10, 11, 12];\n \n constructor (BAM_source, BAM_sink)\n {\n this.BAM_source = BAM_source;\n this.BAM_sink = BAM_sink;\n }\n \n F_channel_mode_contains_LFE (cm)\n {\n {\n if (cm == this.CHANNEL_MODE_51 || cm == this.CHANNEL_MODE_71_34 || cm == this.CHANNEL_MODE_71_52 || cm == this.CHANNEL_MODE_71_322)\n {\n return 1;\n }\n else\n {\n return 0;\n }\n }\n }\n \n F_bitrate_indicator ()\n {\n var factor;\n var bi;\n {\n {\n bi = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n if ((this.BAM_g_table0.slice(0).indexOf(bi) >= 0))\n {\n {\n bi = bi >> 1;\n }\n }\n else\n {\n {\n {\n this.v = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n {\n this.v = (bi << 2) + this.v;\n }\n {\n factor = Math.floor(this.v / 8);\n }\n {\n bi = this.v - factor * 4;\n }\n }\n }\n }\n }\n \n F_content_type ()\n {\n var b_start_tag;\n var b_serialized_language_tag;\n var b_language_indicator;\n var language_tag_chunk;\n var n_language_tag_bytes;\n var language_tag_bytes;\n {\n {\n this.content_classifier = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n {\n b_language_indicator = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_language_indicator)\n {\n {\n {\n b_serialized_language_tag = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_serialized_language_tag)\n {\n {\n {\n b_start_tag = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n language_tag_chunk = this.BAM_source.get(\"\", 16);\n this.BAM_g_position += 16;\n }\n }\n }\n else\n {\n {\n {\n n_language_tag_bytes = this.BAM_source.get(\"\", 6);\n this.BAM_g_position += 6;\n }\n for (this.i = 0; this.i < n_language_tag_bytes; this.i++)\n {\n {\n language_tag_bytes = this.BAM_source.get(\"\", 8);\n this.BAM_g_position += 8;\n }\n }\n }\n }\n }\n }\n }\n }\n \n F_ac4_substream_info_chan (asio_group_index, asio_gs_index, asio_b_substreams_present_chan)\n {\n var si_ch_mode;\n var top_channels_present;\n var si_b_iframe;\n var si_channel_mode;\n var b_bitrate_info;\n var b_sf_multiplier;\n var b_center_present;\n var add_ch_base;\n var b_4_back_channels_present;\n var sf_multiplier;\n var substream_index;\n var b_lfe = null;\n var b_lfe;\n {\n {\n this.F_define_channel_modes();\n }\n {\n this.F_define_oamd();\n }\n {\n si_channel_mode = this.F_channel_mode();\n if (si_channel_mode == null)\n {\n throw ParseError(\"F_channel_mode\", \"expected to return a value, returned None\");\n }\n }\n if (si_channel_mode == 511)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n si_channel_mode += this.v;\n }\n }\n }\n if ((this.BAM_g_table1.slice(0).indexOf(si_channel_mode) >= 0))\n {\n {\n {\n b_4_back_channels_present = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n b_center_present = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n top_channels_present = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n }\n }\n if (this.fs_index == 1)\n {\n {\n {\n b_sf_multiplier = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_sf_multiplier)\n {\n {\n sf_multiplier = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n }\n }\n {\n b_bitrate_info = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_bitrate_info)\n {\n {\n this.F_bitrate_indicator();\n }\n }\n if ((this.BAM_g_table2.slice(0).indexOf(si_channel_mode) >= 0))\n {\n {\n add_ch_base = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n {\n this.frame_rate_factor = this.group_frame_rate_factor[asio_group_index];\n }\n for (this.i = 0; this.i < this.frame_rate_factor; this.i++)\n {\n {\n si_b_iframe = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n if (asio_b_substreams_present_chan == 1)\n {\n {\n {\n substream_index = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (substream_index == 3)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n substream_index += this.v;\n }\n }\n }\n }\n }\n else\n {\n {\n {\n substream_index = this.bk_substream_index;\n }\n {\n this.bk_substream_index = this.bk_substream_index + 1;\n }\n }\n }\n {\n this.a_substream_indices.push(substream_index);\n }\n for (this.i = 0; this.i < this.frame_rate_factor; this.i++)\n {\n {\n if (asio_b_substreams_present_chan == 1)\n {\n {\n {\n this.last_referenced_substream = Math.max(this.last_referenced_substream, substream_index + this.i);\n }\n {\n this.referenced_substreams.push(substream_index + this.i);\n }\n }\n }\n if ((this.BAM_g_table3.slice(0).indexOf(si_channel_mode) >= 0))\n {\n }\n {\n si_ch_mode = this.F_get_ch_mode(si_channel_mode);\n if (si_ch_mode == null)\n {\n throw ParseError(\"F_get_ch_mode\", \"expected to return a value, returned None\");\n }\n }\n if ((this.BAM_g_table4.slice(0).indexOf(si_ch_mode) >= 0))\n {\n {\n if (b_lfe == null)\n {\n b_lfe = new Array((substream_index + this.i) + 1).fill(0);\n }\n else if ((b_lfe).length <= substream_index + this.i)\n {\n b_lfe.push.apply(b_lfe, new Array((substream_index + this.i) - (b_lfe).length + 1).fill(0));\n }\n b_lfe[substream_index + this.i] = 1;\n }\n }\n else\n {\n {\n if (b_lfe == null)\n {\n b_lfe = new Array((substream_index + this.i) + 1).fill(0);\n }\n else if ((b_lfe).length <= substream_index + this.i)\n {\n b_lfe.push.apply(b_lfe, new Array((substream_index + this.i) - (b_lfe).length + 1).fill(0));\n }\n b_lfe[substream_index + this.i] = 0;\n }\n }\n }\n }\n }\n }\n \n F_channel_mode ()\n {\n var value;\n var stereo_channel_mode;\n {\n {\n value = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (value == 1)\n {\n {\n {\n this.v = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n value = (value << 1) + this.v;\n }\n {\n stereo_channel_mode = 2;\n }\n if (value == 3)\n {\n {\n {\n this.v = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n {\n value = (value << 2) + this.v;\n }\n if (value == 15)\n {\n {\n {\n this.v = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n {\n value = (value << 3) + this.v;\n }\n if (value == 120 || value == 121)\n {\n {\n {\n stereo_channel_mode = value;\n }\n {\n value = 2;\n }\n }\n }\n if (value == 126)\n {\n {\n {\n this.v = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n value = (value << 1) + this.v;\n }\n }\n }\n if (value == 127)\n {\n {\n {\n this.v = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n {\n value = (value << 2) + this.v;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return value;\n }\n }\n \n F_ac4_substream_info (si_b_associated, si_b_dialog, si_ps_index)\n {\n var sf_multiplier;\n var b_associated_content;\n var si_b_iframe;\n var si_channel_mode;\n var b_bitrate_info;\n var b_sf_multiplier;\n var b_dialog_content;\n var b_content_type;\n var add_ch_base;\n var substream_index;\n var b_lfe = null;\n var b_lfe;\n {\n {\n this.F_define_channel_modes();\n }\n {\n si_channel_mode = this.F_channel_mode();\n if (si_channel_mode == null)\n {\n throw ParseError(\"F_channel_mode\", \"expected to return a value, returned None\");\n }\n }\n if (si_channel_mode == 511)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n si_channel_mode += this.v;\n }\n }\n }\n if (this.fs_index == 1)\n {\n {\n {\n b_sf_multiplier = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_sf_multiplier)\n {\n {\n sf_multiplier = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n }\n }\n {\n b_bitrate_info = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_bitrate_info)\n {\n {\n this.F_bitrate_indicator();\n }\n }\n if ((this.BAM_g_table5.slice(0).indexOf(si_channel_mode) >= 0))\n {\n {\n add_ch_base = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n {\n b_content_type = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_content_type)\n {\n {\n {\n this.F_content_type();\n }\n if ((this.content_classifier) == (0))\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (1))\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (2))\n {\n {\n {\n b_associated_content = 1;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (3))\n {\n {\n {\n b_associated_content = 1;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (4))\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 1;\n }\n }\n }\n else if ((this.content_classifier) == (5))\n {\n {\n {\n b_associated_content = 1;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (6))\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (7))\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n }\n }\n else\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n for (this.i = 0; this.i < this.frame_rate_factor; this.i++)\n {\n {\n si_b_iframe = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n {\n substream_index = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (substream_index == 3)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n substream_index += this.v;\n }\n }\n }\n {\n this.a_substream_indices.push(substream_index);\n }\n for (this.i = 0; this.i < this.frame_rate_factor; this.i++)\n {\n {\n {\n this.last_referenced_substream = Math.max(this.last_referenced_substream, substream_index + this.i);\n }\n {\n this.referenced_substreams.push(substream_index + this.i);\n }\n {\n if (b_lfe == null)\n {\n b_lfe = new Array((substream_index + 1) + 1).fill(0);\n }\n else if ((b_lfe).length <= substream_index + 1)\n {\n b_lfe.push.apply(b_lfe, new Array((substream_index + 1) - (b_lfe).length + 1).fill(0));\n }\n b_lfe[substream_index + 1] = this.F_channel_mode_contains_LFE(si_channel_mode);\n if (b_lfe[substream_index + 1] == null)\n {\n throw ParseError(\"F_channel_mode_contains_LFE\", \"expected to return a value, returned None\");\n }\n }\n }\n }\n }\n }\n \n F_emdf_protection ()\n {\n var protection_bits_primary;\n var protection_length_secondary;\n var protection_bits_secondary;\n var protection_length_primary;\n {\n {\n protection_length_primary = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n {\n protection_length_secondary = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if ((protection_length_primary) == (0))\n {\n if (1)\n {\n throw \"protection_length_primary == 0 is reserved\";\n }\n }\n else if ((protection_length_primary) == (1))\n {\n {\n this.protection_bits_primary_bits = 8;\n }\n }\n else if ((protection_length_primary) == (2))\n {\n {\n this.protection_bits_primary_bits = 32;\n }\n }\n else if ((protection_length_primary) == (3))\n {\n {\n this.protection_bits_primary_bits = 128;\n }\n }\n {\n protection_bits_primary = this.BAM_source.get(\"\", this.protection_bits_primary_bits);\n this.BAM_g_position += this.protection_bits_primary_bits;\n }\n if ((protection_length_secondary) == (0))\n {\n {\n this.protection_bits_secondary_bits = 0;\n }\n }\n else if ((protection_length_secondary) == (1))\n {\n {\n this.protection_bits_secondary_bits = 8;\n }\n }\n else if ((protection_length_secondary) == (2))\n {\n {\n this.protection_bits_secondary_bits = 32;\n }\n }\n else if ((protection_length_secondary) == (3))\n {\n {\n this.protection_bits_secondary_bits = 128;\n }\n }\n {\n protection_bits_secondary = this.BAM_source.get(\"\", this.protection_bits_secondary_bits);\n this.BAM_g_position += this.protection_bits_secondary_bits;\n }\n }\n }\n \n F_emdf_info ()\n {\n var key_id;\n var b_emdf_payloads_substream_info;\n var emdf_version;\n {\n {\n emdf_version = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (emdf_version == 3)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n emdf_version += this.v;\n }\n }\n }\n {\n key_id = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n if (key_id == 7)\n {\n {\n {\n this.v = this.F_variable_bits(3);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n key_id += this.v;\n }\n }\n }\n {\n b_emdf_payloads_substream_info = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_emdf_payloads_substream_info)\n {\n {\n this.F_emdf_payloads_substream_info(this.toc_i);\n }\n }\n {\n this.F_emdf_protection();\n }\n }\n }\n \n F_emdf_payloads_substream_info (toc_i)\n {\n var substream_index;\n {\n {\n substream_index = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (substream_index == 3)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n substream_index += this.v;\n }\n }\n }\n {\n this.last_referenced_substream = Math.max(this.last_referenced_substream, substream_index);\n }\n {\n this.referenced_substreams.push(substream_index);\n }\n {\n this.a_substream_indices.push(substream_index);\n }\n }\n }\n \n F_ac4_hsf_ext_substream_info (ahsf_b_substreams_present)\n {\n var substream_index;\n {\n if (ahsf_b_substreams_present == 1)\n {\n {\n {\n substream_index = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (substream_index == 3)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n substream_index += this.v;\n }\n }\n }\n }\n }\n else\n {\n {\n {\n substream_index = this.bk_substream_index;\n }\n {\n this.bk_substream_index = this.bk_substream_index + 1;\n }\n }\n }\n if (ahsf_b_substreams_present == 1)\n {\n {\n {\n this.last_referenced_substream = Math.max(this.last_referenced_substream, substream_index);\n }\n {\n this.referenced_substreams.push(substream_index);\n }\n }\n }\n }\n }\n \n F_oamd_common_data ()\n {\n var add_data_bytes_minus1;\n var add_data_bytes;\n var b_additional_data;\n var bits_used;\n var ocd_p1;\n var master_screen_size_ratio;\n var add_data;\n var b_bed_object_chan_distribute;\n var add_data_bits;\n var b_default_screen_size_ratio;\n var ocd_p0;\n {\n {\n b_default_screen_size_ratio = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_default_screen_size_ratio == 0)\n {\n {\n master_screen_size_ratio = this.BAM_source.get(\"\", 5);\n this.BAM_g_position += 5;\n }\n }\n {\n b_bed_object_chan_distribute = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n b_additional_data = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_additional_data)\n {\n {\n {\n add_data_bytes_minus1 = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n add_data_bytes = add_data_bytes_minus1 + 1;\n }\n if (add_data_bytes == 2)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n add_data_bytes += this.v;\n }\n }\n }\n {\n add_data_bits = add_data_bytes * 8;\n }\n {\n ocd_p0 = this.BAM_g_position;\n }\n {\n ocd_p1 = this.BAM_g_position;\n }\n {\n bits_used = ocd_p1 - ocd_p0;\n }\n {\n add_data_bits = add_data_bits - bits_used;\n }\n if (add_data_bits < 0)\n {\n throw \"Wrong add_data_bytes_minus1 size indication\";\n }\n {\n add_data = this.BAM_source.get(\"\", add_data_bits);\n this.BAM_g_position += add_data_bits;\n }\n }\n }\n }\n }\n \n F_define_oamd ()\n {\n var NUM_TRIM_CONFIGS;\n {\n {\n this.OAMD_OBJECT_TYPE_BED = 0;\n }\n {\n this.OAMD_OBJECT_TYPE_ISF = 1;\n }\n {\n this.OAMD_OBJECT_TYPE_DYNAMIC = 2;\n }\n {\n this.OAMD_OBJECT_TYPE_RESERVED = 3;\n }\n {\n NUM_TRIM_CONFIGS = 9;\n }\n }\n }\n \n F_ac4_substream_info_ajoc (asio_group_index, asio_gs_index_ajoc, asio_b_substreams_present)\n {\n var b_oamd_common_data_present;\n var si_b_iframe;\n var b_sf_multiplier;\n var si_channel_mode_j;\n var b_bitrate_info;\n var sf_multiplier;\n var n_fullband_upmix_signals_minus1;\n var b_static_dmx;\n var n_fullband_dmx_signals;\n var n_fullband_dmx_signals_minus1;\n var n_fullband_upmix_signals;\n var num_objects_DYNAMIC = null;\n var num_objects_DYNAMIC;\n var substream_index;\n var ajoc_b_lfe;\n var b_lfe = null;\n var b_lfe;\n {\n {\n num_objects_DYNAMIC = this.BAM_g_table6.slice(0);\n }\n {\n this.F_define_channel_modes();\n }\n {\n ajoc_b_lfe = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n b_static_dmx = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_static_dmx)\n {\n {\n {\n n_fullband_dmx_signals = 5;\n }\n if (ajoc_b_lfe)\n {\n {\n si_channel_mode_j = this.CHANNEL_MODE_51;\n }\n }\n else\n {\n {\n si_channel_mode_j = this.CHANNEL_MODE_50;\n }\n }\n }\n }\n else\n {\n {\n {\n n_fullband_dmx_signals_minus1 = this.BAM_source.get(\"\", 4);\n this.BAM_g_position += 4;\n }\n {\n n_fullband_dmx_signals = n_fullband_dmx_signals_minus1 + 1;\n }\n {\n this.F_bed_dyn_obj_assignment(n_fullband_dmx_signals, 0, ajoc_b_lfe);\n }\n }\n }\n {\n b_oamd_common_data_present = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_oamd_common_data_present)\n {\n {\n this.F_oamd_common_data();\n }\n }\n {\n n_fullband_upmix_signals_minus1 = this.BAM_source.get(\"\", 4);\n this.BAM_g_position += 4;\n }\n {\n n_fullband_upmix_signals = n_fullband_upmix_signals_minus1 + 1;\n }\n if (n_fullband_upmix_signals == 16)\n {\n {\n {\n this.v = this.F_variable_bits(3);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n n_fullband_upmix_signals = n_fullband_upmix_signals + this.v;\n }\n }\n }\n {\n this.F_bed_dyn_obj_assignment(n_fullband_upmix_signals, 1, ajoc_b_lfe);\n }\n if (this.fs_index == 1)\n {\n {\n {\n b_sf_multiplier = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_sf_multiplier)\n {\n {\n sf_multiplier = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n }\n }\n {\n b_bitrate_info = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_bitrate_info)\n {\n {\n this.F_bitrate_indicator();\n }\n }\n {\n this.frame_rate_factor = this.group_frame_rate_factor[asio_group_index];\n }\n for (this.i = 0; this.i < this.frame_rate_factor; this.i++)\n {\n {\n si_b_iframe = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n if (asio_b_substreams_present == 1)\n {\n {\n {\n substream_index = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (substream_index == 3)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n substream_index += this.v;\n }\n }\n }\n }\n }\n else\n {\n {\n {\n substream_index = this.bk_substream_index;\n }\n {\n this.bk_substream_index = this.bk_substream_index + 1;\n }\n }\n }\n {\n this.a_substream_indices.push(substream_index);\n }\n for (this.i = 0; this.i < this.frame_rate_factor; this.i++)\n {\n {\n if (asio_b_substreams_present == 1)\n {\n {\n {\n this.last_referenced_substream = Math.max(this.last_referenced_substream, substream_index + this.i);\n }\n {\n this.referenced_substreams.push(substream_index + this.i);\n }\n }\n }\n {\n if (b_lfe == null)\n {\n b_lfe = new Array((substream_index + this.i) + 1).fill(0);\n }\n else if ((b_lfe).length <= substream_index + this.i)\n {\n b_lfe.push.apply(b_lfe, new Array((substream_index + this.i) - (b_lfe).length + 1).fill(0));\n }\n b_lfe[substream_index + this.i] = ajoc_b_lfe;\n }\n }\n }\n }\n }\n \n F_ac4_sgi_specifier (asgi_b_associated, asgi_b_dialog, group_in_presentation_index)\n {\n var group_index;\n {\n if (this.bitstream_version == 1)\n {\n {\n {\n this.F_ac4_substream_group_info(this.toc_j);\n }\n {\n this.toc_j += 1;\n }\n }\n }\n else\n {\n {\n {\n group_index = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n if (group_index == 7)\n {\n {\n {\n this.vb = this.F_variable_bits(2);\n if (this.vb == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n group_index += this.vb;\n }\n }\n }\n {\n if (this.presentation_to_groups == null)\n {\n this.presentation_to_groups = new Array((this.toc_i) + 1).fill(null);\n }\n else if ((this.presentation_to_groups).length <= this.toc_i)\n {\n this.presentation_to_groups.push.apply(this.presentation_to_groups, new Array((this.toc_i) - (this.presentation_to_groups).length + 1).fill(null));\n }\n this.presentation_to_groups[this.toc_i].push(group_index);\n }\n {\n if (this.group_frame_rate_factor == null)\n {\n this.group_frame_rate_factor = new Array((group_index) + 1).fill(0);\n }\n else if ((this.group_frame_rate_factor).length <= group_index)\n {\n this.group_frame_rate_factor.push.apply(this.group_frame_rate_factor, new Array((group_index) - (this.group_frame_rate_factor).length + 1).fill(0));\n }\n this.group_frame_rate_factor[group_index] = this.frame_rate_factor;\n }\n }\n }\n }\n }\n \n F_ac4_substream_group_info (si_group_index)\n {\n var b_channel_coded;\n var sus_ver;\n var b_ajoc;\n var sus;\n var b_dialog_content;\n var n_lf_substreams_minus2;\n var obj_index;\n var b_associated_content;\n var b_oamd_substream;\n var n_lf_substreams;\n var b_substreams_present;\n var b_content_type;\n {\n {\n b_substreams_present = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n this.b_hsf_ext = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n this.b_single_substream = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (this.b_single_substream)\n {\n {\n n_lf_substreams = 1;\n }\n }\n else\n {\n {\n {\n n_lf_substreams_minus2 = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n {\n n_lf_substreams = n_lf_substreams_minus2 + 2;\n }\n if (n_lf_substreams == 5)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n n_lf_substreams += this.v;\n }\n }\n }\n }\n }\n {\n b_channel_coded = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n this.n_bed_objects = -1;\n }\n {\n this.a_num_bed_objects = [];\n }\n if (b_channel_coded)\n {\n {\n {\n b_ajoc = 0;\n }\n for (sus = 0; sus < n_lf_substreams; sus++)\n {\n {\n if (this.bitstream_version == 1)\n {\n {\n sus_ver = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n else\n {\n {\n sus_ver = 1;\n }\n }\n {\n this.F_ac4_substream_info_chan(si_group_index, sus, b_substreams_present);\n }\n if (this.b_hsf_ext)\n {\n {\n this.F_ac4_hsf_ext_substream_info(b_substreams_present);\n }\n }\n }\n }\n }\n }\n else\n {\n {\n {\n b_oamd_substream = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_oamd_substream)\n {\n {\n this.F_oamd_substream_info(b_substreams_present);\n }\n }\n {\n obj_index = 0;\n }\n {\n this.b_bed_objects_prev = 0;\n }\n for (sus = 0; sus < n_lf_substreams; sus++)\n {\n {\n {\n b_ajoc = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_ajoc)\n {\n {\n {\n this.F_ac4_substream_info_ajoc(si_group_index, sus, b_substreams_present);\n }\n if (this.b_hsf_ext)\n {\n {\n this.F_ac4_hsf_ext_substream_info(b_substreams_present);\n }\n }\n }\n }\n else\n {\n {\n {\n this.F_ac4_substream_info_obj(si_group_index, sus, obj_index, b_substreams_present);\n }\n {\n obj_index += 1;\n }\n if (this.b_hsf_ext)\n {\n {\n this.F_ac4_hsf_ext_substream_info(b_substreams_present);\n }\n }\n }\n }\n }\n }\n }\n }\n {\n b_content_type = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_content_type)\n {\n {\n {\n this.F_content_type();\n }\n if ((this.content_classifier) == (0))\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (1))\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (2))\n {\n {\n {\n b_associated_content = 1;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (3))\n {\n {\n {\n b_associated_content = 1;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (4))\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 1;\n }\n }\n }\n else if ((this.content_classifier) == (5))\n {\n {\n {\n b_associated_content = 1;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (6))\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n else if ((this.content_classifier) == (7))\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n }\n }\n else\n {\n {\n {\n b_associated_content = 0;\n }\n {\n b_dialog_content = 0;\n }\n }\n }\n }\n }\n \n F_oamd_substream_info (oamd_b_substreams_present)\n {\n var b_iframe_oamd;\n var substream_index;\n {\n {\n this.F_define_oamd();\n }\n {\n b_iframe_oamd = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (oamd_b_substreams_present == 1)\n {\n {\n {\n substream_index = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (substream_index == 3)\n {\n {\n {\n this.vb = this.F_variable_bits(2);\n if (this.vb == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n substream_index += this.vb;\n }\n }\n }\n }\n }\n else\n {\n {\n {\n substream_index = this.bk_substream_index;\n }\n {\n this.bk_substream_index = this.bk_substream_index + 1;\n }\n }\n }\n if (oamd_b_substreams_present == 1)\n {\n {\n {\n this.last_referenced_substream = Math.max(this.last_referenced_substream, substream_index);\n }\n {\n this.referenced_substreams.push(substream_index);\n }\n }\n }\n }\n }\n \n F_ac4_substream_info_obj (asio_group_index, asio_gs_index, asio_gs_index_obj, asio_b_substreams_present)\n {\n var si_b_lfe;\n var si_b_iframe;\n var reserved_data;\n var n_objects_code;\n var b_isf_start;\n var b_sf_multiplier;\n var obj_type;\n var b_bed_start;\n var j;\n var isf_config;\n var n_objs;\n var res_bytes;\n var b_ch_assign_code;\n var b_dynamic_objects;\n var std_bed_channel_assignment_mask;\n var nonstd_bed_channel_assignment_mask;\n var b_bitrate_info;\n var b_bed_objects;\n var bed_chan_assign_code;\n var sf_multiplier;\n var si_num_channels;\n var b_isf;\n var b_nonstd_bed_channel_assignment;\n var substream_index;\n var b_lfe = null;\n var b_lfe;\n {\n {\n n_objs = 0;\n }\n {\n this.F_define_oamd();\n }\n {\n this.F_define_channel_modes();\n }\n {\n n_objects_code = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n {\n si_num_channels = this.BAM_g_table7.slice(0)[n_objects_code];\n }\n {\n b_dynamic_objects = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_dynamic_objects)\n {\n {\n {\n si_b_lfe = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n obj_type = this.OAMD_OBJECT_TYPE_DYNAMIC;\n }\n {\n this.b_bed_objects_prev = 0;\n }\n }\n }\n else\n {\n {\n {\n b_bed_objects = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_bed_objects)\n {\n {\n if (this.b_bed_objects_prev && this.num_lfe == 2)\n {\n {\n si_b_lfe = 1;\n }\n }\n else\n {\n {\n si_b_lfe = 0;\n }\n }\n {\n this.b_bed_objects_prev = 1;\n }\n {\n this.num_lfe = 0;\n }\n {\n obj_type = this.OAMD_OBJECT_TYPE_BED;\n }\n {\n b_bed_start = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_bed_start)\n {\n {\n {\n b_ch_assign_code = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_ch_assign_code)\n {\n {\n {\n bed_chan_assign_code = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n for (this.i = 0; this.i < this.BAM_g_table8.slice(0)[bed_chan_assign_code]; this.i++)\n {\n {\n n_objs += 1;\n }\n }\n if (bed_chan_assign_code >= 2)\n {\n {\n si_b_lfe = 1;\n }\n }\n }\n }\n else\n {\n {\n {\n b_nonstd_bed_channel_assignment = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_nonstd_bed_channel_assignment)\n {\n {\n {\n nonstd_bed_channel_assignment_mask = this.BAM_source.get(\"\", 17);\n this.BAM_g_position += 17;\n }\n for (this.i = 0; this.i < 17; this.i++)\n {\n if ((nonstd_bed_channel_assignment_mask & 1 << this.i) != 0)\n {\n {\n if (this.i == 3 || this.i == 16)\n {\n {\n this.num_lfe += 1;\n }\n }\n {\n n_objs += 1;\n }\n }\n }\n }\n }\n }\n else\n {\n {\n {\n std_bed_channel_assignment_mask = this.BAM_source.get(\"\", 10);\n this.BAM_g_position += 10;\n }\n for (this.i = 0; this.i < 10; this.i++)\n {\n if ((std_bed_channel_assignment_mask & 1 << this.i) != 0)\n {\n for (j = 0; j < this.BAM_g_table9.slice(0)[this.i]; j++)\n {\n {\n if (this.i == 2 || this.i == 9)\n {\n {\n this.num_lfe += 1;\n }\n }\n {\n n_objs += 1;\n }\n }\n }\n }\n }\n }\n }\n if (this.num_lfe > 0)\n {\n {\n si_b_lfe = 1;\n }\n }\n }\n }\n {\n this.n_bed_objects = n_objs;\n }\n {\n this.a_num_bed_objects.push(this.n_bed_objects);\n }\n }\n }\n }\n }\n else\n {\n {\n {\n si_b_lfe = 0;\n }\n {\n this.b_bed_objects_prev = 0;\n }\n {\n b_isf = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_isf)\n {\n {\n {\n obj_type = this.OAMD_OBJECT_TYPE_ISF;\n }\n {\n b_isf_start = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_isf_start)\n {\n {\n isf_config = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n }\n }\n }\n else\n {\n {\n {\n res_bytes = this.BAM_source.get(\"\", 4);\n this.BAM_g_position += 4;\n }\n {\n reserved_data = this.BAM_source.get(\"\", 8 * res_bytes);\n this.BAM_g_position += 8 * res_bytes;\n }\n {\n obj_type = this.OAMD_OBJECT_TYPE_RESERVED;\n }\n if (si_num_channels == 0)\n {\n throw \"No non-LFE objects (of OAMD_OBJECT_TYPE_RESERVED) in substream!\";\n }\n }\n }\n }\n }\n }\n }\n if (this.fs_index == 1)\n {\n {\n {\n b_sf_multiplier = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_sf_multiplier)\n {\n {\n sf_multiplier = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n }\n }\n {\n b_bitrate_info = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_bitrate_info)\n {\n {\n this.F_bitrate_indicator();\n }\n }\n {\n this.frame_rate_factor = this.group_frame_rate_factor[asio_group_index];\n }\n for (this.i = 0; this.i < this.frame_rate_factor; this.i++)\n {\n {\n si_b_iframe = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n if (asio_b_substreams_present == 1)\n {\n {\n {\n substream_index = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (substream_index == 3)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n substream_index += this.v;\n }\n }\n }\n }\n }\n else\n {\n {\n {\n substream_index = this.bk_substream_index;\n }\n {\n this.bk_substream_index = this.bk_substream_index + 1;\n }\n }\n }\n {\n this.a_substream_indices.push(substream_index);\n }\n for (this.i = 0; this.i < this.frame_rate_factor; this.i++)\n {\n {\n if (asio_b_substreams_present == 1)\n {\n {\n {\n this.last_referenced_substream = Math.max(this.last_referenced_substream, substream_index + this.i);\n }\n {\n this.referenced_substreams.push(substream_index + this.i);\n }\n }\n }\n {\n if (b_lfe == null)\n {\n b_lfe = new Array((substream_index + this.i) + 1).fill(0);\n }\n else if ((b_lfe).length <= substream_index + this.i)\n {\n b_lfe.push.apply(b_lfe, new Array((substream_index + this.i) - (b_lfe).length + 1).fill(0));\n }\n b_lfe[substream_index + this.i] = si_b_lfe;\n }\n }\n }\n }\n }\n \n F_bed_dyn_obj_assignment (n_signals, b_upmix, bd_lfe)\n {\n var b_ch_assign_code;\n var b_chan_assign_mask;\n var std_bed_channel_assignment_mask;\n var lfe_signalled;\n var nonstd_bed_channel_assignment_mask;\n var obj_type;\n var b_is_isf;\n var n_isf;\n var bed_ch_bits;\n var b_dyn_objects_only;\n var nonstd_bed_channel_assignment;\n var isf_config;\n var bed_chan_assign_code;\n var oc_num_channels;\n var n_bed_signals_minus1;\n var n_bed_signals;\n var b_nonstd_bed_channel_assignment;\n var b;\n {\n {\n this.F_define_oamd();\n }\n {\n lfe_signalled = 0;\n }\n {\n b_dyn_objects_only = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_dyn_objects_only == 0)\n {\n {\n {\n b_is_isf = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_is_isf)\n {\n {\n {\n isf_config = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n {\n obj_type = this.OAMD_OBJECT_TYPE_ISF;\n }\n {\n n_isf = this.BAM_g_table10.slice(0)[isf_config];\n }\n }\n }\n else\n {\n {\n {\n obj_type = this.OAMD_OBJECT_TYPE_BED;\n }\n {\n b_ch_assign_code = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_ch_assign_code)\n {\n {\n {\n bed_chan_assign_code = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n if ((this.BAM_g_table11.slice(0).indexOf(bed_chan_assign_code) >= 0))\n {\n {\n lfe_signalled = 1;\n }\n }\n }\n }\n else\n {\n {\n {\n b_chan_assign_mask = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_chan_assign_mask)\n {\n {\n {\n b_nonstd_bed_channel_assignment = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_nonstd_bed_channel_assignment)\n {\n {\n {\n nonstd_bed_channel_assignment_mask = this.BAM_source.get(\"\", 17);\n this.BAM_g_position += 17;\n }\n for (this.i = 0; this.i < 17; this.i++)\n {\n if (nonstd_bed_channel_assignment_mask >> this.i & 1)\n {\n if (this.i == 3 || this.i == 16)\n {\n {\n lfe_signalled = 1;\n }\n }\n }\n }\n }\n }\n else\n {\n {\n {\n std_bed_channel_assignment_mask = this.BAM_source.get(\"\", 10);\n this.BAM_g_position += 10;\n }\n for (this.i = 0; this.i < 10; this.i++)\n {\n if (std_bed_channel_assignment_mask >> this.i & 1)\n {\n {\n if (this.i == 2 || this.i == 9)\n {\n {\n lfe_signalled = 1;\n }\n }\n {\n oc_num_channels = this.BAM_g_table12.slice(0)[this.i];\n }\n }\n }\n }\n }\n }\n }\n }\n else\n {\n {\n if (n_signals > 1)\n {\n {\n {\n bed_ch_bits = Math.ceil(Math.log(n_signals) / Math.log(2));\n }\n {\n n_bed_signals_minus1 = this.BAM_source.get(\"\", bed_ch_bits);\n this.BAM_g_position += bed_ch_bits;\n }\n {\n n_bed_signals = n_bed_signals_minus1 + 1;\n }\n }\n }\n else\n {\n {\n n_bed_signals = 1;\n }\n }\n for (b = 0; b < n_bed_signals; b++)\n {\n {\n {\n nonstd_bed_channel_assignment = this.BAM_source.get(\"\", 4);\n this.BAM_g_position += 4;\n }\n if (n_bed_signals == 3 || n_bed_signals == 16)\n {\n {\n lfe_signalled = 1;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n \n F_ac4_presentation_substream_info (aps_presentation_version)\n {\n var b_alternative;\n var b_iframe_pres;\n var substream_index;\n var b_lfe = null;\n var b_lfe;\n {\n {\n b_alternative = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n b_iframe_pres = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n substream_index = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (substream_index == 3)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n substream_index += this.v;\n }\n }\n }\n {\n if (b_lfe == null)\n {\n b_lfe = new Array((substream_index) + 1).fill(0);\n }\n else if ((b_lfe).length <= substream_index)\n {\n b_lfe.push.apply(b_lfe, new Array((substream_index) - (b_lfe).length + 1).fill(0));\n }\n b_lfe[substream_index] = 0;\n }\n {\n this.last_referenced_substream = Math.max(this.last_referenced_substream, substream_index);\n }\n {\n this.referenced_substreams.push(substream_index);\n }\n }\n }\n \n F_presentation_version ()\n {\n var b_tmp;\n var val;\n {\n {\n val = 0;\n }\n {\n b_tmp = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n while (b_tmp)\n {\n {\n {\n val = val + 1;\n }\n {\n b_tmp = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n }\n return val;\n }\n }\n \n F_get_ch_mode (cm)\n {\n {\n if ((cm) == (this.CHANNEL_MODE_MONO))\n {\n {\n this.n = 0;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_STEREO))\n {\n {\n this.n = 1;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_30))\n {\n {\n this.n = 2;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_50))\n {\n {\n this.n = 3;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_51))\n {\n {\n this.n = 4;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_70_34))\n {\n {\n this.n = 5;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_71_34))\n {\n {\n this.n = 6;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_70_52))\n {\n {\n this.n = 7;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_71_52))\n {\n {\n this.n = 8;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_70_322))\n {\n {\n this.n = 9;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_71_322))\n {\n {\n this.n = 10;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_704))\n {\n {\n this.n = 11;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_714))\n {\n {\n this.n = 12;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_904))\n {\n {\n this.n = 13;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_914))\n {\n {\n this.n = 14;\n }\n }\n else\n {\n if (1)\n {\n throw \"Unknown channel mode!\";\n }\n }\n return this.n;\n }\n }\n \n F_presentation_config_ext_info ()\n {\n {\n {\n this.n_skip_bytes = this.BAM_source.get(\"\", 5);\n this.BAM_g_position += 5;\n }\n {\n this.b_more_skip_bytes = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (this.b_more_skip_bytes)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n this.n_skip_bytes += this.v << 5;\n }\n }\n }\n if (0)\n {\n {\n {\n this.n_bits_read_0 = this.BAM_g_position;\n }\n {\n this.F_ac4_presentation_v2_info(this.toc_i);\n }\n {\n this.n_bits_read_1 = this.BAM_g_position;\n }\n {\n this.n_bits_read = this.n_bits_read_1 - this.n_bits_read_0;\n }\n if (((n_bits_read % 8) + 8) % 8)\n {\n {\n {\n this.n_skip_bits = 8 - ((n_bits_read % 8) + 8) % 8;\n }\n {\n this.reserved = this.BAM_source.get(\"\", this.n_skip_bits);\n this.BAM_g_position += this.n_skip_bits;\n }\n {\n this.n_bits_read += this.n_skip_bits;\n }\n }\n }\n {\n this.n_skip_bytes = this.n_skip_bytes - Math.floor(this.n_bits_read / 8);\n }\n }\n }\n if (this.bitstream_version >= 1 && this.presentation_config == 8)\n {\n {\n {\n this.n_bits_read_0 = this.BAM_g_position;\n }\n {\n this.n_bits_read_1 = this.BAM_g_position;\n }\n {\n this.padding = this.BAM_source.get(\"\", this.n_skip_bytes * 8 - (this.n_bits_read_1 - this.n_bits_read_0));\n this.BAM_g_position += this.n_skip_bytes * 8 - (this.n_bits_read_1 - this.n_bits_read_0);\n }\n }\n }\n else\n {\n for (this.i = 0; this.i < this.n_skip_bytes; this.i++)\n {\n {\n this.reserved = this.BAM_source.get(\"\", 8);\n this.BAM_g_position += 8;\n }\n }\n }\n }\n }\n \n F_define_channel_modes ()\n {\n var CHANNEL_MODE_7X_52 = null;\n var CHANNEL_MODE_7X_52;\n var CHANNEL_MODE_5X = null;\n var CHANNEL_MODE_5X;\n var CHANNEL_MODE_7X_34 = null;\n var CHANNEL_MODE_7X_34;\n var CHANNEL_MODE_7X = null;\n var CHANNEL_MODE_7X;\n var CHANNEL_MODE_7X_322 = null;\n var CHANNEL_MODE_7X_322;\n {\n {\n this.CHANNEL_MODE_MONO = 0;\n }\n {\n this.CHANNEL_MODE_STEREO = 2;\n }\n {\n this.CHANNEL_MODE_30 = 12;\n }\n {\n this.CHANNEL_MODE_50 = 13;\n }\n {\n this.CHANNEL_MODE_51 = 14;\n }\n {\n this.CHANNEL_MODE_70_34 = 120;\n }\n {\n this.CHANNEL_MODE_71_34 = 121;\n }\n {\n this.CHANNEL_MODE_70_52 = 122;\n }\n {\n this.CHANNEL_MODE_71_52 = 123;\n }\n {\n this.CHANNEL_MODE_70_322 = 124;\n }\n {\n this.CHANNEL_MODE_71_322 = 125;\n }\n {\n this.CHANNEL_MODE_704 = 252;\n }\n {\n this.CHANNEL_MODE_714 = 253;\n }\n {\n this.CHANNEL_MODE_904 = 508;\n }\n {\n this.CHANNEL_MODE_914 = 509;\n }\n {\n this.CHANNEL_MODE_222 = 510;\n }\n {\n CHANNEL_MODE_5X = [this.CHANNEL_MODE_50, this.CHANNEL_MODE_51];\n }\n {\n CHANNEL_MODE_7X_34 = [this.CHANNEL_MODE_70_34, this.CHANNEL_MODE_71_34];\n }\n {\n CHANNEL_MODE_7X_52 = [this.CHANNEL_MODE_70_52, this.CHANNEL_MODE_71_52];\n }\n {\n CHANNEL_MODE_7X_322 = [this.CHANNEL_MODE_70_322, this.CHANNEL_MODE_71_322];\n }\n {\n CHANNEL_MODE_7X = CHANNEL_MODE_7X_34 + CHANNEL_MODE_7X_52 + CHANNEL_MODE_7X_322;\n }\n }\n }\n \n F_channel_mode_to_ch_mode (cm)\n {\n {\n if ((cm) == (this.CHANNEL_MODE_MONO))\n {\n return 0;\n }\n else if ((cm) == (this.CHANNEL_MODE_STEREO))\n {\n return 1;\n }\n else if ((cm) == (this.CHANNEL_MODE_30))\n {\n return 2;\n }\n else if ((cm) == (this.CHANNEL_MODE_50))\n {\n return 3;\n }\n else if ((cm) == (this.CHANNEL_MODE_51))\n {\n return 4;\n }\n else if ((cm) == (this.CHANNEL_MODE_70_34))\n {\n return 5;\n }\n else if ((cm) == (this.CHANNEL_MODE_71_34))\n {\n return 6;\n }\n else if ((cm) == (this.CHANNEL_MODE_70_52))\n {\n return 7;\n }\n else if ((cm) == (this.CHANNEL_MODE_71_52))\n {\n return 8;\n }\n else if ((cm) == (this.CHANNEL_MODE_70_322))\n {\n return 9;\n }\n else if ((cm) == (this.CHANNEL_MODE_71_322))\n {\n return 10;\n }\n else if ((cm) == (this.CHANNEL_MODE_704))\n {\n return 11;\n }\n else if ((cm) == (this.CHANNEL_MODE_714))\n {\n return 12;\n }\n else if ((cm) == (this.CHANNEL_MODE_904))\n {\n return 13;\n }\n else if ((cm) == (this.CHANNEL_MODE_914))\n {\n return 14;\n }\n else if ((cm) == (this.CHANNEL_MODE_222))\n {\n return 15;\n }\n else\n {\n if (1)\n {\n throw \"Cannot convert extended channel mode to ch_mode!\";\n }\n }\n }\n }\n \n F_variable_bits (n_bits)\n {\n var value;\n var read;\n var b_read_more;\n {\n {\n value = 0;\n }\n {\n b_read_more = 1;\n }\n while (b_read_more)\n {\n {\n {\n read = this.BAM_source.get(\"\", n_bits);\n this.BAM_g_position += n_bits;\n }\n {\n value += read;\n }\n {\n b_read_more = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_read_more)\n {\n {\n {\n value <<= n_bits;\n }\n {\n value += 1 << n_bits;\n }\n }\n }\n }\n }\n return value;\n }\n }\n \n F_raw_ac4_frame_toc_only ()\n {\n var frame_len_base;\n var ac4_toc_begin;\n var ac4_toc_end;\n {\n {\n ac4_toc_begin = this.BAM_g_position;\n }\n {\n this.F_ac4_toc();\n }\n {\n ac4_toc_end = this.BAM_g_position;\n this.BAM_sink.after_position(\"ac4_toc_end\", ac4_toc_end);\n }\n {\n frame_len_base = this.BAM_g_table13.slice(0)[this.frame_rate_index];\n }\n }\n }\n \n F_ac4_presentation_info ()\n {\n {\n {\n this.b_single_substream = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (this.b_single_substream != 1)\n {\n {\n {\n this.presentation_config = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n if (this.presentation_config == 7)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n this.presentation_config += this.v;\n }\n }\n }\n }\n }\n {\n this.presentation_version = this.F_presentation_version();\n if (this.presentation_version == null)\n {\n throw ParseError(\"F_presentation_version\", \"expected to return a value, returned None\");\n }\n }\n if (this.b_single_substream != 1 && this.presentation_config == 6)\n {\n {\n this.b_add_emdf_substreams = 1;\n }\n }\n else\n {\n {\n {\n this.presentation_level = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n this.BAM_sink.write_uint(\"presentation_level\", 3, this.presentation_level, this.BAM_g_position);\n }\n {\n this.b_presentation_id = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n this.BAM_sink.write_uint(\"b_presentation_id\", 1, this.b_presentation_id, this.BAM_g_position);\n }\n if (this.b_presentation_id)\n {\n {\n this.BAM_sink.before_call(\"variable_bits\", [2], \"presentation_id\", this.BAM_g_position);\n this.presentation_id = this.F_variable_bits(2);\n if (this.presentation_id == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n this.BAM_sink.after_call(\"variable_bits\", this.presentation_id, \"presentation_id\", this.BAM_g_position);\n }\n }\n {\n this.F_frame_rate_multiply_info();\n }\n {\n this.F_emdf_info();\n }\n if (this.b_single_substream == 1)\n {\n {\n this.F_ac4_substream_info(0, 0, 0);\n }\n }\n else\n {\n {\n {\n this.b_hsf_ext = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if ((this.presentation_config) == (0))\n {\n {\n {\n this.F_ac4_substream_info(0, 0, 0);\n }\n if (this.b_hsf_ext)\n {\n {\n this.F_ac4_hsf_ext_substream_info(1);\n }\n }\n {\n this.F_ac4_substream_info(0, 1, 1);\n }\n }\n }\n else if ((this.presentation_config) == (1))\n {\n {\n {\n this.F_ac4_substream_info(0, 0, 0);\n }\n if (this.b_hsf_ext)\n {\n {\n this.F_ac4_hsf_ext_substream_info(1);\n }\n }\n {\n this.F_ac4_substream_info(0, 0, 1);\n }\n }\n }\n else if ((this.presentation_config) == (2))\n {\n {\n {\n this.F_ac4_substream_info(0, 0, 0);\n }\n if (this.b_hsf_ext)\n {\n {\n this.F_ac4_hsf_ext_substream_info(1);\n }\n }\n {\n this.F_ac4_substream_info(1, 0, 1);\n }\n }\n }\n else if ((this.presentation_config) == (3))\n {\n {\n {\n this.F_ac4_substream_info(0, 0, 0);\n }\n if (this.b_hsf_ext)\n {\n {\n this.F_ac4_hsf_ext_substream_info(1);\n }\n }\n {\n this.F_ac4_substream_info(0, 1, 1);\n }\n {\n this.F_ac4_substream_info(1, 0, 2);\n }\n }\n }\n else if ((this.presentation_config) == (4))\n {\n {\n {\n this.F_ac4_substream_info(0, 0, 0);\n }\n if (this.b_hsf_ext)\n {\n {\n this.F_ac4_hsf_ext_substream_info(1);\n }\n }\n {\n this.F_ac4_substream_info(0, 0, 1);\n }\n {\n this.F_ac4_substream_info(1, 0, 2);\n }\n }\n }\n else if ((this.presentation_config) == (5))\n {\n {\n {\n this.F_ac4_substream_info(0, 0, 0);\n }\n if (this.b_hsf_ext)\n {\n {\n this.F_ac4_hsf_ext_substream_info(1);\n }\n }\n }\n }\n else\n {\n {\n this.F_presentation_config_ext_info();\n }\n }\n }\n }\n {\n this.b_pre_virtualized = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n this.b_add_emdf_substreams = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n }\n if (this.b_add_emdf_substreams)\n {\n {\n {\n this.n_add_emdf_substreams = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (this.n_add_emdf_substreams == 0)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n this.n_add_emdf_substreams = this.v + 4;\n }\n }\n }\n for (this.pi_i = 0; this.pi_i < this.n_add_emdf_substreams; this.pi_i++)\n {\n {\n this.F_emdf_info();\n }\n }\n }\n }\n }\n }\n \n F_substream_index_table ()\n {\n var substream_type = null;\n var substream_type;\n var b_size_present;\n var n_substreams;\n var b_substream_type_known = null;\n var b_substream_type_known;\n var substream_size = null;\n var substream_size;\n var b_more_bits;\n var s;\n {\n {\n n_substreams = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (n_substreams == 0)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n n_substreams = this.v + 4;\n }\n }\n }\n if (n_substreams - 1 < this.last_referenced_substream)\n {\n throw \"Number of substreams (n_substreams) indicated by substream_index_table is less than last referenced substream in TOC (last_referenced_substream).\";\n }\n if (n_substreams - 1 > this.last_referenced_substream)\n {\n {\n {\n if (b_substream_type_known == null)\n {\n b_substream_type_known = new Array((n_substreams - 1) + 1).fill(0);\n }\n else if ((b_substream_type_known).length <= n_substreams - 1)\n {\n b_substream_type_known.push.apply(b_substream_type_known, new Array((n_substreams - 1) - (b_substream_type_known).length + 1).fill(0));\n }\n b_substream_type_known[n_substreams - 1] = 0;\n }\n {\n if (substream_type == null)\n {\n substream_type = new Array((n_substreams - 1) + 1).fill(null);\n }\n else if ((substream_type).length <= n_substreams - 1)\n {\n substream_type.push.apply(substream_type, new Array((n_substreams - 1) - (substream_type).length + 1).fill(null));\n }\n substream_type[n_substreams - 1] = \"unknown\";\n }\n }\n }\n if (n_substreams == 1)\n {\n {\n b_size_present = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n else\n {\n {\n b_size_present = 1;\n }\n }\n if (b_size_present)\n {\n for (s = 0; s < n_substreams; s++)\n {\n {\n {\n b_more_bits = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n if (substream_size == null)\n {\n substream_size = new Array((s) + 1).fill(0);\n }\n else if ((substream_size).length <= s)\n {\n substream_size.push.apply(substream_size, new Array((s) - (substream_size).length + 1).fill(0));\n }\n substream_size[s] = this.BAM_source.get(\"\", 10);\n this.BAM_g_position += 10;\n }\n if (b_more_bits)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n if (substream_size == null)\n {\n substream_size = new Array((s) + 1).fill(0);\n }\n else if ((substream_size).length <= s)\n {\n substream_size.push.apply(substream_size, new Array((s) - (substream_size).length + 1).fill(0));\n }\n substream_size[s] += this.v << 10;\n }\n }\n }\n }\n }\n }\n }\n }\n \n F_ac4_presentation_v2_info (apv_toc_i)\n {\n {\n {\n if (this.presentation_to_groups == null)\n {\n this.presentation_to_groups = new Array((this.toc_i) + 1).fill(null);\n }\n else if ((this.presentation_to_groups).length <= this.toc_i)\n {\n this.presentation_to_groups.push.apply(this.presentation_to_groups, new Array((this.toc_i) - (this.presentation_to_groups).length + 1).fill(null));\n }\n this.presentation_to_groups[this.toc_i] = [];\n }\n {\n this.b_single_substream_group = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (this.b_single_substream_group != 1)\n {\n {\n {\n this.presentation_config = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n if (this.presentation_config == 7)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n this.presentation_config += this.v;\n }\n }\n }\n }\n }\n if (this.bitstream_version != 1)\n {\n {\n this.presentation_version = this.F_presentation_version();\n if (this.presentation_version == null)\n {\n throw ParseError(\"F_presentation_version\", \"expected to return a value, returned None\");\n }\n }\n }\n if (this.b_single_substream_group != 1 && this.presentation_config == 6)\n {\n {\n this.b_add_emdf_substreams = 1;\n }\n }\n else\n {\n {\n if (this.bitstream_version != 1)\n {\n {\n this.presentation_level = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n this.BAM_sink.write_uint(\"presentation_level\", 3, this.presentation_level, this.BAM_g_position);\n }\n }\n {\n this.b_presentation_id = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n this.BAM_sink.write_uint(\"b_presentation_id\", 1, this.b_presentation_id, this.BAM_g_position);\n }\n if (this.b_presentation_id)\n {\n {\n this.BAM_sink.before_call(\"variable_bits\", [2], \"presentation_id\", this.BAM_g_position);\n this.presentation_id = this.F_variable_bits(2);\n if (this.presentation_id == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n this.BAM_sink.after_call(\"variable_bits\", this.presentation_id, \"presentation_id\", this.BAM_g_position);\n }\n }\n {\n this.F_frame_rate_multiply_info();\n }\n {\n this.F_frame_rate_fractions_info();\n }\n {\n this.F_emdf_info();\n }\n {\n this.b_presentation_filter = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (this.b_presentation_filter)\n {\n {\n this.b_enable_presentation = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n }\n if (this.b_single_substream_group == 1)\n {\n {\n {\n this.F_ac4_sgi_specifier(0, 0, 0);\n }\n {\n this.n_substream_groups = 1;\n }\n }\n }\n else\n {\n {\n {\n this.b_multi_pid = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if ((this.presentation_config) == (0))\n {\n {\n {\n this.F_ac4_sgi_specifier(0, 0, 0);\n }\n {\n this.F_ac4_sgi_specifier(0, 1, 1);\n }\n {\n this.n_substream_groups = 2;\n }\n }\n }\n else if ((this.presentation_config) == (1))\n {\n {\n {\n this.F_ac4_sgi_specifier(0, 0, 0);\n }\n {\n this.F_ac4_sgi_specifier(0, 0, 1);\n }\n {\n this.n_substream_groups = 1;\n }\n }\n }\n else if ((this.presentation_config) == (2))\n {\n {\n {\n this.F_ac4_sgi_specifier(0, 0, 0);\n }\n {\n this.F_ac4_sgi_specifier(1, 0, 1);\n }\n {\n this.n_substream_groups = 2;\n }\n }\n }\n else if ((this.presentation_config) == (3))\n {\n {\n {\n this.F_ac4_sgi_specifier(0, 0, 0);\n }\n {\n this.F_ac4_sgi_specifier(0, 1, 1);\n }\n {\n this.F_ac4_sgi_specifier(1, 0, 2);\n }\n {\n this.n_substream_groups = 3;\n }\n }\n }\n else if ((this.presentation_config) == (4))\n {\n {\n {\n this.F_ac4_sgi_specifier(0, 0, 0);\n }\n {\n this.F_ac4_sgi_specifier(0, 0, 1);\n }\n {\n this.F_ac4_sgi_specifier(1, 0, 2);\n }\n {\n this.n_substream_groups = 2;\n }\n }\n }\n else if ((this.presentation_config) == (5))\n {\n {\n {\n this.n_substream_groups_minus2 = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n {\n this.n_substream_groups = this.n_substream_groups_minus2 + 2;\n }\n if (this.n_substream_groups == 5)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n this.n_substream_groups += this.v;\n }\n }\n }\n for (this.sg = 0; this.sg < this.n_substream_groups; this.sg++)\n {\n {\n this.F_ac4_sgi_specifier(0, 0, 0);\n }\n }\n }\n }\n else\n {\n {\n {\n this.n_substream_groups = 0;\n }\n {\n this.F_presentation_config_ext_info();\n }\n }\n }\n }\n }\n {\n this.b_pre_virtualized = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n this.b_add_emdf_substreams = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n this.F_ac4_presentation_substream_info(this.presentation_version);\n }\n }\n }\n if (this.b_add_emdf_substreams)\n {\n {\n {\n this.n_add_emdf_substreams = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (this.n_add_emdf_substreams == 0)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n this.n_add_emdf_substreams = this.v + 4;\n }\n }\n }\n for (this.pi_i = 0; this.pi_i < this.n_add_emdf_substreams; this.pi_i++)\n {\n {\n this.F_emdf_info();\n }\n }\n }\n }\n }\n }\n \n F_frame_size ()\n {\n var frame_size;\n {\n {\n frame_size = this.BAM_source.get(\"\", 16);\n this.BAM_g_position += 16;\n }\n if (frame_size == 65535)\n {\n {\n frame_size = this.BAM_source.get(\"\", 24);\n this.BAM_g_position += 24;\n }\n }\n }\n }\n \n F_ac4_toc ()\n {\n var payload_base;\n var program_uuid;\n var b_wait_frames;\n var b_program_uuid_present;\n var b_payload_base;\n var short_program_id;\n var payload_base_minus1;\n var sequence_counter;\n var wait_frames;\n var b_iframe_global;\n var b_more_presentations;\n var total_n_substream_groups;\n var n_presentations;\n var b_program_id;\n var b_single_presentation;\n {\n {\n this.bitstream_version = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n if (this.bitstream_version == 3)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n this.bitstream_version += this.v;\n }\n }\n }\n {\n sequence_counter = this.BAM_source.get(\"\", 10);\n this.BAM_g_position += 10;\n }\n {\n b_wait_frames = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_wait_frames)\n {\n {\n {\n wait_frames = this.BAM_source.get(\"\", 3);\n this.BAM_g_position += 3;\n }\n if (wait_frames > 0)\n {\n {\n this.reserved = this.BAM_source.get(\"\", 2);\n this.BAM_g_position += 2;\n }\n }\n }\n }\n {\n this.fs_index = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n this.frame_rate_index = this.BAM_source.get(\"\", 4);\n this.BAM_g_position += 4;\n }\n if (this.frame_rate_index > 13)\n {\n throw \"frame_rate_index must be in range 0..13\";\n }\n if (this.fs_index == 0 && this.frame_rate_index != 13)\n {\n throw \"44.1kHz sampling rate && frame rates other than 13 are illegal. See table 84 in the ETSI spec.\";\n }\n {\n b_iframe_global = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n b_single_presentation = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_single_presentation)\n {\n {\n n_presentations = 1;\n }\n }\n else\n {\n {\n {\n b_more_presentations = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_more_presentations)\n {\n {\n {\n this.v = this.F_variable_bits(2);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n n_presentations = this.v + 2;\n }\n }\n }\n else\n {\n {\n n_presentations = 0;\n }\n }\n }\n }\n {\n payload_base = 0;\n }\n {\n b_payload_base = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_payload_base)\n {\n {\n {\n payload_base_minus1 = this.BAM_source.get(\"\", 5);\n this.BAM_g_position += 5;\n this.BAM_sink.write_uint(\"payload_base_minus1\", 5, payload_base_minus1, this.BAM_g_position);\n }\n {\n payload_base = payload_base_minus1 + 1;\n }\n if (payload_base == 32)\n {\n {\n {\n this.v = this.F_variable_bits(3);\n if (this.v == null)\n {\n throw ParseError(\"F_variable_bits\", \"expected to return a value, returned None\");\n }\n }\n {\n payload_base += this.v;\n this.BAM_sink.after_add(\"payload_base\", payload_base);\n }\n }\n }\n }\n }\n {\n this.a_substream_indices = [];\n }\n {\n this.last_referenced_substream = -1;\n }\n {\n this.referenced_substreams = [];\n }\n {\n this.bk_substream_index = 100;\n }\n if (this.bitstream_version <= 1)\n {\n {\n {\n this.toc_j = 0;\n }\n for (this.toc_i = 0; this.toc_i < n_presentations; this.toc_i++)\n {\n {\n this.F_ac4_presentation_info();\n }\n }\n }\n }\n else\n {\n {\n {\n b_program_id = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_program_id)\n {\n {\n {\n short_program_id = this.BAM_source.get(\"\", 16);\n this.BAM_g_position += 16;\n }\n {\n b_program_uuid_present = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_program_uuid_present)\n {\n {\n program_uuid = this.BAM_source.get(\"\", 16 * 8);\n this.BAM_g_position += 16 * 8;\n }\n }\n }\n }\n {\n total_n_substream_groups = 0;\n }\n for (this.toc_i = 0; this.toc_i < n_presentations; this.toc_i++)\n {\n {\n {\n this.F_ac4_presentation_v2_info(this.toc_i);\n }\n for (this.i = 0; this.i < (this.presentation_to_groups[this.toc_i]).length; this.i++)\n {\n {\n total_n_substream_groups = Math.max(total_n_substream_groups, 1 + this.presentation_to_groups[this.toc_i][this.i]);\n }\n }\n }\n }\n for (this.toc_j = 0; this.toc_j < total_n_substream_groups; this.toc_j++)\n {\n {\n this.F_ac4_substream_group_info(this.toc_j);\n }\n }\n }\n }\n {\n this.F_substream_index_table();\n }\n {\n this.BAM_l_align = ((8 - ((this.BAM_g_position % 8) + 8) % 8 % 8) + 8) % 8;\n this.BAM_l_align_val = this.BAM_source.get_align(this.BAM_l_align);\n this.BAM_sink.write_align(((8 - ((this.BAM_g_position % 8) + 8) % 8 % 8) + 8) % 8, this.BAM_l_align_val);\n this.BAM_g_position += this.BAM_l_align;\n }\n }\n }\n \n F_get_num_channels (cm)\n {\n {\n if ((cm) == (this.CHANNEL_MODE_MONO))\n {\n {\n this.n = 1;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_STEREO))\n {\n {\n this.n = 2;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_30))\n {\n {\n this.n = 3;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_50))\n {\n {\n this.n = 5;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_51))\n {\n {\n this.n = 6;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_70_34))\n {\n {\n this.n = 7;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_71_34))\n {\n {\n this.n = 8;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_70_52))\n {\n {\n this.n = 7;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_71_52))\n {\n {\n this.n = 8;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_70_322))\n {\n {\n this.n = 7;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_71_322))\n {\n {\n this.n = 8;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_704))\n {\n {\n this.n = 11;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_714))\n {\n {\n this.n = 12;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_904))\n {\n {\n this.n = 13;\n }\n }\n else if ((cm) == (this.CHANNEL_MODE_914))\n {\n {\n this.n = 14;\n }\n }\n else\n {\n if (1)\n {\n throw \"Unknown channel mode!\";\n }\n }\n return this.n;\n }\n }\n \n F_frame_rate_multiply_info ()\n {\n var b_multiplier;\n var multiplier_bit;\n {\n if ((this.BAM_g_table14.slice(0).indexOf(this.frame_rate_index) >= 0))\n {\n {\n {\n b_multiplier = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_multiplier)\n {\n {\n {\n multiplier_bit = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n this.frame_rate_factor = this.BAM_g_table15[multiplier_bit];\n }\n }\n }\n else\n {\n {\n this.frame_rate_factor = 1;\n }\n }\n }\n }\n else\n {\n if ((this.BAM_g_table16.slice(0).indexOf(this.frame_rate_index) >= 0))\n {\n {\n {\n b_multiplier = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n {\n this.frame_rate_factor = this.BAM_g_table17[b_multiplier];\n }\n }\n }\n else\n {\n {\n this.frame_rate_factor = 1;\n }\n }\n }\n }\n }\n \n F_frame_rate_fractions_info ()\n {\n var b_frame_rate_fraction;\n var frame_rate_fraction;\n var b_frame_rate_fraction_is_4;\n {\n {\n frame_rate_fraction = 1;\n }\n if ((this.BAM_g_table18.slice(0).indexOf(this.frame_rate_index) >= 0))\n {\n if (this.frame_rate_factor == 1)\n {\n {\n {\n b_frame_rate_fraction = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_frame_rate_fraction == 1)\n {\n {\n frame_rate_fraction = 2;\n }\n }\n }\n }\n }\n if ((this.BAM_g_table19.slice(0).indexOf(this.frame_rate_index) >= 0))\n {\n {\n {\n b_frame_rate_fraction = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_frame_rate_fraction == 1)\n {\n {\n {\n b_frame_rate_fraction_is_4 = this.BAM_source.get(\"\", 1);\n this.BAM_g_position += 1;\n }\n if (b_frame_rate_fraction_is_4 == 1)\n {\n {\n frame_rate_fraction = 4;\n }\n }\n else\n {\n {\n frame_rate_fraction = 2;\n }\n }\n }\n }\n }\n }\n }\n }\n}\nexport default Parser;\n", "/************************************************************************************************************\n * Copyright (C) 2023-2025 by Dolby International AB.\n * All rights reserved.\n\n * Redistribution and use in source and binary forms, with or without modification, are permitted\n * provided that the following conditions are met:\n\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions\n * and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions\n * and the following disclaimer in the documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or\n * promote products derived from this software without specific prior written permission.\n\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n ************************************************************************************************************/\n\n/*global console*/\n\n/**\n * @module\n * @desc This file provides a wrapper function to the AC-4 TOC parser, allowing to parse the TOC from an AC-4 bitstream and filter specific elements of interest.\n */\n\nimport { BitSource } from \"./bitsource.js\";\nimport { FilterSink } from \"./filtersink.js\";\nimport { Parser } from \"../ac4_toc_parser.js\";\n\n/**\n * Object containing parsed information about parsed element\n * @typedef {Object} ElementData\n * @property {string} name\n * @property {number} value\n * @property {number} pos\n * @property {number} width\n * @property {string} handler\n */\n\n/**\n * Parses the TOC from an AC-4 bitstream with filtering specified elements\n * @param {DataView} data - DataView that represents individual media sample\n * @param {string[]} elements - The AC-4 TOC elements to be filtered\n * @returns {ElementData[]|null} An array of objects containing the parsed elements\n */\nconst parseTocElements = (data, elements) => {\n let parsedElements = [];\n let index = 0;\n\n const bitSourceIterator = {\n next() {\n if (index < data.byteLength) {\n return { value: data.getUint8(index), done: ++index >= data.byteLength };\n }\n return { value: undefined, done: true };\n },\n };\n\n const sinkCallback = (name, value, width, position, handler) => {\n // subtract width because we are called after the position has been updated\n const pos = position - width;\n parsedElements.push({ handler, name, pos, value, width });\n };\n\n const bitSource = new BitSource(bitSourceIterator);\n const sink = new FilterSink(elements, sinkCallback);\n\n const parser = new Parser(bitSource, sink);\n\n // in case of parsing errors log them and set parsed elements to null (which will result in returning unmodified buffer)\n try {\n parser.F_raw_ac4_frame_toc_only();\n } catch (err) {\n console.error(err);\n parsedElements = null;\n }\n\n return parsedElements;\n};\n\nexport { parseTocElements };\n", "/************************************************************************************************************\n * Copyright (C) 2023-2025 by Dolby International AB.\n * All rights reserved.\n\n * Redistribution and use in source and binary forms, with or without modification, are permitted\n * provided that the following conditions are met:\n\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions\n * and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions\n * and the following disclaimer in the documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or\n * promote products derived from this software without specific prior written permission.\n\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n ************************************************************************************************************/\n\n/*global console*/\n\n/**\n * @module\n * @desc AlpsCore\n */\n\nimport * as isoBmffBox from \"./constants/isobmff_box_names.js\";\nimport * as tocElements from \"./constants/toc_elements.js\";\nimport { setBits, shiftLeft, shiftRight } from \"./bitwise_operations.js\";\nimport { getSampleOffsets } from \"./get_sample_offsets.js\";\nimport { parseTocElements } from \"./ac4_toc_parser_wrapper/index.js\";\n\nconst PRESENTATION_LEVEL_WIDTH = 3;\nconst UNDECODABLE_PRESENTATION_LEVEL = 7;\nconst BITS_TO_SHIFT_TO_DIVIDE_BY_8 = 3;\nconst MINIMUM_PRESENTATIONS_AMOUNT = 2;\nconst DIALOG_GAIN_ADJUSTMENT_FACTOR = 2;\n// The write path for the extended payload_base encoding inserts a single\n// F_variable_bits(3) round (3 bits + b_read_more=0), which encodes values 0\u20137,\n// giving an effective payload_base range of 32\u201339. Values >= 40 would require\n// a second round which this implementation does not support.\nconst MAX_PAYLOAD_BASE = 39;\nconst PAYLOAD_BASE_EXTENDED_THRESHOLD = 31;\nconst PAYLOAD_BASE_MINUS1_FIELD_WIDTH = 5;\nconst PAYLOAD_BASE_EXTENSION_WIDTH = 3;\nconst PAYLOAD_BASE_EXTENSION_RANGE_START = 32;\nconst VARIABLE_BITS_CONTINUE_SIZE = 1;\n\nconst elementsToParse = [\n tocElements.PRESENTATION_LEVEL,\n tocElements.B_PRESENTATION_ID,\n tocElements.PRESENTATION_ID,\n tocElements.PAYLOAD_BASE_MINUS1,\n tocElements.BYTE_ALIGNMENT,\n tocElements.AC4_TOC_END,\n tocElements.PAYLOAD_BASE,\n];\n\n/**\n * Process an ISOBMFF Init segment buffer\n * @param {ISOBoxer} parsedSegmentBuffer - The ISOBMFF segment buffer to process\n * @returns {import('./types').Presentation[]} - List of presentations read from Init ISOBMFF Segment\n */\nconst processIsoBmffInitSegment = (parsedSegmentBuffer) => {\n // parse the segment that was just handed in\n const movie = parsedSegmentBuffer.fetch(isoBmffBox.MOVIE);\n const meta = parsedSegmentBuffer.fetch(isoBmffBox.META);\n\n console.log(\"ALPS::processIsoBmffSegment - found init segment\");\n\n // Any new init segment replaces the old contents entirely.\n const presentations = [];\n const groupsList = meta && meta.boxes.find((box) => box.type === isoBmffBox.GROUPS_LIST);\n const preselectionGroups = groupsList && groupsList.boxes.filter((box) => box.type === isoBmffBox.PRESELECTION_GROUP);\n const tracks = movie && movie.boxes.filter((box) => box.type === isoBmffBox.TRACK);\n const trackIds =\n tracks?.map((track) => {\n const trackHeader = track.boxes.find((box) => box.type === isoBmffBox.TRACK_HEADER);\n return trackHeader.track_ID;\n }) ?? [];\n\n if (Array.isArray(preselectionGroups)) {\n for (const preselectionGroup of preselectionGroups) {\n // filter out those preselection groups that reference tracks only from within this file\n // (that is, where every entity_ID is also the ID of a track in the file)\n if (preselectionGroup.entities.every((entity) => trackIds.includes(entity.entity_id))) {\n const parsedPreselectionTag = parseInt(preselectionGroup.preselection_tag, 10);\n const id = isNaN(parsedPreselectionTag) ? null : parsedPreselectionTag;\n\n const selectionPriority = preselectionGroup.selection_priority ?? null;\n\n const udtaBox = preselectionGroup.boxes.find((box) => box.type === isoBmffBox.USER_DATA);\n const diapBox = udtaBox?.boxes.find((box) => box.type === isoBmffBox.DIALOG_PROCESSING);\n const dialogGain = Number.isInteger(diapBox?.dialog_gain)\n ? diapBox.dialog_gain / DIALOG_GAIN_ADJUSTMENT_FACTOR\n : null;\n\n const languageBox = preselectionGroup.boxes.find((box) => box.type === isoBmffBox.EXTENDED_LANGUAGE_TAG);\n const extendedLanguage = languageBox?.extended_language ?? null;\n\n const audioRenderingIndicationBox = preselectionGroup.boxes.find(\n (box) => box.type === isoBmffBox.AUDIO_RENDERING_INDICATION,\n );\n const audioRenderingIndication = audioRenderingIndicationBox?.audio_rendering_indication ?? null;\n\n const labelBoxes = preselectionGroup.boxes.filter((box) => box.type === isoBmffBox.LABEL);\n const labels = labelBoxes.map((labelBox) => ({\n isGroupLabel: labelBox.is_group_label,\n label: labelBox.label,\n labelId: labelBox.label_id,\n language: labelBox.language,\n }));\n\n const kindBoxes = preselectionGroup.boxes.filter((box) => box.type === isoBmffBox.KIND);\n const kinds = kindBoxes.map((kindBox) => ({\n schemeURI: kindBox.schemeURI,\n value: kindBox.value,\n }));\n\n // append parsed presentation object\n presentations.push({\n audioRenderingIndication,\n dialogGain,\n extendedLanguage,\n id,\n kinds,\n labels,\n selectionPriority,\n });\n }\n }\n } else {\n console.log(\"ALPS::processIsoBmffSegment - no preselection group found\");\n }\n\n return presentations;\n};\n\n/**\n * Process an ISOBMFF media segment buffer\n * @param {ISOBoxer} parsedSegmentBuffer - The ISOBMFF segment buffer to process\n * @param {number} activePresentationId - Presentation ID that should be selected for processing\n * @returns {number|null} Presentation ID of enforced presentation\n */\nconst processIsoBmffMediaSegment = (parsedSegmentBuffer, activePresentationId) => {\n // parse the segment that was just handed in\n console.log(`ALPS::processIsoBmffSegment - processing moof media. ActivePresentation: ${activePresentationId}`);\n\n // this is the data segment\n // determine the offsets to all samples\n const sampleOffsets = getSampleOffsets(parsedSegmentBuffer);\n\n console.log(`ALPS::processIsoBmffSegment - obtained ${sampleOffsets.length} sample offsets`);\n\n for (const sampleOffset of sampleOffsets) {\n const sampleData = new DataView(parsedSegmentBuffer._raw.buffer, sampleOffset.offset, sampleOffset.size);\n const parsedElements = parseTocElements(sampleData, elementsToParse);\n\n if (parsedElements === null) {\n console.log(\"ALPS::processIsobmffSegment - parsing error\");\n return null;\n }\n\n const payloadBaseMinus1 = parsedElements.find((element) => element.name === tocElements.PAYLOAD_BASE_MINUS1);\n if (!payloadBaseMinus1) {\n console.log(\"ALPS::processIsobmffSegment - payloadBaseMinus1 field not found, returning unmodified buffer\");\n return null;\n }\n\n let payloadBase = parsedElements.find((element) => element.name === tocElements.PAYLOAD_BASE)?.value;\n if (!payloadBase) {\n console.log(\"ALPS::processIsobmffSegment - payloadBase field not found\");\n payloadBase = payloadBaseMinus1.value + 1;\n }\n\n let accumulatedShift = 0;\n const byteAlignment = parsedElements.find((element) => element.name === tocElements.BYTE_ALIGNMENT);\n if (byteAlignment) {\n accumulatedShift = byteAlignment.width;\n }\n\n const ac4TocEnd = parsedElements.find((element) => element.name === tocElements.AC4_TOC_END);\n\n // filter the table to produce a list of preselections complete with ID, a list of b_presentation_ids and a list of presentation_ids\n const presentationOffsets = [];\n const bPresentationIds = [];\n\n parsedElements.forEach((element) => {\n switch (element.name) {\n case tocElements.PRESENTATION_LEVEL: {\n presentationOffsets.push({ pos: element.pos, value: element.value, width: element.width });\n break;\n }\n case tocElements.PRESENTATION_ID: {\n const lastPresentationOffset = presentationOffsets[presentationOffsets.length - 1];\n\n // modify last seen presentation. If there was none, this is an error:\n // a presentation_id would always follow, never preceed, the level\n if (presentationOffsets.length === 0) {\n console.error(\"Encountered a presentationID without a presentation\");\n }\n if (element.handler === \"before_call\") {\n lastPresentationOffset.presentationIdPos = element.pos;\n }\n if (element.handler === \"after_call\") {\n lastPresentationOffset.presentationId = element.value;\n const width = element.pos - lastPresentationOffset.presentationIdPos;\n lastPresentationOffset.presentationIdWidth = width;\n accumulatedShift += width;\n }\n break;\n }\n case tocElements.B_PRESENTATION_ID: {\n bPresentationIds.push(element);\n break;\n }\n case tocElements.PAYLOAD_BASE_MINUS1:\n case tocElements.PAYLOAD_BASE:\n case tocElements.BYTE_ALIGNMENT:\n case tocElements.AC4_TOC_END: {\n break;\n }\n default: {\n console.error(`Unknown TOC parsed element: ${element.name}`);\n }\n }\n });\n\n // if there are less than 2 presentations in TOC - return unmodified buffer\n if (presentationOffsets.length < MINIMUM_PRESENTATIONS_AMOUNT) {\n console.log(\"ALPS::processIsobmffSegment - less then 2 presentations found\");\n return null;\n }\n\n // check that all presentations carry an ID\n if (presentationOffsets.some((presentation) => presentation.presentationId === undefined)) {\n console.error(\"Not every presentation carries an ID\");\n return null;\n }\n\n if (presentationOffsets.every((offset) => offset.presentationId !== activePresentationId)) {\n console.log(\"ALPS::processIsobmffSegment - activePresentationId not found in TOC\");\n return null;\n }\n\n // add available bytes to payload_base_minus1 (>>> is more efficient than Math.floor)\n const availableAdditionalBytes = accumulatedShift >>> BITS_TO_SHIFT_TO_DIVIDE_BY_8;\n const newPayloadBase = payloadBase + availableAdditionalBytes;\n\n if (newPayloadBase > MAX_PAYLOAD_BASE) {\n console.error(\n `ALPS::processIsoBmffMediaSegment - newPayloadBase (${newPayloadBase}) exceeds the maximum supported value of ${MAX_PAYLOAD_BASE}`,\n );\n return null;\n }\n\n if (newPayloadBase > PAYLOAD_BASE_EXTENDED_THRESHOLD && payloadBase <= PAYLOAD_BASE_EXTENDED_THRESHOLD) {\n const newAccumulatedShift = accumulatedShift - (PAYLOAD_BASE_EXTENSION_WIDTH + VARIABLE_BITS_CONTINUE_SIZE);\n const newAvailableAdditionalBytes = newAccumulatedShift >>> BITS_TO_SHIFT_TO_DIVIDE_BY_8;\n const newPayloadBaseAfterShift = payloadBase + newAvailableAdditionalBytes;\n\n if (newPayloadBaseAfterShift <= PAYLOAD_BASE_EXTENDED_THRESHOLD) {\n console.error(\n `ALPS::processIsoBmffMediaSegment - inserting the 4-bit payload_base extension header reduces available shift such that extended encoding is no longer required (adjusted newPayloadBase=${newPayloadBaseAfterShift}); this indicates a stream conformance error`,\n );\n return null;\n }\n }\n\n // set presentation level to 7 for inactive presentations\n presentationOffsets.forEach((presentation) => {\n const presentationId = presentation.presentationId;\n\n if (presentation.width !== PRESENTATION_LEVEL_WIDTH) {\n console.warn(`Presentation level has unexpected width: ${presentation.width}`);\n }\n\n // in all presentations except the selected one, overwrite presentation level with \"7\"\n if (activePresentationId !== presentationId) {\n // updating inactive presentation with undecodable presentation level\n setBits(sampleData, presentation.pos, presentation.width, UNDECODABLE_PRESENTATION_LEVEL);\n }\n });\n\n // set all b_presentation_id fields to 0\n bPresentationIds.forEach((bPresentationId) => {\n setBits(sampleData, bPresentationId.pos, bPresentationId.width, 0);\n });\n\n // bit shifting\n presentationOffsets\n .slice()\n .reverse()\n .forEach((presentation) => {\n const shiftWidth = ac4TocEnd.pos - presentation.presentationIdPos;\n shiftLeft(sampleData, presentation.presentationIdPos, shiftWidth, presentation.presentationIdWidth);\n });\n\n // update payloadbase_minus_1\n if (newPayloadBase <= PAYLOAD_BASE_EXTENDED_THRESHOLD) {\n setBits(\n sampleData,\n payloadBaseMinus1.pos,\n payloadBaseMinus1.width,\n payloadBaseMinus1.value + availableAdditionalBytes,\n );\n } else if (payloadBase > PAYLOAD_BASE_EXTENDED_THRESHOLD) {\n setBits(\n sampleData,\n payloadBaseMinus1.pos + PAYLOAD_BASE_MINUS1_FIELD_WIDTH,\n PAYLOAD_BASE_EXTENSION_WIDTH,\n newPayloadBase - PAYLOAD_BASE_EXTENSION_RANGE_START,\n );\n } else {\n const newAccumulatedShift = accumulatedShift - (PAYLOAD_BASE_EXTENSION_WIDTH + VARIABLE_BITS_CONTINUE_SIZE);\n const newAvailableAdditionalBytes = newAccumulatedShift >>> BITS_TO_SHIFT_TO_DIVIDE_BY_8;\n const newPayloadBaseAfterShift = payloadBase + newAvailableAdditionalBytes;\n\n const shiftWidth = ac4TocEnd.pos - payloadBaseMinus1.pos;\n shiftRight(\n sampleData,\n payloadBaseMinus1.pos,\n shiftWidth,\n PAYLOAD_BASE_EXTENSION_WIDTH + VARIABLE_BITS_CONTINUE_SIZE,\n );\n setBits(sampleData, payloadBaseMinus1.pos, payloadBaseMinus1.width, PAYLOAD_BASE_EXTENDED_THRESHOLD);\n setBits(\n sampleData,\n payloadBaseMinus1.pos + PAYLOAD_BASE_MINUS1_FIELD_WIDTH,\n PAYLOAD_BASE_EXTENSION_WIDTH,\n newPayloadBaseAfterShift - PAYLOAD_BASE_EXTENSION_RANGE_START,\n );\n setBits(\n sampleData,\n payloadBaseMinus1.pos + PAYLOAD_BASE_MINUS1_FIELD_WIDTH + PAYLOAD_BASE_EXTENSION_WIDTH,\n VARIABLE_BITS_CONTINUE_SIZE,\n 0,\n );\n }\n }\n\n console.log(\"ALPS::processIsoBmffSegment - done\");\n\n return activePresentationId;\n};\n\nexport { processIsoBmffInitSegment, processIsoBmffMediaSegment };\n", "/************************************************************************************************************\n * Copyright (C) 2023-2025 by Dolby International AB.\n * All rights reserved.\n\n * Redistribution and use in source and binary forms, with or without modification, are permitted\n * provided that the following conditions are met:\n\n * 1. Redistributions of source code must retain the above copyright notice, this list of conditions\n * and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions\n * and the following disclaimer in the documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or\n * promote products derived from this software without specific prior written permission.\n\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n ************************************************************************************************************/\n\n/*global console*/\n\n/**\n * @module\n * @desc The main entry point for the ALPS library. This file exports the `Alps` class, which provides the core functionality of the library.\n */\n\nimport * as isoBmffBox from \"./constants/isobmff_box_names.js\";\n\nimport { processIsoBmffInitSegment, processIsoBmffMediaSegment } from \"./alps_core.js\";\n\nimport ISOBoxer from \"codem-isoboxer\";\n\nconst SEGMENT_TYPES = {\n INIT: \"init\",\n MEDIA: \"media\",\n};\n\n/* eslint-disable */\nISOBoxer.addBoxProcessor(\"diap\", function () {\n this._procFullBox();\n this._procField(\"dialog_gain\", \"int\", 8);\n});\n/* eslint-enable */\n\n/**\n * This callback is called when list of presentations changes, e.g. new init segment is processed for multi-period DASH contents.\n * @callback presentationsChangedCallback\n * @param {PresentationsChangedEvent} event\n */\n\n/**\n * Event data for presentationsChangedCallback\n * @typedef {Object} PresentationsChangedEvent\n * @property {string|null} streamId - ID of the stream for which the presentations were parsed\n */\n\n/**\n * ALPS Data for stream\n * @typedef {Object} Stream\n * @property {import('./types.js').Presentation[]} presentations - presentation related to the stream\n * @property {number|undefined} activePresentationId - current active presentation ID for the stream\n */\n\n/**\n * Buffer processing result for init segment.\n * @typedef {Object} ProcessIsoBmffInitSegmentResult\n * @property {\"init\"} segmentType - \"init\" indicating that segment is an init segment\n * @property {import('./types.js').Presentation[]} presentations - list of presentations read from ISOBMFF init segment\n * @property {null} forcedPresentationId - always null for init segments\n */\n\n/**\n * Buffer processing result for media segment.\n * @typedef {Object} ProcessIsoBmffMediaSegmentResult\n * @property {\"media\"} segmentType - \"media\" indicating that segment is a media segment\n * @property {null} presentations - null for media segments\n * @property {number|null} forcedPresentationId - ID of presentation selected in bitstream, null when no presentation was selected\n */\n\n/**\n * Buffer processing result for unknown segment.\n * @typedef {Object} ProcessIsoBmffUnknownSegmentResult\n * @property {null} segmentType - null indicating that segment type is unknown\n * @property {null} presentations - null for unknown segments\n * @property {null} forcedPresentationId - null for unknown segments\n */\n\n/**\n * Buffer processing result.\n * @typedef {ProcessIsoBmffInitSegmentResult|ProcessIsoBmffMediaSegmentResult|ProcessIsoBmffUnknownSegmentResult} ProcessIsoBmffSegmentResult\n */\n\n// Export shared types\nexport * from \"./types.js\";\n\n/**\n * Provides the core functionality of the library. It allows to process ISOBMFF segments and manage presentations.\n */\nexport class Alps {\n /** @type {Record<string,Stream>} */\n #streams = {};\n /** @type {presentationsChangedCallback|undefined} */\n #presentationsChangedEventHandler;\n\n #initializeStream(streamId) {\n if (this.#streams[streamId] === undefined) {\n this.#streams[streamId] = { activePresentationId: -1, presentations: [] };\n }\n }\n\n /**\n * Create the ALPS object\n */\n constructor() {\n console.log(\"ALPS::constructor\");\n }\n\n /**\n * Get presentation and activePresentationId for all streams\n * @returns {Record<string,Stream>} Data for all streams present in current ALPS state\n */\n getStreams() {\n return this.#streams;\n }\n\n /**\n * Clear data for unused stream\n * @param {string|null} streamId Stream ID which should be deleted, null for non-multi-period use\n */\n clearStream(streamId = null) {\n delete this.#streams[streamId];\n }\n\n /**\n * Set presentationsChangedEventHandler\n * @param {presentationsChangedCallback} presentationsChangedEventHandler Callback function that will be called if the list of presentations changes\n */\n setPresentationsChangedEventHandler(presentationsChangedEventHandler) {\n console.log(\"ALPS::setPresentationsChangedEventHandler\");\n this.#presentationsChangedEventHandler = presentationsChangedEventHandler;\n }\n\n /**\n * Get the list of available presentations\n * @param {string|null} streamId The ID of the stream, null for non-multi-period use\n * @returns {import('./types.js').Presentation[]} An array of presentation objects\n */\n getPresentations(streamId = null) {\n this.#initializeStream(streamId);\n console.log(\n `ALPS::getPresentations - List of presentations: ${JSON.stringify(this.#streams[streamId].presentations)}`,\n );\n return this.#streams[streamId].presentations;\n }\n\n /**\n * Get the ID of the currently active presentation\n * @param {string|null} streamId The ID of the stream, null for non-multi-period use\n * @returns {number|undefined} The ID of the active presentation, -1 if no presentation is set, undefined if no stream data exists\n */\n getActivePresentationId(streamId = null) {\n console.log(`ALPS::getActivePresentation - activePresentation: ${this.#streams[streamId]?.activePresentationId}`);\n return this.#streams[streamId]?.activePresentationId;\n }\n\n /**\n * Set the ID of the active presentation\n * @param {number|undefined} presentationId - The ID of the presentation to set as active, -1 to select the default presentation or undefined to clear any active presentation\n * @param {string|null} streamId The ID of the stream, null for non-multi-period use\n */\n setActivePresentationId(presentationId, streamId = null) {\n console.log(`ALPS::setActivePresentation - new activePresentation: ${presentationId}`);\n this.#initializeStream(streamId);\n this.#streams[streamId].activePresentationId = presentationId;\n }\n\n /**\n * Process an ISOBMFF segment buffer\n * @param {ArrayBuffer} segmentBuffer - The ISOBMFF segment buffer to process\n * @param {string|null} streamId - Stream ID for Segment buffer, null for non-multi-period use\n * @param {number|undefined} activePresentationId - Forced presentation ID that should be selected for processing, use -1 for TV default, and leave undefined to use value set by setActivePresentationId. This parameter takes precedence over this.activePresentationId\n * @returns {ProcessIsoBmffSegmentResult} Data retrieved from processed segment\n */\n processIsoBmffSegment(segmentBuffer, streamId = null, activePresentationId = undefined) {\n // parse the segment that was just handed in\n console.log(\"ALPS::processIsoBmffSegment\");\n\n let forcedPresentationId = null;\n let presentations = null;\n let segmentType = null;\n\n const parsedSegmentBuffer = ISOBoxer.parseBuffer(segmentBuffer);\n\n const movie = parsedSegmentBuffer.fetch(isoBmffBox.MOVIE);\n const meta = parsedSegmentBuffer.fetch(isoBmffBox.META);\n const movieFragment = parsedSegmentBuffer.fetch(isoBmffBox.MOVIE_FRAGMENT);\n\n this.#initializeStream(streamId);\n const stream = this.#streams[streamId];\n\n // if this is the init segment - parse presentations\n if (movie && meta) {\n presentations = processIsoBmffInitSegment(parsedSegmentBuffer);\n stream.presentations = presentations;\n\n if (this.#presentationsChangedEventHandler) {\n this.#presentationsChangedEventHandler({ streamId });\n }\n segmentType = SEGMENT_TYPES.INIT;\n }\n\n if (movieFragment) {\n forcedPresentationId = processIsoBmffMediaSegment(\n parsedSegmentBuffer,\n activePresentationId ?? stream.activePresentationId,\n );\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