From 837f166e3234c500aac0d19acc7839c2f5f8c521 Mon Sep 17 00:00:00 2001 From: Cyril Concolato Date: Fri, 18 Mar 2022 14:36:27 -0700 Subject: [PATCH] add Opus dOps box parsing --- src/parsing/dOps.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/parsing/dOps.js diff --git a/src/parsing/dOps.js b/src/parsing/dOps.js new file mode 100644 index 00000000..66675ea7 --- /dev/null +++ b/src/parsing/dOps.js @@ -0,0 +1,17 @@ +BoxParser.createBoxCtor("dOps", function(stream) { + this.Version = stream.readUint8(); + this.OutputChannelCount = stream.readUint8(); + this.PreSkip = stream.readUint16(); + this.InputSampleRate = stream.readUint32(); + this.OutputGain = stream.readInt16(); + this.ChannelMappingFamily = stream.readUint8(); + if (this.ChannelMappingFamily !== 0) { + this.StreamCount = stream.readUint8(); + this.CoupledCount = stream.readUint8(); + this.ChannelMapping = []; + for (var i = 0; i < this.OutputChannelCount; i++) { + this.ChannelMapping[i] = stream.readUint8(); + } + } +}); +