Constructor
new CeaDecoder()
- Implements:
- Source:
Members
ATSC1_USER_IDENTIFIER :number
When provider is ATSC user data, the ATSC_user_identifier code
for ATSC1_data is "GA94" (0x47413934)
Type:
- number
- Source:
ATSC_PROVIDER_CODE :number
itu_t_35_provider_code for ATSC user_data
Type:
- number
- Source:
MIN_LENGTH :number
Caption packet min length
Country Code + ATSC_PROVIDER_CODE + ATSC_1_USER_IDENTIFIER + USER_DATA_TYPE
Type:
- number
- Source:
USA_COUNTRY_CODE :number
0xB5 is USA's code (Rec. ITU-T T.35)
Type:
- number
- Source:
badFrames_ :number
Number of consecutive bad frames decoded on CEA-608.
Type:
- number
- Source:
cea608DataArray_ :Array.<!shaka.cea.Cea608DataChannel.Cea608Packet>
An array of CEA-608 closed caption data extracted for decoding.
Type:
- Source:
cea608ModeToStream_ :Map.<string, !shaka.cea.Cea608DataChannel>
A map containing the stream for each mode.
Type:
- Map.<string, !shaka.cea.Cea608DataChannel>
- Source:
cea708DataArray_ :Array.<!shaka.cea.Cea708Service.Cea708Byte>
An array of CEA-708 closed caption data extracted for decoding.
Type:
- Array.<!shaka.cea.Cea708Service.Cea708Byte>
- Source:
currentField1Channel_ :number
The current channel that is active on CEA-608 field 1.
Type:
- number
- Source:
currentField2Channel_ :number
The current channel that is active on CEA-608 field 2.
Type:
- number
- Source:
dtvccPacketBuilder_ :shaka.cea.DtvccPacketBuilder
A DTVCC Packet builder for CEA-708 data.
Type:
- Source:
serviceNumberToService_ :Map.<number, shaka.cea.Cea708Service>
Map of service number to CEA-708 services, initially empty. Since there
can be up to 63 services, they are created dynamically only when needed.
Type:
- Map.<number, shaka.cea.Cea708Service>
- Source:
Methods
clear()
Clears the decoder.
- Implements:
- Source:
decode() → {Array.<!shaka.cea.ICaptionDecoder.ClosedCaption>}
Decodes extracted closed caption data.
- Implements:
- Source:
Returns:
- Type
- Array.<!shaka.cea.ICaptionDecoder.ClosedCaption>
decodeCea608_(ccPacket) → {shaka.cea.ICaptionDecoder.ClosedCaption}
Decodes a CEA-608 closed caption packet based on ANSI/CEA-608.
Parameters:
Name | Type | Description |
---|---|---|
ccPacket |
shaka.cea.Cea608DataChannel.Cea608Packet |
- Source:
Returns:
decodeCea708_(dtvccPacket) → {Array.<!shaka.cea.ICaptionDecoder.ClosedCaption>}
Decodes a CEA-708 DTVCC packet based on ANSI/CTA-708-E.
Parameters:
Name | Type | Description |
---|---|---|
dtvccPacket |
shaka.cea.DtvccPacket |
- Source:
Returns:
- Type
- Array.<!shaka.cea.ICaptionDecoder.ClosedCaption>
extract(userDataSeiMessagenon-null, pts)
Extracts closed caption bytes from CEA-X08 packets from the stream based on
ANSI/SCTE 128 and A/53, Part 4.
Parameters:
Name | Type | Description |
---|---|---|
userDataSeiMessage |
Uint8Array | This is a User Data registered by Rec.ITU-T T.35 SEI message. It is described in sections D.1.6 and D.2.6 of Rec. ITU-T H.264 (06/2019). |
pts |
number | PTS when this packet was received, in seconds. |
- Implements:
- Source:
isOddParity_(byte) → {boolean}
Checks if a byte has odd parity (Odd number of 1s in binary).
Parameters:
Name | Type | Description |
---|---|---|
byte |
number |
- Source:
Returns:
True if the byte has odd parity.
- Type
- boolean