Class: shaka.cea.Mp4CeaParser

Constructor

new Mp4CeaParser()

Implements:
Source:

Members

BitstreamFormat :number

Type:
  • number
Properties:
Name Value Type Description
UNKNOWN 0 number
H264 1 number
H265 2 number
Source:

CodecBitstreamMap_ :Object.<string, shaka.cea.Mp4CeaParser.BitstreamFormat>

Type:
Source:

defaultSampleDuration_ :number

Default sample duration, as specified by the TREX box.
Type:
  • number
Source:

defaultSampleSize_ :number

Default sample size, as specified by the TREX box.
Type:
  • number
Source:

seiProcessor_ :shaka.cea.SeiProcessor

SEI data processor.
Type:
Source:

trackIdToTimescale_ :Map.<number, number>

Map of track id to corresponding timescale.
Type:
  • Map.<number, number>
Source:

Methods

init(initSegmentnon-null)

Parses the init segment. Gets Default Sample Duration and Size from the TREX box, and constructs a map of Track IDs to timescales. Each TRAK box contains a track header (TKHD) containing track ID, and a media header box (MDHD) containing the timescale for the track
Parameters:
Name Type Description
initSegment BufferSource init segment to parse.
Implements:
Source:

parse(mediaSegmentnon-null) → {Array.<!shaka.extern.ICeaParser.CaptionPacket>}

Parses each video segment. In fragmented MP4s, MOOF and MDAT come in pairs. The following logic gets the necessary info from MOOFs to parse MDATs (base media decode time, sample sizes/offsets/durations, etc), and then parses the MDAT boxes for CEA-708 packets using this information. CEA-708 packets are returned in the callback.
Parameters:
Name Type Description
mediaSegment BufferSource media segment to parse.
Implements:
Source:
Returns:
Type
Array.<!shaka.extern.ICeaParser.CaptionPacket>

parseMdat_(readernon-null, time, timescale, defaultSampleDuration, defaultSampleSize, offset, parsedTRUNsnon-null, captionPacketsnon-null)

Parse MDAT box.
Parameters:
Name Type Description
reader shaka.util.DataViewReader
time number
timescale number
defaultSampleDuration number
defaultSampleSize number
offset number
parsedTRUNs Array.<shaka.util.ParsedTRUNBox>
captionPackets Array.<!shaka.extern.ICeaParser.CaptionPacket>
Source:

setBitstreamFormat_(codec)

Parameters:
Name Type Description
codec string A fourcc for a codec.
Source: