Class: shaka.mkv.MatroskaClusterParser

Constructor

new MatroskaClusterParser()

Source:

Methods

flushBlocks_(clusterTicks, blocksnon-null, context)

Parameters:
Name Type Description
clusterTicks number
blocks Array<shaka.mkv.MatroskaClusterParser.PendingBlock>
context shaka.mkv.MatroskaClusterParser.Context
Source:

invalid_() → {shaka.util.Error}

Source:
Returns:
@private
Type
shaka.util.Error

parseBlock_(clusterTicks, block, context)

Reads a (Simple)Block: track number, relative timecode, flags, optional lacing header and the frames.
Parameters:
Name Type Description
clusterTicks number
block shaka.mkv.MatroskaClusterParser.PendingBlock
context shaka.mkv.MatroskaClusterParser.Context
Source:

parseBlockGroup_(groupnon-null) → {shaka.mkv.MatroskaClusterParser.PendingBlock}

Parameters:
Name Type Description
group shaka.util.EbmlElement
Source:
Returns:
Type
shaka.mkv.MatroskaClusterParser.PendingBlock

parseCluster_(clusternon-null, context)

Parameters:
Name Type Description
cluster shaka.util.EbmlElement
context shaka.mkv.MatroskaClusterParser.Context
Source:

parseElements_(parsernon-null, context)

Walks a sequence of Level-1 elements.
Parameters:
Name Type Description
parser shaka.util.EbmlParser
context shaka.mkv.MatroskaClusterParser.Context
Source:

parseFrames(data, tracknon-null, timecodeScale, allowPartialopt) → {Array<shaka.mkv.MatroskaClusterParser.Frame>}

Parameters:
Name Type Attributes Default Description
data BufferSource Whole Clusters, starting on a Cluster boundary.
track shaka.mkv.MatroskaIndexParser.Track
timecodeScale number Nanoseconds per timecode tick.
allowPartial boolean <optional>
false When true the data may end in the middle of an element, and whatever complete blocks precede that point are returned. Used to probe the start of a file.
Source:
Returns:
Type
Array<shaka.mkv.MatroskaClusterParser.Frame>

readFrameSizes_(bytesnon-null, start, lacing) → {{sizes: !Array<number>, dataStart: number}}

Reads the sizes of the frames of a block, which depend on its lacing.
Parameters:
Name Type Description
bytes Uint8Array The block.
start number Offset of the first byte after the block flags.
lacing number
Source:
Returns:
Type
{sizes: !Array<number>, dataStart: number}

readVint_(bytesnon-null, offset) → {{value: number, length: number}}

Reads an EBML variable-length integer, as used for the track number and the lace sizes of a block. Unlike an element ID, its length marker is not part of its value.
Parameters:
Name Type Description
bytes Uint8Array
offset number
Source:
Returns:
Type
{value: number, length: number}

Type Definitions

Context

Type:
Source:

Frame

Type:
  • {time: number, duration: ?number, data: !Uint8Array, keyframe: boolean, block: number, laceIndex: number}
Properties:
Name Type Attributes Description
time number Presentation time in seconds. Frames laced into one block are spread over the block's duration when it has one, and share its time otherwise.
duration number <nullable>
The duration in seconds, when the block writes one (BlockDuration).
data Uint8Array The frame, as a view of the input.
keyframe boolean
block number The number of the block the frame comes from, which frames laced together share.
laceIndex number The position of the frame among those of its block.
Source:

PendingBlock

Type:
Source: