Class: shaka.transmuxer.AV1

Members

CP_BT_709_ :number

@const
Type:
  • number
Source:

CP_UNSPECIFIED_ :number

@const
Type:
  • number
Source:

CSP_UNKNOWN_ :number

@const
Type:
  • number
Source:

FRAME_TYPE_KEY_ :number

@const
Type:
  • number
Source:

MC_IDENTITY_ :number

@const
Type:
  • number
Source:

MC_UNSPECIFIED_ :number

@const
Type:
  • number
Source:

OBU_TYPE_FRAME_ :number

@const
Type:
  • number
Source:

OBU_TYPE_FRAME_HEADER_ :number

@const
Type:
  • number
Source:

OBU_TYPE_SEQUENCE_HEADER_ :number

@const
Type:
  • number
Source:

SELECT_SCREEN_CONTENT_TOOLS_ :number

Sentinel meaning "decide per frame" for seq_force_screen_content_tools.
Type:
  • number
Source:

TC_SRGB_ :number

@const
Type:
  • number
Source:

TC_UNSPECIFIED_ :number

@const
Type:
  • number
Source:

Methods

buildAv1C_(header, sequenceHeaderObunon-null) → {Uint8Array}

Builds an AV1CodecConfigurationRecord (the payload of an `av1C` box). The record is four fixed bytes describing the decoder requirements, followed by `configOBUs` — the sequence header itself. The OBU bytes are copied verbatim rather than re-serialised from the parsed fields, because a sequence header carries data this parser does not model (operating points, timing info, trailing bits), and the decoder is configured from these bytes.
Parameters:
Name Type Description
header shaka.transmuxer.AV1.SequenceHeader
sequenceHeaderObu Uint8Array
Source:
Returns:
Type
Uint8Array

isKeyframe(obusnon-null, reducedStillPicture) → {boolean}

Returns whether a temporal unit codes a shown key frame. `uncompressed_header()` (AV1 §5.9.2) puts `show_existing_frame` and `frame_type` in the first three bits of a frame header, so this needs no state from the sequence header beyond `reduced_still_picture_header` — which suppresses both fields and makes every frame a key frame.
Parameters:
Name Type Description
obus Array<shaka.transmuxer.AV1.Obu>
reducedStillPicture boolean
Source:
Returns:
Type
boolean

makeReader_(datanon-null) → {shaka.transmuxer.AV1.Reader}

Wraps an ExpGolomb in a bit budget. A sequence header is a chain of conditionally present fields, so a truncated one is not detected by any single read — the parser simply keeps asking for bits that are not there. ExpGolomb answers those by recursing on itself until the stack gives out, so the budget is tracked here, and once it is spent every read returns 0 and `overrun` stays set for the caller to reject the whole header.
Parameters:
Name Type Description
data Uint8Array
Source:
Returns:
Type
shaka.transmuxer.AV1.Reader

parseInfo(obusnon-null) → {shaka.transmuxer.AV1.Info}

Reads the sequence header of a temporal unit and returns the properties needed to describe the stream, or null when the unit carries none. Only key frames carry a sequence header, so callers must cache the result and reuse it for the inter frames that follow.
Parameters:
Name Type Description
obus Array<shaka.transmuxer.AV1.Obu>
Source:
Returns:
Type
shaka.transmuxer.AV1.Info

parseObus(datanon-null) → {Array<shaka.transmuxer.AV1.Obu>}

Splits a temporal unit into its OBUs.
Parameters:
Name Type Description
data Uint8Array
Source:
Returns:
Type
Array<shaka.transmuxer.AV1.Obu>

parseSequenceHeader_(datanon-null) → {shaka.transmuxer.AV1.SequenceHeader}

Parses `sequence_header_obu()` (AV1 §5.5.1).
Parameters:
Name Type Description
data Uint8Array The OBU payload, without its header.
Source:
Returns:
Type
shaka.transmuxer.AV1.SequenceHeader

readBits_(reader, count) → {number}

Reads `count` bits, at most 16 at a time so the result of a read can never be interpreted as a negative 32-bit integer.
Parameters:
Name Type Description
reader shaka.transmuxer.AV1.Reader
count number
Source:
Returns:
Type
number

readLeb128_(datanon-null, offset) → {?{value: number, offset: number}}

Reads an unsigned LEB128 value (AV1 §4.10.5).
Parameters:
Name Type Description
data Uint8Array
offset number
Source:
Returns:
Type
?{value: number, offset: number}

skipBits_(reader, count)

Skips `count` bits.
Parameters:
Name Type Description
reader shaka.transmuxer.AV1.Reader
count number
Source:

skipUvlc_(reader)

Skips a variable length unsigned integer (AV1 §4.10.3).
Parameters:
Name Type Description
reader shaka.transmuxer.AV1.Reader
Source:

Type Definitions

Info

Type:
  • {width: number, height: number, reducedStillPicture: boolean, videoConfig: !Uint8Array}
Source:

Obu

One Open Bitstream Unit. `data` is the OBU payload alone; `fullData` also covers the header and the size field, which is what an `av1C` configOBUs entry needs.
Type:
  • {type: number, data: !Uint8Array, fullData: !Uint8Array}
Source:

Reader

A bit reader with a budget. `overrun` latches once a read has asked for more bits than the buffer holds.
Type:
Source:

SequenceHeader

Type:
  • {seqProfile: number, seqLevelIdx: number, seqTier: number, highBitdepth: number, twelveBit: number, monochrome: number, subsamplingX: number, subsamplingY: number, chromaSamplePosition: number, width: number, height: number, reducedStillPicture: boolean}
Source: