Files
shaka-player/externs/shaka/mp4_parser.js
T
Joey Parrish edce1899f9 fix: Fix header sizes for MP4 boxes with 64-bit size fields
The MP4 box header depends on both whether the box is a "full" box
(with version and flags) and whether the box has an extra 64-bit size
field.  The MP4 parser was only considering the version and flags, but
not whether the extra size field was present.  We already correctly
parsed the 64-bit size field, but computed offsets for other fields
without considering this.

Groundwork for a fix for #2759

Change-Id: I48f16ef073a036954b6f7d25641ccf29828b02c8
2021-01-14 12:57:41 -08:00

51 lines
1.6 KiB
JavaScript

/*! @license
* Shaka Player
* Copyright 2016 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @externs
*/
/**
* @typedef {{
* parser: !shaka.util.Mp4Parser,
* partialOkay: boolean,
* start: number,
* size: number,
* version: ?number,
* flags: ?number,
* reader: !shaka.util.DataViewReader,
* has64BitSize: boolean
* }}
*
* @property {!shaka.util.Mp4Parser} parser
* The parser that parsed this box. The parser can be used to parse child
* boxes where the configuration of the current parser is needed to parsed
* other boxes.
* @property {boolean} partialOkay
* If true, allows reading partial payloads from some boxes. If the goal is a
* child box, we can sometimes find it without enough data to find all child
* boxes. This property allows the partialOkay flag from parse() to be
* propagated through methods like children().
* @property {number} start
* The start of this box (before the header) in the original buffer. This
* start position is the absolute position.
* @property {number} size
* The size of this box (including the header).
* @property {?number} version
* The version for a full box, null for basic boxes.
* @property {?number} flags
* The flags for a full box, null for basic boxes.
* @property {!shaka.util.DataViewReader} reader
* The reader for this box is only for this box. Reading or not reading to
* the end will have no affect on the parser reading other sibling boxes.
* @property {boolean} has64BitSize
* If true, the box header had a 64-bit size field. This affects the offsets
* of other fields.
* @exportDoc
*/
shaka.extern.ParsedBox;