cleanup: Fix nullability declarations

Cleanup imported from an internal Google migration process, courtesy
of Laura Harker.

Change-Id: I11de518eafe6008938589e5250bdcaf8151267e9
This commit is contained in:
Joey Parrish
2021-06-21 15:54:39 -07:00
parent 4c7767f6be
commit 38ce45dce5
24 changed files with 291 additions and 291 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ shaka.extern.IAdManager = class extends EventTarget {
/**
* @param {!google.ima.dai.api.StreamRequest} imaRequest
* @param {string=} backupUrl
* @return {!Promise.<!string>}
* @return {!Promise.<string>}
*/
requestServerSideStream(imaRequest, backupUrl) {}
+10 -10
View File
@@ -128,7 +128,7 @@ shaka.extern.Cue = class {
/**
* The text payload of the cue. If nestedCues is non-empty, this should be
* empty. Top-level block containers should have no payload of their own.
* @type {!string}
* @type {string}
* @exportDoc
*/
this.payload;
@@ -234,14 +234,14 @@ shaka.extern.Cue = class {
/**
* Text color as a CSS color, e.g. "#FFFFFF" or "white".
* @type {!string}
* @type {string}
* @exportDoc
*/
this.color;
/**
* Text background color as a CSS color, e.g. "#FFFFFF" or "white".
* @type {!string}
* @type {string}
* @exportDoc
*/
this.backgroundColor;
@@ -257,14 +257,14 @@ shaka.extern.Cue = class {
/**
* The URL of the background image, e.g. "data:[mime type];base64,[data]".
* @type {!string}
* @type {string}
* @exportDoc
*/
this.backgroundImage;
/**
* The border around this cue as a CSS border.
* @type {!string}
* @type {string}
* @exportDoc
*/
this.border;
@@ -292,28 +292,28 @@ shaka.extern.Cue = class {
/**
* Text font family.
* @type {!string}
* @type {string}
* @exportDoc
*/
this.fontFamily;
/**
* Text letter spacing as a CSS letter-spacing value.
* @type {!string}
* @type {string}
* @exportDoc
*/
this.letterSpacing;
/**
* Text line padding as a CSS line-padding value.
* @type {!string}
* @type {string}
* @exportDoc
*/
this.linePadding;
/**
* Opacity of the cue element, from 0-1.
* @type {!number}
* @type {number}
* @exportDoc
*/
this.opacity;
@@ -335,7 +335,7 @@ shaka.extern.Cue = class {
/**
* Id of the cue.
* @type {!string}
* @type {string}
* @exportDoc
*/
this.id;
+55 -55
View File
@@ -17,8 +17,8 @@ goog.requireType('shaka.cea.ICaptionDecoder');
*/
shaka.cea.Cea608DataChannel = class {
/**
* @param {!number} fieldNum Field number.
* @param {!number} channelNum Channel number.
* @param {number} fieldNum Field number.
* @param {number} channelNum Channel number.
*/
constructor(fieldNum, channelNum) {
/**
@@ -58,7 +58,7 @@ shaka.cea.Cea608DataChannel = class {
/**
* End time of the previous caption, serves as start time of next caption.
* @private {!number}
* @private {number}
*/
this.prevEndTime_ = 0;
@@ -83,9 +83,9 @@ shaka.cea.Cea608DataChannel = class {
/**
* Gets the row index from a Preamble Address Code byte pair.
* @param {!number} b1 Byte 1.
* @param {!number} b2 Byte 2.
* @return {!number} Row index.
* @param {number} b1 Byte 1.
* @param {number} b2 Byte 2.
* @return {number} Row index.
* @private
*/
pacToRow_(b1, b2) {
@@ -106,8 +106,8 @@ shaka.cea.Cea608DataChannel = class {
* PAC - Preamble Address Code.
* b1 is of the form |P|0|0|1|C|0|ROW|
* b2 is of the form |P|1|N|ATTRIBUTE|U|
* @param {!number} b1 Byte 1.
* @param {!number} b2 Byte 2.
* @param {number} b1 Byte 1.
* @param {number} b2 Byte 2.
* @private
*/
controlPac_(b1, b2) {
@@ -165,7 +165,7 @@ shaka.cea.Cea608DataChannel = class {
/**
* Mid-Row control code handler.
* @param {!number} b2 Byte #2.
* @param {number} b2 Byte #2.
* @private
*/
controlMidrow_(b2) {
@@ -198,8 +198,8 @@ shaka.cea.Cea608DataChannel = class {
/**
* Background attribute control code handler.
* @param {!number} b1 Byte #1
* @param {!number} b2 Byte #2.
* @param {number} b1 Byte #1
* @param {number} b2 Byte #2.
* @private
*/
controlBackgroundAttribute_(b1, b2) {
@@ -279,7 +279,7 @@ shaka.cea.Cea608DataChannel = class {
* CR only affects scroll windows (Rollup and Text modes).
* Any currently buffered line needs to be emitted, along
* with a window scroll action.
* @param {!number} pts in seconds.
* @param {number} pts in seconds.
* @return {?shaka.cea.ICaptionDecoder.ClosedCaption}
* @private
*/
@@ -311,8 +311,8 @@ shaka.cea.Cea608DataChannel = class {
* Handles RU2, RU3, RU4 - Roll-Up, N rows.
* If in TEXT, POPON or PAINTON, any displayed captions are erased.
* This means must force emit entire display buffer.
* @param {!number} scrollSize New scroll window size.
* @param {!number} pts
* @param {number} scrollSize New scroll window size.
* @param {number} pts
* @return {?shaka.cea.ICaptionDecoder.ClosedCaption}
* @private
*/
@@ -356,7 +356,7 @@ shaka.cea.Cea608DataChannel = class {
* Handles EDM - Erase Displayed Mem
* Mode check:
* EDM affects all captioning modes (but not Text mode);
* @param {!number} pts
* @param {number} pts
* @return {?shaka.cea.ICaptionDecoder.ClosedCaption}
* @private
*/
@@ -375,7 +375,7 @@ shaka.cea.Cea608DataChannel = class {
/**
* Handles RDC - Resume Direct Captions. Initiates Paint-On captioning mode.
* RDC does not affect current display, so nothing needs to be forced out yet.
* @param {!number} pts in seconds
* @param {number} pts in seconds
* @private
*/
controlRdc_(pts) {
@@ -403,7 +403,7 @@ shaka.cea.Cea608DataChannel = class {
* Handles EOC - End Of Caption (flip mem)
* This forces Pop-On mode, and swaps the displayed and nondisplayed memories.
* @private
* @param {!number} pts
* @param {number} pts
* @return {?shaka.cea.ICaptionDecoder.ClosedCaption}
*/
controlEoc_(pts) {
@@ -472,8 +472,8 @@ shaka.cea.Cea608DataChannel = class {
/**
* Handles a Basic North American byte pair.
* @param {!number} b1 Byte 1.
* @param {!number} b2 Byte 2.
* @param {number} b1 Byte 1.
* @param {number} b2 Byte 2.
*/
handleBasicNorthAmericanChar(b1, b2) {
this.curbuf_.addChar(
@@ -484,8 +484,8 @@ shaka.cea.Cea608DataChannel = class {
/**
* Handles an Extended Western European byte pair.
* @param {!number} b1 Byte 1.
* @param {!number} b2 Byte 2.
* @param {number} b1 Byte 1.
* @param {number} b2 Byte 2.
* @private
*/
handleExtendedWesternEuropeanChar_(b1, b2) {
@@ -539,9 +539,9 @@ shaka.cea.Cea608DataChannel = class {
/**
* Checks if this is a Miscellaneous control code.
* @param {!number} b1 Byte 1.
* @param {!number} b2 Byte 2.
* @return {!boolean}
* @param {number} b1 Byte 1.
* @param {number} b2 Byte 2.
* @return {boolean}
* @private
*/
isMiscellaneous_(b1, b2) {
@@ -553,9 +553,9 @@ shaka.cea.Cea608DataChannel = class {
/**
* Checks if this is a PAC control code.
* @param {!number} b1 Byte 1.
* @param {!number} b2 Byte 2.
* @return {!boolean}
* @param {number} b1 Byte 1.
* @param {number} b2 Byte 2.
* @return {boolean}
* @private
*/
isPAC_(b1, b2) {
@@ -567,9 +567,9 @@ shaka.cea.Cea608DataChannel = class {
/**
* Checks if this is a Midrow style change control code.
* @param {!number} b1 Byte 1.
* @param {!number} b2 Byte 2.
* @return {!boolean}
* @param {number} b1 Byte 1.
* @param {number} b2 Byte 2.
* @return {boolean}
* @private
*/
isMidrowStyleChange_(b1, b2) {
@@ -581,9 +581,9 @@ shaka.cea.Cea608DataChannel = class {
/**
* Checks if this is a background attribute control code.
* @param {!number} b1 Byte 1.
* @param {!number} b2 Byte 2.
* @return {!boolean}
* @param {number} b1 Byte 1.
* @param {number} b2 Byte 2.
* @return {boolean}
* @private
*/
isBackgroundAttribute_(b1, b2) {
@@ -596,9 +596,9 @@ shaka.cea.Cea608DataChannel = class {
/**
* Checks if the character is in the Special North American char. set.
* @param {!number} b1 Byte 1.
* @param {!number} b2 Byte 2.
* @return {!boolean}
* @param {number} b1 Byte 1.
* @param {number} b2 Byte 2.
* @return {boolean}
* @private
*/
isSpecialNorthAmericanChar_(b1, b2) {
@@ -610,9 +610,9 @@ shaka.cea.Cea608DataChannel = class {
/**
* Checks if the character is in the Extended Western European char. set.
* @param {!number} b1 Byte 1.
* @param {!number} b2 Byte 2.
* @return {!boolean}
* @param {number} b1 Byte 1.
* @param {number} b2 Byte 2.
* @return {boolean}
* @private
*/
isExtendedWesternEuropeanChar_(b1, b2) {
@@ -624,8 +624,8 @@ shaka.cea.Cea608DataChannel = class {
/**
* Checks if the data contains a control code.
* @param {!number} b1 Byte 1.
* @return {!boolean}
* @param {number} b1 Byte 1.
* @return {boolean}
*/
static isControlCode(b1) {
// For control codes, the first byte takes the following form:
@@ -636,7 +636,7 @@ shaka.cea.Cea608DataChannel = class {
/**
* Command codes.
* @enum {!number}
* @enum {number}
* @private
*/
shaka.cea.Cea608DataChannel.MiscCmd_ = {
@@ -691,7 +691,7 @@ shaka.cea.Cea608DataChannel.MiscCmd_ = {
/**
* Caption type.
* @private @const @enum {!number}
* @private @const @enum {number}
*/
shaka.cea.Cea608DataChannel.CaptionType = {
NONE: 0,
@@ -702,7 +702,7 @@ shaka.cea.Cea608DataChannel.CaptionType = {
};
/**
* @const {!Array<!string>}
* @const {!Array<string>}
*/
shaka.cea.Cea608DataChannel.BG_COLORS = [
'black',
@@ -716,7 +716,7 @@ shaka.cea.Cea608DataChannel.BG_COLORS = [
];
/**
* @const {!Array<!string>}
* @const {!Array<string>}
*/
shaka.cea.Cea608DataChannel.TEXT_COLORS = [
'white',
@@ -743,20 +743,20 @@ shaka.cea.Cea608DataChannel.Style;
/**
* CEA closed captions packet.
* @typedef {{
* pts: !number,
* type: !number,
* ccData1: !number,
* ccData2: !number,
* order: !number
* pts: number,
* type: number,
* ccData1: number,
* ccData2: number,
* order: number
* }}
*
* @property {!number} pts
* @property {number} pts
* Presentation timestamp (in second) at which this packet was received.
* @property {!number} type
* @property {number} type
* Type of the packet. Either 0 or 1, representing the CEA-608 field.
* @property {!number} ccData1 CEA-608 byte 1.
* @property {!number} ccData2 CEA-608 byte 2.
* @property {(!number)} order
* @property {number} ccData1 CEA-608 byte 1.
* @property {number} ccData2 CEA-608 byte 2.
* @property {number} order
* A number indicating the order this packet was received in a sequence
* of packets. Used to break ties in a stable sorting algorithm
*/
+32 -32
View File
@@ -16,8 +16,8 @@ goog.requireType('shaka.cea.ICaptionDecoder');
*/
shaka.cea.Cea608Memory = class {
/**
* @param {!number} fieldNum Field number.
* @param {!number} channelNum Channel number.
* @param {number} fieldNum Field number.
* @param {number} channelNum Channel number.
*/
constructor(fieldNum, channelNum) {
/**
@@ -28,45 +28,45 @@ shaka.cea.Cea608Memory = class {
/**
* Current row.
* @private {!number}
* @private {number}
*/
this.row_ = 1;
/**
* Number of rows in the scroll window. Used for rollup mode.
* @private {!number}
* @private {number}
*/
this.scrollRows_ = 0;
/**
* Field number.
* @private {!number}
* @private {number}
*/
this.fieldNum_ = fieldNum;
/**
* Channel number.
* @private {!number}
* @private {number}
*/
this.channelNum_ = channelNum;
/**
* @private {!boolean}
* @private {boolean}
*/
this.underline_ = false;
/**
* @private {!boolean}
* @private {boolean}
*/
this.italics_ = false;
/**
* @private {!string}
* @private {string}
*/
this.textColor_ = shaka.cea.CeaUtils.DEFAULT_TXT_COLOR;
/**
* @private {!string}
* @private {string}
*/
this.backgroundColor_ = shaka.cea.CeaUtils.DEFAULT_BG_COLOR;
@@ -75,8 +75,8 @@ shaka.cea.Cea608Memory = class {
/**
* Emits a closed caption based on the state of the buffer.
* @param {!number} startTime Start time of the cue.
* @param {!number} endTime End time of the cue.
* @param {number} startTime Start time of the cue.
* @param {number} endTime End time of the cue.
* @return {?shaka.cea.ICaptionDecoder.ClosedCaption}
*/
forceEmit(startTime, endTime) {
@@ -96,28 +96,28 @@ shaka.cea.Cea608Memory = class {
}
/**
* @return {!number}
* @return {number}
*/
getRow() {
return this.row_;
}
/**
* @param {!number} row
* @param {number} row
*/
setRow(row) {
this.row_ = row;
}
/**
* @return {!number}
* @return {number}
*/
getScrollSize() {
return this.scrollRows_;
}
/**
* @param {!number} scrollRows
* @param {number} scrollRows
*/
setScrollSize(scrollRows) {
this.scrollRows_ = scrollRows;
@@ -126,7 +126,7 @@ shaka.cea.Cea608Memory = class {
/**
* Adds a character to the buffer.
* @param {!shaka.cea.Cea608Memory.CharSet} set Character set.
* @param {!number} b CC byte to add.
* @param {number} b CC byte to add.
*/
addChar(set, b) {
// Valid chars are in the range [0x20, 0x7f]
@@ -179,9 +179,9 @@ shaka.cea.Cea608Memory = class {
/**
* Moves rows of characters.
* @param {!number} dst Destination row index.
* @param {!number} src Source row index.
* @param {!number} count Count of rows to move.
* @param {number} dst Destination row index.
* @param {number} src Source row index.
* @param {number} count Count of rows to move.
*/
moveRows(dst, src, count) {
if (dst >= src) {
@@ -197,8 +197,8 @@ shaka.cea.Cea608Memory = class {
/**
* Resets rows of characters.
* @param {!number} idx Starting index.
* @param {!number} count Count of rows to reset.
* @param {number} idx Starting index.
* @param {number} count Count of rows to reset.
*/
resetRows(idx, count) {
for (let i = 0; i <= count; i++) {
@@ -223,28 +223,28 @@ shaka.cea.Cea608Memory = class {
}
/**
* @param {!boolean} underline
* @param {boolean} underline
*/
setUnderline(underline) {
this.underline_ = underline;
}
/**
* @param {!boolean} italics
* @param {boolean} italics
*/
setItalics(italics) {
this.italics_ = italics;
}
/**
* @param {!string} color
* @param {string} color
*/
setTextColor(color) {
this.textColor_ = color;
}
/**
* @param {!string} color
* @param {string} color
*/
setBackgroundColor(color) {
this.backgroundColor_ = color;
@@ -253,13 +253,13 @@ shaka.cea.Cea608Memory = class {
/**
* Maximum number of rows in the buffer.
* @const {!number}
* @const {number}
*/
shaka.cea.Cea608Memory.CC_ROWS = 15;
/**
* Characters sets.
* @const @enum {!number}
* @const @enum {number}
*/
shaka.cea.Cea608Memory.CharSet = {
BASIC_NORTH_AMERICAN: 0,
@@ -270,7 +270,7 @@ shaka.cea.Cea608Memory.CharSet = {
/**
* Basic North American char set deviates from ASCII with these exceptions.
* @private @const {!Map<!number, !string>}
* @private @const {!Map<number, string>}
*/
shaka.cea.Cea608Memory.CharSet.BasicNorthAmericanChars = new Map([
[0x27, ''], [0x2a, 'á'], [0x5c, 'é'], [0x5c, 'é'], [0x5e, 'í'], [0x5f, 'ó'],
@@ -280,7 +280,7 @@ shaka.cea.Cea608Memory.CharSet.BasicNorthAmericanChars = new Map([
/**
* Special North American char set.
* Note: Transparent Space is currently implemented as a regular space.
* @private @const {!Map<!number, !string>}
* @private @const {!Map<number, string>}
*/
shaka.cea.Cea608Memory.CharSet.SpecialNorthAmericanChars = new Map([
[0x30, '®'], [0x31, '°'], [0x32, '½'], [0x33, '¿'], [0x34, '™'], [0x35, '¢'],
@@ -290,7 +290,7 @@ shaka.cea.Cea608Memory.CharSet.SpecialNorthAmericanChars = new Map([
/**
* Extended Spanish/Misc/French char set.
* @private @const {!Map<!number, !string>}
* @private @const {!Map<number, string>}
*/
shaka.cea.Cea608Memory.CharSet.ExtendedSpanishFrench = new Map([
[0x20, 'Á'], [0x21, 'É'], [0x22, 'Ó'], [0x23, 'Ú'], [0x24, 'Ü'], [0x25, 'ü'],
@@ -303,7 +303,7 @@ shaka.cea.Cea608Memory.CharSet.ExtendedSpanishFrench = new Map([
/**
* Extended Portuguese/German/Danish char set.
* @private @const {!Map<!number, !string>}
* @private @const {!Map<number, string>}
*/
shaka.cea.Cea608Memory.CharSet.ExtendedPortugueseGerman = new Map([
[0x20, 'Ã'], [0x21, 'ã'], [0x22, 'Í'], [0x23, 'Ì'], [0x24, 'ì'], [0x25, 'Ò'],
+43 -43
View File
@@ -18,12 +18,12 @@ goog.require('shaka.util.Error');
*/
shaka.cea.Cea708Service = class {
/**
* @param {!number} serviceNumber
* @param {number} serviceNumber
*/
constructor(serviceNumber) {
/**
* Number for this specific service (1 - 63).
* @private {!number}
* @private {number}
*/
this.serviceNumber_ = serviceNumber;
@@ -84,7 +84,7 @@ shaka.cea.Cea708Service = class {
/**
* Handles G0 group data.
* @param {!number} controlCode
* @param {number} controlCode
* @private
*/
handleG0_(controlCode) {
@@ -102,7 +102,7 @@ shaka.cea.Cea708Service = class {
/**
* Handles G1 group data.
* @param {!number} controlCode
* @param {number} controlCode
* @private
*/
handleG1_(controlCode) {
@@ -115,7 +115,7 @@ shaka.cea.Cea708Service = class {
/**
* Handles G2 group data.
* @param {!number} controlCode
* @param {number} controlCode
* @private
*/
handleG2_(controlCode) {
@@ -134,7 +134,7 @@ shaka.cea.Cea708Service = class {
/**
* Handles G3 group data.
* @param {!number} controlCode
* @param {number} controlCode
* @private
*/
handleG3_(controlCode) {
@@ -155,8 +155,8 @@ shaka.cea.Cea708Service = class {
/**
* Handles C0 group data.
* @param {!number} controlCode
* @param {!number} pts
* @param {number} controlCode
* @param {number} pts
* @return {?shaka.cea.ICaptionDecoder.ClosedCaption}
* @private
*/
@@ -206,8 +206,8 @@ shaka.cea.Cea708Service = class {
* Processes C1 group data.
* These are caption commands.
* @param {!shaka.cea.DtvccPacket} dtvccPacket
* @param {!number} captionCommand
* @param {!number} pts in seconds
* @param {number} captionCommand
* @param {number} pts in seconds
* @return {?shaka.cea.ICaptionDecoder.ClosedCaption}
* @throws {!shaka.util.Error} a possible out-of-range buffer read.
* @private
@@ -255,7 +255,7 @@ shaka.cea.Cea708Service = class {
/**
* Handles C2 group data.
* @param {!shaka.cea.DtvccPacket} dtvccPacket
* @param {!number} controlCode
* @param {number} controlCode
* @private
*/
handleC2_(dtvccPacket, controlCode) {
@@ -273,7 +273,7 @@ shaka.cea.Cea708Service = class {
/**
* Handles C3 group data.
* @param {!shaka.cea.DtvccPacket} dtvccPacket
* @param {!number} controlCode
* @param {number} controlCode
* @private
*/
handleC3_(dtvccPacket, controlCode) {
@@ -287,7 +287,7 @@ shaka.cea.Cea708Service = class {
}
/**
* @param {!number} windowNum
* @param {number} windowNum
* @private
*/
setCurrentWindow_(windowNum) {
@@ -300,8 +300,8 @@ shaka.cea.Cea708Service = class {
/**
* Yields each non-null window specified in the 8-bit bitmap.
* @param {!number} bitmap 8 bits corresponding to each of the 8 windows.
* @return {!Iterable.<!number>}
* @param {number} bitmap 8 bits corresponding to each of the 8 windows.
* @return {!Iterable.<number>}
* @private
*/
* getSpecifiedWindowIds_(bitmap) {
@@ -315,8 +315,8 @@ shaka.cea.Cea708Service = class {
}
/**
* @param {!number} windowsBitmap
* @param {!number} pts
* @param {number} windowsBitmap
* @param {number} pts
* @return {?shaka.cea.ICaptionDecoder.ClosedCaption}
* @private
*/
@@ -336,8 +336,8 @@ shaka.cea.Cea708Service = class {
}
/**
* @param {!number} windowsBitmap
* @param {!number} pts
* @param {number} windowsBitmap
* @param {number} pts
* @private
*/
displayWindows_(windowsBitmap, pts) {
@@ -353,8 +353,8 @@ shaka.cea.Cea708Service = class {
}
/**
* @param {!number} windowsBitmap
* @param {!number} pts
* @param {number} windowsBitmap
* @param {number} pts
* @return {?shaka.cea.ICaptionDecoder.ClosedCaption}
* @private
*/
@@ -374,8 +374,8 @@ shaka.cea.Cea708Service = class {
}
/**
* @param {!number} windowsBitmap
* @param {!number} pts
* @param {number} windowsBitmap
* @param {number} pts
* @return {?shaka.cea.ICaptionDecoder.ClosedCaption}
* @private
*/
@@ -399,8 +399,8 @@ shaka.cea.Cea708Service = class {
}
/**
* @param {!number} windowsBitmap
* @param {!number} pts
* @param {number} windowsBitmap
* @param {number} pts
* @return {?shaka.cea.ICaptionDecoder.ClosedCaption}
* @private
*/
@@ -422,7 +422,7 @@ shaka.cea.Cea708Service = class {
/**
* Emits anything currently present in any of the windows, and then
* deletes all windows, cancels all delays, reinitializes the service.
* @param {!number} pts
* @param {number} pts
* @return {?shaka.cea.ICaptionDecoder.ClosedCaption}
* @private
*/
@@ -559,8 +559,8 @@ shaka.cea.Cea708Service = class {
/**
* @param {!shaka.cea.DtvccPacket} dtvccPacket
* @param {!number} windowNum
* @param {!number} pts
* @param {number} windowNum
* @param {number} pts
* @throws {!shaka.util.Error}
* @private
*/
@@ -612,10 +612,10 @@ shaka.cea.Cea708Service = class {
/**
* Maps 64 possible CEA-708 colors to 8 CSS colors.
* @param {!number} red value from 0-3
* @param {!number} green value from 0-3
* @param {!number} blue value from 0-3
* @return {!string}
* @param {number} red value from 0-3
* @param {number} green value from 0-3
* @param {number} blue value from 0-3
* @return {string}
* @private
*/
rgbColorToHex_(red, green, blue) {
@@ -636,34 +636,34 @@ shaka.cea.Cea708Service = class {
};
/**
* @private @const {!number}
* @private @const {number}
*/
shaka.cea.Cea708Service.ASCII_BACKSPACE = 0x08;
/**
* @private @const {!number}
* @private @const {number}
*/
shaka.cea.Cea708Service.ASCII_FORM_FEED = 0x0c;
/**
* @private @const {!number}
* @private @const {number}
*/
shaka.cea.Cea708Service.ASCII_CARRIAGE_RETURN = 0x0d;
/**
* @private @const {!number}
* @private @const {number}
*/
shaka.cea.Cea708Service.ASCII_HOR_CARRIAGE_RETURN = 0x0e;
/**
* For extended control codes in block_data on CEA-708, byte 1 is 0x10.
* @private @const {!number}
* @private @const {number}
*/
shaka.cea.Cea708Service.EXT_CEA708_CTRL_CODE_BYTE1 = 0x10;
/**
* Holds characters mapping for bytes that are G2 control codes.
* @private @const {!Map<!number, !string>}
* @private @const {!Map<number, string>}
*/
shaka.cea.Cea708Service.G2Charset = new Map([
[0x20, ' '], [0x21, '\xa0'], [0x25, '…'], [0x2a, 'Š'], [0x2c, 'Œ'],
@@ -675,7 +675,7 @@ shaka.cea.Cea708Service.G2Charset = new Map([
/**
* An array of 8 colors that 64 colors can be quantized to. Order here matters.
* @private @const {!Array<!string>}
* @private @const {!Array<string>}
*/
shaka.cea.Cea708Service.Colors = [
'black', 'blue', 'green', 'cyan',
@@ -691,12 +691,12 @@ shaka.cea.Cea708Service.Colors = [
* order: number
* }}
*
* @property {!number} pts
* @property {number} pts
* Presentation timestamp (in second) at which this packet was received.
* @property {!number} type
* @property {number} type
* Type of the byte. Either 2 or 3, DTVCC Packet Data or a DTVCC Packet Start.
* @property {!number} value The byte containing data relevant to the packet.
* @property {!number} order
* @property {number} value The byte containing data relevant to the packet.
* @property {number} order
* A number indicating the order this packet was received in a sequence
* of packets. Used to break ties in a stable sorting algorithm
*/
+38 -38
View File
@@ -18,38 +18,38 @@ goog.require('shaka.util.Functional');
*/
shaka.cea.Cea708Window = class {
/**
* @param {!number} windowNum
* @param {number} windowNum
*/
constructor(windowNum) {
/**
* A number from 0 - 7 indicating the window number in the
* service that owns this window.
* @private {!number}
* @private {number}
*/
this.windowNum_ = windowNum;
/**
* Indicates whether this window is visible.
* @private {!boolean}
* @private {boolean}
*/
this.visible_ = false;
/**
* Indicates whether the horizontal and vertical anchors coordinates specify
* a percentage of the screen, or physical coordinates on the screen.
* @private {!boolean}
* @private {boolean}
*/
this.relativeToggle_ = false;
/**
* Horizontal anchor. Loosely corresponds to a WebVTT viewport X anchor.
* @private {!number}
* @private {number}
*/
this.horizontalAnchor_ = 0;
/**
* Vertical anchor. Loosely corresponds to a WebVTT viewport Y anchor.
* @private {!number}
* @private {number}
*/
this.verticalAnchor_ = 0;
@@ -62,19 +62,19 @@ shaka.cea.Cea708Window = class {
* 6________7________8
* Diagram is valid as per CEA-708-E section 8.4.4.
* Each of these locations corresponds to a WebVTT region's "region anchor".
* @private {!number}
* @private {number}
*/
this.anchorId_ = 0;
/**
* Indicates the number of rows in this window's buffer/memory.
* @private {!number}
* @private {number}
*/
this.rowCount_ = 0;
/**
* Indicates the number of columns in this window's buffer/memory.
* @private {!number}
* @private {number}
*/
this.colCount_ = 0;
@@ -92,43 +92,43 @@ shaka.cea.Cea708Window = class {
this.memory_ = [];
/**
* @private {!number}
* @private {number}
*/
this.startTime_ = 0;
/**
* Row that the current pen is pointing at.
* @private {!number}
* @private {number}
*/
this.row_ = 0;
/**
* Column that the current pen is pointing at.
* @private {!number}
* @private {number}
*/
this.col_ = 0;
/**
* Indicates whether the current pen position is italicized.
* @private {!boolean}
* @private {boolean}
*/
this.italics_ = false;
/**
* Indicates whether the current pen position is underlined.
* @private {!boolean}
* @private {boolean}
*/
this.underline_ = false;
/**
* Indicates the text color at the current pen position.
* @private {!string}
* @private {string}
*/
this.textColor_ = shaka.cea.CeaUtils.DEFAULT_TXT_COLOR;
/**
* Indicates the background color at the current pen position.
* @private {!string}
* @private {string}
*/
this.backgroundColor_ = shaka.cea.CeaUtils.DEFAULT_BG_COLOR;
@@ -141,13 +141,13 @@ shaka.cea.Cea708Window = class {
}
/**
* @param {!boolean} visible
* @param {!number} verticalAnchor
* @param {!number} horizontalAnchor
* @param {!number} anchorId
* @param {!boolean} relativeToggle
* @param {!number} rowCount
* @param {!number} colCount
* @param {boolean} visible
* @param {number} verticalAnchor
* @param {number} horizontalAnchor
* @param {number} anchorId
* @param {boolean} relativeToggle
* @param {number} rowCount
* @param {number} colCount
*/
defineWindow(visible, verticalAnchor, horizontalAnchor, anchorId,
relativeToggle, rowCount, colCount) {
@@ -185,7 +185,7 @@ shaka.cea.Cea708Window = class {
/**
* Sets the unicode value for a char at the current pen location.
* @param {!string} char
* @param {string} char
*/
setCharacter(char) {
// Check if the pen is out of bounds.
@@ -238,7 +238,7 @@ shaka.cea.Cea708Window = class {
}
/**
* @return {!boolean}
* @return {boolean}
*/
isVisible() {
return this.visible_;
@@ -246,7 +246,7 @@ shaka.cea.Cea708Window = class {
/**
* Moves up <count> rows in the buffer.
* @param {!number} count
* @param {number} count
* @private
*/
moveUpRows_(count) {
@@ -286,8 +286,8 @@ shaka.cea.Cea708Window = class {
}
/**
* @param {!number} endTime
* @param {!number} serviceNumber Number of the service emitting this caption.
* @param {number} endTime
* @param {number} serviceNumber Number of the service emitting this caption.
* @return {?shaka.cea.ICaptionDecoder.ClosedCaption}
*/
forceEmit(endTime, serviceNumber) {
@@ -318,8 +318,8 @@ shaka.cea.Cea708Window = class {
}
/**
* @param {!number} row
* @param {!number} col
* @param {number} row
* @param {number} col
*/
setPenLocation(row, col) {
this.row_ = row;
@@ -327,28 +327,28 @@ shaka.cea.Cea708Window = class {
}
/**
* @param {!string} backgroundColor
* @param {string} backgroundColor
*/
setPenBackgroundColor(backgroundColor) {
this.backgroundColor_ = backgroundColor;
}
/**
* @param {!string} textColor
* @param {string} textColor
*/
setPenTextColor(textColor) {
this.textColor_ = textColor;
}
/**
* @param {!boolean} underline
* @param {boolean} underline
*/
setPenUnderline(underline) {
this.underline_ = underline;
}
/**
* @param {!boolean} italics
* @param {boolean} italics
*/
setPenItalics(italics) {
this.italics_ = italics;
@@ -394,7 +394,7 @@ shaka.cea.Cea708Window = class {
/**
* Sets the start time for the cue to be emitted.
* @param {!number} pts
* @param {number} pts
*/
setStartTime(pts) {
this.startTime_ = pts;
@@ -403,7 +403,7 @@ shaka.cea.Cea708Window = class {
/**
* Caption type.
* @const @enum {!number}
* @const @enum {number}
*/
shaka.cea.Cea708Window.TextJustification = {
LEFT: 0,
@@ -415,12 +415,12 @@ shaka.cea.Cea708Window.TextJustification = {
/**
* Can be indexed 0-31 for 4:3 format, and 0-41 for 16:9 formats.
* Thus the absolute maximum is 42 columns for the 16:9 format.
* @private @const {!number}
* @private @const {number}
*/
shaka.cea.Cea708Window.MAX_COLS = 42;
/**
* Maximum of 15 rows that can be indexed from 0 to 14.
* @private @const {!number}
* @private @const {number}
*/
shaka.cea.Cea708Window.MAX_ROWS = 15;
+12 -12
View File
@@ -43,13 +43,13 @@ shaka.cea.CeaDecoder = class {
/**
* Number of consecutive bad frames decoded on CEA-608.
* @private {!number}
* @private {number}
*/
this.badFrames_ = 0;
/**
* A map containing the stream for each mode.
* @private {!Map<!string, !shaka.cea.Cea608DataChannel>}
* @private {!Map<string, !shaka.cea.Cea608DataChannel>}
*/
this.cea608ModeToStream_ = new Map([
['CC1', new shaka.cea.Cea608DataChannel(0, 0)], // F1 + C1 -> CC1
@@ -60,20 +60,20 @@ shaka.cea.CeaDecoder = class {
/**
* The current channel that is active on CEA-608 field 1.
* @private {!number}
* @private {number}
*/
this.currentField1Channel_ = 0;
/**
* The current channel that is active on CEA-608 field 2.
* @private {!number}
* @private {number}
*/
this.currentField2Channel_ = 0;
/**
* 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.
* @private {!Map<!number, shaka.cea.Cea708Service>}
* @private {!Map<number, shaka.cea.Cea708Service>}
*/
this.serviceNumberToService_ = new Map();
@@ -360,8 +360,8 @@ shaka.cea.CeaDecoder = class {
/**
* Checks if a byte has odd parity (Odd number of 1s in binary).
* @param {!number} byte
* @return {!boolean} True if the byte has odd parity.
* @param {number} byte
* @return {boolean} True if the byte has odd parity.
* @private
*/
isOddParity_(byte) {
@@ -376,29 +376,29 @@ shaka.cea.CeaDecoder = class {
/**
* itu_t_35_provider_code for ATSC user_data
* @private @const {!number}
* @private @const {number}
*/
shaka.cea.CeaDecoder.ATSC_PROVIDER_CODE = 0x0031;
/**
* When provider is ATSC user data, the ATSC_user_identifier code
* for ATSC1_data is "GA94" (0x47413934)
* @private @const {!number}
* @private @const {number}
*/
shaka.cea.CeaDecoder.ATSC1_USER_IDENTIFIER = 0x47413934;
/**
* @private @const {!number}
* @private @const {number}
*/
shaka.cea.CeaDecoder.NTSC_CC_FIELD_1 = 0;
/**
* @private @const {!number}
* @private @const {number}
*/
shaka.cea.CeaDecoder.NTSC_CC_FIELD_2 = 1;
/**
* 0xB5 is USA's code (Rec. ITU-T T.35)
* @private @const {!number}
* @private @const {number}
*/
shaka.cea.CeaDecoder.USA_COUNTRY_CODE = 0xb5;
+23 -23
View File
@@ -15,10 +15,10 @@ shaka.cea.CeaUtils = class {
/**
* Emits a closed caption based on the state of the buffer.
* @param {!shaka.text.Cue} topLevelCue
* @param {!string} stream
* @param {string} stream
* @param {!Array<!Array<?shaka.cea.CeaUtils.StyledChar>>} memory
* @param {!number} startTime Start time of the cue.
* @param {!number} endTime End time of the cue.
* @param {number} startTime Start time of the cue.
* @param {number} endTime End time of the cue.
* @return {?shaka.cea.ICaptionDecoder.ClosedCaption}
*/
static getParsedCaption(topLevelCue, stream, memory, startTime, endTime) {
@@ -153,12 +153,12 @@ shaka.cea.CeaUtils = class {
}
/**
* @param {!number} startTime
* @param {!number} endTime
* @param {!boolean} underline
* @param {!boolean} italics
* @param {!string} txtColor
* @param {!string} bgColor
* @param {number} startTime
* @param {number} endTime
* @param {boolean} underline
* @param {boolean} italics
* @param {string} txtColor
* @param {string} bgColor
* @return {!shaka.text.Cue}
*/
static createStyledCue(startTime, endTime, underline,
@@ -176,8 +176,8 @@ shaka.cea.CeaUtils = class {
}
/**
* @param {!number} startTime
* @param {!number} endTime
* @param {number} startTime
* @param {number} endTime
* @return {!shaka.text.Cue}
*/
static createLineBreakCue(startTime, endTime) {
@@ -198,61 +198,61 @@ shaka.cea.CeaUtils.StyledChar = class {
*/
constructor(character, underline, italics, backgroundColor, textColor) {
/**
* @private {!string}
* @private {string}
*/
this.character_ = character;
/**
* @private {!boolean}
* @private {boolean}
*/
this.underline_ = underline;
/**
* @private {!boolean}
* @private {boolean}
*/
this.italics_ = italics;
/**
* @private {!string}
* @private {string}
*/
this.backgroundColor_ = backgroundColor;
/**
* @private {!string}
* @private {string}
*/
this.textColor_ = textColor;
}
/**
* @return {!string}
* @return {string}
*/
getChar() {
return this.character_;
}
/**
* @return {!boolean}
* @return {boolean}
*/
isUnderlined() {
return this.underline_;
}
/**
* @return {!boolean}
* @return {boolean}
*/
isItalicized() {
return this.italics_;
}
/**
* @return {!string}
* @return {string}
*/
getBackgroundColor() {
return this.backgroundColor_;
}
/**
* @return {!string}
* @return {string}
*/
getTextColor() {
return this.textColor_;
@@ -261,12 +261,12 @@ shaka.cea.CeaUtils.StyledChar = class {
/**
* Default background color for text.
* @const {!string}
* @const {string}
*/
shaka.cea.CeaUtils.DEFAULT_BG_COLOR = 'black';
/**
* Default text color.
* @const {!string}
* @const {string}
*/
shaka.cea.CeaUtils.DEFAULT_TXT_COLOR = 'white';
+7 -7
View File
@@ -35,7 +35,7 @@ shaka.cea.DtvccPacketBuilder = class {
/**
* Keeps track of the number of bytes left to add in the current packet.
* @private {!number}
* @private {number}
*/
this.bytesLeftToAddInCurrentPacket_ = 0;
}
@@ -107,7 +107,7 @@ shaka.cea.DtvccPacket = class {
constructor(packetData) {
/**
* Keeps track of the position to read the next byte from in the packet.
* @private {!number}
* @private {number}
*/
this.pos_ = 0;
@@ -119,14 +119,14 @@ shaka.cea.DtvccPacket = class {
}
/**
* @return {!boolean}
* @return {boolean}
*/
hasMoreData() {
return this.pos_ < this.packetData_.length;
}
/**
* @return {!number}
* @return {number}
*/
getPosition() {
return this.pos_;
@@ -149,7 +149,7 @@ shaka.cea.DtvccPacket = class {
/**
* Skips the provided number of blocks in the buffer.
* @param {!number} numBlocks
* @param {number} numBlocks
* @throws {!shaka.util.Error}
*/
skip(numBlocks) {
@@ -164,11 +164,11 @@ shaka.cea.DtvccPacket = class {
};
/**
* @const {!number}
* @const {number}
*/
shaka.cea.DtvccPacketBuilder.DTVCC_PACKET_DATA = 2;
/**
* @const {!number}
* @const {number}
*/
shaka.cea.DtvccPacketBuilder.DTVCC_PACKET_START = 3;
+2 -2
View File
@@ -22,7 +22,7 @@ shaka.cea.ICaptionDecoder = class {
* @param {!Uint8Array} userDataSeiMessage
* 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).
* @param {!number} pts PTS when this packet was received, in seconds.
* @param {number} pts PTS when this packet was received, in seconds.
*/
extract(userDataSeiMessage, pts) {}
@@ -45,7 +45,7 @@ shaka.cea.ICaptionDecoder = class {
* Parsed Cue.
* @typedef {{
* cue: !shaka.text.Cue,
* stream: !string
* stream: string
* }}
*/
shaka.cea.ICaptionDecoder.ClosedCaption;
+2 -2
View File
@@ -39,7 +39,7 @@ shaka.cea.ICeaParser.DEFAULT_TIMESCALE_VALUE = 90000;
/**
* @typedef {{
* packet: !Uint8Array,
* pts: !number
* pts: number
* }}
*
* @description Parsed Caption Packet.
@@ -47,7 +47,7 @@ shaka.cea.ICeaParser.DEFAULT_TIMESCALE_VALUE = 90000;
* Caption packet. More specifically, it contains a "User data
* registered by Recommendation ITU-T T.35 SEI message", from section D.1.6
* and section D.2.6 of Rec. ITU-T H.264 (06/2019).
* @property {!number} pts
* @property {number} pts
* The presentation timestamp (pts) at which the ITU-T T.35 data shows up.
* in seconds.
* @exportDoc
+6 -6
View File
@@ -36,13 +36,13 @@ shaka.cea.Mp4CeaParser = class {
/**
* Default sample duration, as specified by the TREX box.
* @private {!number}
* @private {number}
*/
this.defaultSampleDuration_ = 0;
/**
* Default sample size, as specified by the TREX box.
* @private {!number}
* @private {number}
*/
this.defaultSampleSize_ = 0;
}
@@ -195,10 +195,10 @@ shaka.cea.Mp4CeaParser = class {
/**
* Parse MDAT box.
* @param {!shaka.util.DataViewReader} reader
* @param {!number} time
* @param {!number} timescale
* @param {!number} defaultSampleDuration
* @param {!number} defaultSampleSize
* @param {number} time
* @param {number} timescale
* @param {number} defaultSampleDuration
* @param {number} defaultSampleSize
* @param {!Array<shaka.util.ParsedTRUNSample>} sampleData
* @param {!Array<!shaka.cea.ICeaParser.CaptionPacket>} captionPackets
* @private
+2 -2
View File
@@ -80,7 +80,7 @@ shaka.routing.Walker = class {
* new work is added (and this is not null) it can be resolved. The only
* time when this should be non-null is when we are waiting for more work.
*
* @private {shaka.util.PublicPromise}
* @private {?shaka.util.PublicPromise}
*/
this.waitForWork_ = null;
@@ -90,7 +90,7 @@ shaka.routing.Walker = class {
/** @private {?shaka.routing.Walker.ActiveRoute_} */
this.currentRoute_ = null;
/** @private {shaka.util.AbortableOperation} */
/** @private {?shaka.util.AbortableOperation} */
this.currentStep_ = null;
/**
+4 -4
View File
@@ -57,8 +57,8 @@ shaka.text.SrtTextParser = class {
/**
* Convert a SRT format to WebVTT
*
* @param {!string} data
* @return {!string}
* @param {string} data
* @return {string}
* @export
*/
static srt2webvtt(data) {
@@ -87,8 +87,8 @@ shaka.text.SrtTextParser = class {
/**
* Convert a SRT cue into WebVTT cue
*
* @param {!string} caption
* @return {!string}
* @param {string} caption
* @return {string}
* @private
*/
static convertSrtCue_(caption) {
+1 -1
View File
@@ -24,7 +24,7 @@ goog.requireType('shaka.cea.ICaptionDecoder');
shaka.text.TextEngine = class {
/** @param {shaka.extern.TextDisplayer} displayer */
constructor(displayer) {
/** @private {shaka.extern.TextParser} */
/** @private {?shaka.extern.TextParser} */
this.parser_ = null;
/** @private {shaka.extern.TextDisplayer} */
+2 -2
View File
@@ -462,8 +462,8 @@ shaka.text.VttTextParser = class {
}
/**
* @param {!string} value
* @param {!string} defaultValue
* @param {string} value
* @param {string} defaultValue
* @private
*/
static getOrDefault_(value, defaultValue) {
+20 -20
View File
@@ -14,7 +14,7 @@ shaka.util.Mp4BoxParsers = class {
/**
* Parses a TFHD Box.
* @param {!shaka.util.DataViewReader} reader
* @param {!number} flags
* @param {number} flags
* @return {!shaka.util.ParsedTFHDBox}
*/
static parseTFHD(reader, flags) {
@@ -53,7 +53,7 @@ shaka.util.Mp4BoxParsers = class {
/**
* Parses a TFDT Box.
* @param {!shaka.util.DataViewReader} reader
* @param {!number} version
* @param {number} version
* @return {!shaka.util.ParsedTFDTBox}
*/
static parseTFDT(reader, version) {
@@ -68,7 +68,7 @@ shaka.util.Mp4BoxParsers = class {
/**
* Parses a MDHD Box.
* @param {!shaka.util.DataViewReader} reader
* @param {!number} version
* @param {number} version
* @return {!shaka.util.ParsedMDHDBox}
*/
static parseMDHD(reader, version) {
@@ -107,8 +107,8 @@ shaka.util.Mp4BoxParsers = class {
/**
* Parses a TRUN Box.
* @param {!shaka.util.DataViewReader} reader
* @param {!number} version
* @param {!number} flags
* @param {number} version
* @param {number} flags
* @return {!shaka.util.ParsedTRUNBox}
*/
static parseTRUN(reader, version, flags) {
@@ -168,7 +168,7 @@ shaka.util.Mp4BoxParsers = class {
/**
* Parses a TKHD Box.
* @param {!shaka.util.DataViewReader} reader
* @param {!number} version
* @param {number} version
* @return {!shaka.util.ParsedTKHDBox}
*/
static parseTKHD(reader, version) {
@@ -192,12 +192,12 @@ shaka.util.Mp4BoxParsers = class {
/**
* @typedef {{
* trackId: !number,
* trackId: number,
* defaultSampleDuration: ?number,
* defaultSampleSize: ?number
* }}
*
* @property {!number} trackId
* @property {number} trackId
* As per the spec: an integer that uniquely identifies this
* track over the entire lifetime of this presentation
* @property {?number} defaultSampleDuration
@@ -213,10 +213,10 @@ shaka.util.ParsedTFHDBox;
/**
* @typedef {{
* baseMediaDecodeTime: !number
* baseMediaDecodeTime: number
* }}
*
* @property {!number} baseMediaDecodeTime
* @property {number} baseMediaDecodeTime
* As per the spec: the absolute decode time, measured on the media
* timeline, of the first sample in decode order in the track fragment
*
@@ -226,10 +226,10 @@ shaka.util.ParsedTFDTBox;
/**
* @typedef {{
* timescale: !number
* timescale: number
* }}
*
* @property {!number} timescale
* @property {number} timescale
* As per the spec: an integer that specifies the timescale for this media;
* this is the number of time units that pass in one second
*
@@ -239,13 +239,13 @@ shaka.util.ParsedMDHDBox;
/**
* @typedef {{
* defaultSampleDuration: !number,
* defaultSampleSize: !number
* defaultSampleDuration: number,
* defaultSampleSize: number
* }}
*
* @property {!number} defaultSampleDuration
* @property {number} defaultSampleDuration
* The default sample duration to be used in track fragments
* @property {!number} defaultSampleSize
* @property {number} defaultSampleSize
* The default sample size to be used in track fragments
*
* @exportDoc
@@ -254,11 +254,11 @@ shaka.util.ParsedTREXBox;
/**
* @typedef {{
* sampleCount: !number,
* sampleCount: number,
* sampleData: !Array.<shaka.util.ParsedTRUNSample>
* }}
*
* @property {!number} sampleCount
* @property {number} sampleCount
* As per the spec: the number of samples being added in this run;
* @property {!Array.<shaka.util.ParsedTRUNSample>} sampleData
* An array of size <sampleCount> containing data for each sample
@@ -290,10 +290,10 @@ shaka.util.ParsedTRUNSample;
/**
* @typedef {{
* trackId: !number
* trackId: number
* }}
*
* @property {!number} trackId
* @property {number} trackId
* Unique ID indicative of this track
*
* @exportDoc
+1 -1
View File
@@ -17,7 +17,7 @@ describe('Cea608Memory', () => {
/** @type {!shaka.cea.Cea608Memory} */
let memory;
/** @type {!string} */
/** @type {string} */
const stream = 'CC1';
beforeEach(() => {
+8 -8
View File
@@ -19,39 +19,39 @@ describe('Cea708Service', () => {
/**
* Hide window (2 bytes), with a bitmap provided to indicate all windows.
* @type {!Array<!number>}
* @type {!Array<number>}
*/
const hideWindow = [0x8a, 0xff];
/**
* Define window (7 bytes), defines window #0 to be a visible window
* with 32 rows and 32 columns. (We specify 31 for each since decoder adds 1).
* @type {!Array<!number>}
* @type {!Array<number>}
*/
const defineWindow = [
0x98, 0x38, 0x00, 0x00, 0x1f, 0x1f, 0x00,
];
/** @type {!number} */
/** @type {number} */
const startTime = 1;
/** @type {!number} */
/** @type {number} */
const endTime = 2;
/**
* We arbitrarily pick service 1 for all of these tests.
* @type {!number}
* @type {number}
*/
const serviceNumber = 1;
/** @type {!string} */
/** @type {string} */
const stream = `svc${serviceNumber}`;
/**
* Takes in a array of bytes and a presentation timestamp (in seconds),
* and converts it into a CEA-708 DTVCC Packet.
* @param {!Array<!number>} bytes
* @param {!number} pts
* @param {!Array<number>} bytes
* @param {number} pts
*/
const createCea708PacketFromBytes = (bytes, pts) => {
const cea708Bytes = bytes.map((code, i) => {
+6 -6
View File
@@ -15,22 +15,22 @@ describe('Cea708Window', () => {
/** @type {!shaka.cea.Cea708Window} */
let window;
/** @type {!number} */
/** @type {number} */
const serviceNumber = 1; // We will arbitrarily pick service 1 for all tests.
/** @type {!string} */
/** @type {string} */
const stream = `svc${serviceNumber}`;
/** @type {!number} */
/** @type {number} */
const rowCount = 10;
/** @type {!number} */
/** @type {number} */
const colCount = 32;
/** @type {!number} */
/** @type {number} */
const startTime = 1;
/** @type {!number} */
/** @type {number} */
const endTime = 2;
beforeEach(() => {
+1 -1
View File
@@ -13,7 +13,7 @@ goog.require('shaka.text.Cue');
describe('CeaDecoder', () => {
const CeaUtils = shaka.test.CeaUtils;
/** @type {!string} */
/** @type {string} */
const DEFAULT_BG_COLOR = shaka.cea.CeaUtils.DEFAULT_BG_COLOR;
/**
+2 -2
View File
@@ -11,10 +11,10 @@ describe('DtvccPacketBuilder', () => {
/** @type {!shaka.cea.DtvccPacketBuilder} */
let dtvccPacketBuilder;
/** @type {!number} */
/** @type {number} */
const DTVCC_PACKET_START = shaka.cea.DtvccPacketBuilder.DTVCC_PACKET_START;
/** @type {!number} */
/** @type {number} */
const DTVCC_PACKET_DATA = shaka.cea.DtvccPacketBuilder.DTVCC_PACKET_DATA;
beforeEach(() => {
+1 -1
View File
@@ -36,7 +36,7 @@ describe('DashParser Manifest', () => {
/** @type {!ArrayBuffer} */
let mp4Index;
/** @type {!string} */
/** @type {string} */
const thumbnailScheme = 'http://dashif.org/guidelines/thumbnail_tile';
beforeAll(async () => {
+12 -12
View File
@@ -16,9 +16,9 @@ goog.require('shaka.text.Cue');
shaka.test.CeaUtils = class {
/**
* Returns a cue with no underline/italics, and default colors
* @param {!number} startTime
* @param {!number} endTime
* @param {!string} payload
* @param {number} startTime
* @param {number} endTime
* @param {string} payload
*/
static createDefaultCue(startTime, endTime, payload) {
const cue = new shaka.text.Cue(startTime, endTime, payload);
@@ -29,13 +29,13 @@ shaka.test.CeaUtils = class {
/**
* Returns a cue with custom underline, italics, color, background color.
* @param {!number} startTime
* @param {!number} endTime
* @param {!string} payload
* @param {!boolean} underline
* @param {!boolean} italics
* @param {!string} textColor
* @param {!string} backgroundColor
* @param {number} startTime
* @param {number} endTime
* @param {string} payload
* @param {boolean} underline
* @param {boolean} italics
* @param {string} textColor
* @param {string} backgroundColor
* @return {!shaka.text.Cue}
*/
static createStyledCue(startTime, endTime, payload, underline,
@@ -54,8 +54,8 @@ shaka.test.CeaUtils = class {
/**
* Returns a cue that corresponds to a linebreak.
* @param {!number} startTime
* @param {!number} endTime
* @param {number} startTime
* @param {number} endTime
* @return {!shaka.text.Cue}
*/
static createLineBreakCue(startTime, endTime) {