Constructor
new Cea708Service(serviceNumbernon-null)
Parameters:
Name | Type | Description |
---|---|---|
serviceNumber |
number |
- Source:
Members
Colors :Array.<!string>
An array of 8 colors that 64 colors can be quantized to. Order here matters.
Type:
- Array.<!string>
- Source:
EXT_CEA708_CTRL_CODE_BYTE1 :number
For extended control codes in block_data on CEA-708, byte 1 is 0x10.
Type:
- number
- Source:
G2Charset :Map.<!number, !string>
Holds characters mapping for bytes that are G2 control codes.
Type:
- Map.<!number, !string>
- Source:
currentWindow_ :shaka.cea.Cea708Window
The current window for which window command operate on.
Type:
- Source:
serviceNumber_ :number
Number for this specific service (1 - 63).
Type:
- number
- Source:
windows_ :Array.<?shaka.cea.Cea708Window>
Eight Cea708 Windows, as defined by the spec.
Type:
- Array.<?shaka.cea.Cea708Window>
- Source:
Methods
clearWindows_(windowsBitmapnon-null, ptsnon-null) → {shaka.cea.ICaptionDecoder.ClosedCaption}
Parameters:
Name | Type | Description |
---|---|---|
windowsBitmap |
number | |
pts |
number |
- Source:
Returns:
defineWindow_(dtvccPacketnon-null, windowNumnon-null, ptsnon-null)
Parameters:
Name | Type | Description |
---|---|---|
dtvccPacket |
shaka.cea.DtvccPacket | |
windowNum |
number | |
pts |
number |
- Source:
Throws:
deleteWindows_(windowsBitmapnon-null, ptsnon-null) → {shaka.cea.ICaptionDecoder.ClosedCaption}
Parameters:
Name | Type | Description |
---|---|---|
windowsBitmap |
number | |
pts |
number |
- Source:
Returns:
displayWindows_(windowsBitmapnon-null, ptsnon-null)
Parameters:
Name | Type | Description |
---|---|---|
windowsBitmap |
number | |
pts |
number |
- Source:
getSpecifiedWindowIds_(bitmap) → {Array.<number>}
Yields each non-null window specified in the 8-bit bitmap.
Parameters:
Name | Type | Description |
---|---|---|
bitmap |
number | 8 bits corresponding to each of the 8 windows. |
- Source:
Returns:
- Type
- Array.<number>
handleC0_(controlCodenon-null, ptsnon-null) → {shaka.cea.ICaptionDecoder.ClosedCaption}
Handles C0 group data.
Parameters:
Name | Type | Description |
---|---|---|
controlCode |
number | |
pts |
number |
- Source:
Returns:
handleC1_(dtvccPacketnon-null, captionCommandnon-null, ptsnon-null) → {shaka.cea.ICaptionDecoder.ClosedCaption}
Processes C1 group data.
These are caption commands.
Parameters:
Name | Type | Description |
---|---|---|
dtvccPacket |
shaka.cea.DtvccPacket | |
captionCommand |
number | |
pts |
number | in seconds |
- Source:
Throws:
-
a possible out-of-range buffer read.
- Type
- shaka.util.Error
Returns:
handleC2_(dtvccPacketnon-null, controlCodenon-null)
Handles C2 group data.
Parameters:
Name | Type | Description |
---|---|---|
dtvccPacket |
shaka.cea.DtvccPacket | |
controlCode |
number |
- Source:
handleC3_(dtvccPacketnon-null, controlCodenon-null)
Handles C3 group data.
Parameters:
Name | Type | Description |
---|---|---|
dtvccPacket |
shaka.cea.DtvccPacket | |
controlCode |
number |
- Source:
handleCea708ControlCode(dtvccPacketnon-null) → {shaka.cea.ICaptionDecoder.ClosedCaption}
Processes a CEA-708 control code.
Parameters:
Name | Type | Description |
---|---|---|
dtvccPacket |
shaka.cea.DtvccPacket |
- Source:
Throws:
Returns:
handleG0_(controlCodenon-null)
Handles G0 group data.
Parameters:
Name | Type | Description |
---|---|---|
controlCode |
number |
- Source:
handleG1_(controlCodenon-null)
Handles G1 group data.
Parameters:
Name | Type | Description |
---|---|---|
controlCode |
number |
- Source:
handleG2_(controlCodenon-null)
Handles G2 group data.
Parameters:
Name | Type | Description |
---|---|---|
controlCode |
number |
- Source:
handleG3_(controlCodenon-null)
Handles G3 group data.
Parameters:
Name | Type | Description |
---|---|---|
controlCode |
number |
- Source:
hideWindows_(windowsBitmapnon-null, ptsnon-null) → {shaka.cea.ICaptionDecoder.ClosedCaption}
Parameters:
Name | Type | Description |
---|---|---|
windowsBitmap |
number | |
pts |
number |
- Source:
Returns:
reset_(ptsnon-null) → {shaka.cea.ICaptionDecoder.ClosedCaption}
Emits anything currently present in any of the windows, and then
deletes all windows, cancels all delays, reinitializes the service.
Parameters:
Name | Type | Description |
---|---|---|
pts |
number |
- Source:
Returns:
rgbColorToHex_(rednon-null, greennon-null, bluenon-null) → {string}
Maps 64 possible CEA-708 colors to 8 CSS colors.
Parameters:
Name | Type | Description |
---|---|---|
red |
number | value from 0-3 |
green |
number | value from 0-3 |
blue |
number | value from 0-3 |
- Source:
Returns:
- Type
- string
setCurrentWindow_(windowNumnon-null)
Parameters:
Name | Type | Description |
---|---|---|
windowNum |
number |
- Source:
setPenAttributes_(dtvccPacketnon-null)
Parameters:
Name | Type | Description |
---|---|---|
dtvccPacket |
shaka.cea.DtvccPacket |
- Source:
Throws:
setPenColor_(dtvccPacketnon-null)
Parameters:
Name | Type | Description |
---|---|---|
dtvccPacket |
shaka.cea.DtvccPacket |
- Source:
Throws:
setPenLocation_(dtvccPacketnon-null)
Parameters:
Name | Type | Description |
---|---|---|
dtvccPacket |
shaka.cea.DtvccPacket |
- Source:
Throws:
setWindowAttributes_(dtvccPacketnon-null)
Parameters:
Name | Type | Description |
---|---|---|
dtvccPacket |
shaka.cea.DtvccPacket |
- Source:
Throws:
toggleWindows_(windowsBitmapnon-null, ptsnon-null) → {shaka.cea.ICaptionDecoder.ClosedCaption}
Parameters:
Name | Type | Description |
---|---|---|
windowsBitmap |
number | |
pts |
number |
- Source:
Returns:
Type Definitions
Cea708Byte
CEA-708 closed captions byte.
Type:
- {pts: number, type: number, value: number, order: number}
Properties:
Name | Type | Description |
---|---|---|
pts |
number | Presentation timestamp (in second) at which this packet was received. |
type |
number | Type of the byte. Either 2 or 3, DTVCC Packet Data or a DTVCC Packet Start. |
value |
number | The byte containing data relevant to the packet. |
order |
number | A number indicating the order this packet was received in a sequence of packets. Used to break ties in a stable sorting algorithm |
- Source: