Parse and structurally validate the one Opus dOps box of an MP4 audio
sample entry.
boxes is the sample entry's child-box list as mp4box parses it, codec its
four-character code, and trackChannels the AudioSampleEntry channel
count. The result reports the box as
observed; whether it matches the delivery profile is
assertProductionOpusProfile's question.
Family 0 serializes no stream counts or mapping table and supports mono or
stereo, so it reports null counts, an empty mapping and the implied channel
order. Families 1 and 255 report their stream counts and ordered mapping
with a null channel order, because family 255 defines no speaker meaning and
this parser does not expand the family 1 order. InputSampleRate is
reported but not compared with any track rate, because RFC 7845 makes it the
informational rate of the original input.
Throws unsupported-audio-profile.sampleEntry for a non-Opus code and
malformed-dOps for anything else RFC 7845 section 5.1 or its MP4
encapsulation forbids: not exactly one dOps box, a field outside its bit
width, an output channel count that differs from the track's, a reserved
family, a family 0 box with a mapping or more than two channels, a family 1
box with more than eight channels, zero streams, more coupled than total
streams, more than 255 decoded channels, or a mapping table that is not one
entry per output channel each naming a decoded channel or 255 for silence.
Parse and structurally validate the one Opus
dOpsbox of an MP4 audio sample entry.boxesis the sample entry's child-box list as mp4box parses it,codecits four-character code, andtrackChannelstheAudioSampleEntrychannel count. The result reports the box as observed; whether it matches the delivery profile isassertProductionOpusProfile's question.Family 0 serializes no stream counts or mapping table and supports mono or stereo, so it reports null counts, an empty mapping and the implied channel order. Families 1 and 255 report their stream counts and ordered mapping with a null channel order, because family 255 defines no speaker meaning and this parser does not expand the family 1 order.
InputSampleRateis reported but not compared with any track rate, because RFC 7845 makes it the informational rate of the original input.Throws
unsupported-audio-profile.sampleEntryfor a non-Opus code andmalformed-dOpsfor anything else RFC 7845 section 5.1 or its MP4 encapsulation forbids: not exactly onedOpsbox, a field outside its bit width, an output channel count that differs from the track's, a reserved family, a family 0 box with a mapping or more than two channels, a family 1 box with more than eight channels, zero streams, more coupled than total streams, more than 255 decoded channels, or a mapping table that is not one entry per output channel each naming a decoded channel or 255 for silence.