Constructor
new MatroskaClusterParser()
- Source:
Methods
flushBlocks_(clusterTicks, blocksnon-null, context)
Parameters:
- Source:
parseBlock_(clusterTicks, block, context)
Reads a (Simple)Block: track number, relative timecode, flags, optional
lacing header and the frames.
Parameters:
- Source:
parseCluster_(clusternon-null, context)
Parameters:
- Source:
parseElements_(parsernon-null, context)
Walks a sequence of Level-1 elements.
Parameters:
- 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
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: