Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: CEA608/708 parser #75

Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
e9682d0
Added CEA-608/708 methods
hernanr99 Feb 13, 2024
34b989e
Fix function reset on Cea608Channel, check function reset exist on ou…
hernanr99 Feb 15, 2024
05f74a4
Added penState tests
hernanr99 Feb 21, 2024
516da30
Added some row tests
hernanr99 Feb 21, 2024
2f64eff
Added captionScreen, cea608Channel and cea608Parser tests
hernanr99 Feb 23, 2024
18e97c0
Refactor: all classes were extracted into individual files.
hernanr99 Feb 23, 2024
2d45327
Remove unneccessary comments
hernanr99 Feb 26, 2024
298ba8c
Request changes, fix tsdoc
hernanr99 Feb 26, 2024
4b0a9ea
Remove unnecessary comments
hernanr99 Feb 27, 2024
a5c9def
Modify changelog
hernanr99 Feb 27, 2024
53a6b21
Add types
hernanr99 Feb 28, 2024
7b87581
Request changes
hernanr99 Feb 29, 2024
9cf6931
Merge branch 'main' of github.com:qualabs/common-media-library into f…
hernanr99 Mar 1, 2024
bec5c2a
Merge branch 'main' into feature/cea-608-708
hernanr99 Mar 6, 2024
ec02874
chore: move files to cta/608
littlespex Mar 7, 2024
22c5c00
no message
littlespex Apr 5, 2024
9a3dd4a
Merge pull request #46 from qualabs/feature/cta-608
littlespex Apr 5, 2024
c73c029
chore: update github actions to remove ENV warnings
littlespex Feb 15, 2024
4ef77f4
test: add more ID3 tests
felipeYoungi Feb 22, 2024
a9bc167
Added CEA-608/708 methods
hernanr99 Feb 13, 2024
a9d0869
Fix function reset on Cea608Channel, check function reset exist on ou…
hernanr99 Feb 15, 2024
0bdcca8
Added penState tests
hernanr99 Feb 21, 2024
9da2dfd
Added some row tests
hernanr99 Feb 21, 2024
394beec
Added captionScreen, cea608Channel and cea608Parser tests
hernanr99 Feb 23, 2024
ff33b21
Refactor: all classes were extracted into individual files.
hernanr99 Feb 23, 2024
cebb098
Remove unneccessary comments
hernanr99 Feb 26, 2024
2932956
Request changes, fix tsdoc
hernanr99 Feb 26, 2024
c870fd6
Remove unnecessary comments
hernanr99 Feb 27, 2024
a3f4f3c
Modify changelog
hernanr99 Feb 27, 2024
2d5d384
Add types
hernanr99 Feb 28, 2024
5ed701d
Request changes
hernanr99 Feb 29, 2024
e0e21f3
release/0.6.3 (#80)
littlespex Feb 29, 2024
4eaccec
chore: update version to 0.6.4
littlespex Mar 4, 2024
222d5b6
fix: Declare isArrayBufferView as native Node.js function to resolve …
hernanr99 Mar 4, 2024
1153c85
chore: move files to cta/608
littlespex Mar 7, 2024
de1544a
no message
littlespex Apr 5, 2024
7e5476e
Merge branch 'feature/cea-608-708' of https://github.com/qualabs/comm…
littlespex Apr 5, 2024
e823a60
chore: update code owners
littlespex Oct 12, 2023
ff73974
fix: remove first line of auto generated release notes
littlespex Oct 13, 2023
a03085a
release/0.5.0 (#41)
littlespex Nov 14, 2023
3cdbbc8
chore: add missing cjs dependency
littlespex Nov 14, 2023
27ea051
release/0.5.1 (#43)
littlespex Nov 16, 2023
ed618c5
chore: add dev server for in browser development
littlespex Nov 29, 2023
e1c2849
chore: remove unused build script
littlespex Nov 29, 2023
4cd26b2
feat: add ability to supply base url encoding option
littlespex Nov 29, 2023
08f14d0
chore: lint
littlespex Nov 29, 2023
98de1cb
chore: remove dev file
littlespex Nov 29, 2023
0c43dc7
fix: ignore non-finite numeric values (#46)
littlespex Nov 29, 2023
af921b9
feat: export const for CMCD and CMSD version numbers (#51)
littlespex Nov 30, 2023
4ee9361
chore: update API file
littlespex Nov 30, 2023
ec64580
fix: replace CMCD query param when appending new data (#52)
littlespex Nov 30, 2023
9f50027
chore: update version to 0.6.0
littlespex Nov 30, 2023
5d1073d
release 0.6.1 (#57)
littlespex Dec 14, 2023
cc99ac8
chore: update version to 0.6.2
littlespex Jan 18, 2024
4ed60b3
fix: clean up imports (#65)
littlespex Jan 18, 2024
18ae8ee
chore: lint
littlespex Jan 18, 2024
7c79a76
fix: readme code example
littlespex Jan 30, 2024
fc91636
doc: add missing group tag
littlespex Feb 8, 2024
09b5b03
chore: doc cleanup (#70)
littlespex Feb 15, 2024
7598ac1
chore: update github actions to remove ENV warnings
littlespex Feb 15, 2024
b3f5e87
test: add more ID3 tests
felipeYoungi Feb 22, 2024
15b3c55
Added CEA-608/708 methods
hernanr99 Feb 13, 2024
634b53b
Fix function reset on Cea608Channel, check function reset exist on ou…
hernanr99 Feb 15, 2024
bb87499
Added penState tests
hernanr99 Feb 21, 2024
c4113b4
Added some row tests
hernanr99 Feb 21, 2024
b8ee27a
Added captionScreen, cea608Channel and cea608Parser tests
hernanr99 Feb 23, 2024
bc7fc77
Refactor: all classes were extracted into individual files.
hernanr99 Feb 23, 2024
1e56622
Remove unneccessary comments
hernanr99 Feb 26, 2024
0dcffad
Request changes, fix tsdoc
hernanr99 Feb 26, 2024
a7a0186
Remove unnecessary comments
hernanr99 Feb 27, 2024
bd533d8
Modify changelog
hernanr99 Feb 27, 2024
f603ed2
Add types
hernanr99 Feb 28, 2024
8ad2744
Request changes
hernanr99 Feb 29, 2024
6e8971c
release/0.6.3 (#80)
littlespex Feb 29, 2024
bdb63fa
chore: update version to 0.6.4
littlespex Mar 4, 2024
cc41b7d
fix: Declare isArrayBufferView as native Node.js function to resolve …
hernanr99 Mar 4, 2024
fbe8f8f
chore: move files to cta/608
littlespex Mar 7, 2024
e717194
no message
littlespex Apr 5, 2024
42705ef
Added CEA-608/708 methods
hernanr99 Feb 13, 2024
f41c2e9
Fix function reset on Cea608Channel, check function reset exist on ou…
hernanr99 Feb 15, 2024
e56df8f
Added penState tests
hernanr99 Feb 21, 2024
63a33ff
Added some row tests
hernanr99 Feb 21, 2024
9ec1114
Added captionScreen, cea608Channel and cea608Parser tests
hernanr99 Feb 23, 2024
adbd3bb
Refactor: all classes were extracted into individual files.
hernanr99 Feb 23, 2024
db5e0da
Remove unneccessary comments
hernanr99 Feb 26, 2024
daf4c3e
Request changes, fix tsdoc
hernanr99 Feb 26, 2024
231d530
Remove unnecessary comments
hernanr99 Feb 27, 2024
010a009
Add types
hernanr99 Feb 28, 2024
c0da067
Request changes
hernanr99 Feb 29, 2024
a5653fd
release/0.6.3 (#80)
littlespex Feb 29, 2024
d673bcc
chore: update version to 0.6.4
littlespex Mar 4, 2024
d316152
fix: Declare isArrayBufferView as native Node.js function to resolve …
hernanr99 Mar 4, 2024
547af6d
chore: move files to cta/608
littlespex Mar 7, 2024
953b8e4
no message
littlespex Apr 5, 2024
2752a19
Merge branch 'feature/cea-608-708' of https://github.com/qualabs/comm…
littlespex Apr 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"node": true
},
"rules": {
"@typescript-eslint/no-duplicate-enum-values": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-explicit-any": "off",
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
- Unit tests for id3 feature helper functions [#74](https://github.com/streaming-video-technology-alliance/common-media-library/pull/74)
- CEA608/708 parser [#75](https://github.com/streaming-video-technology-alliance/common-media-library/pull/75)


## [0.6.2] - 2023-01-18
Expand Down
251 changes: 251 additions & 0 deletions lib/config/common-media-library.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,177 @@ export function base64encode(binary: Uint8Array): string;
// @beta
export function canParseId3(data: Uint8Array, offset: number): boolean;

// @public
export class CaptionScreen {
constructor(logger: CaptionsLogger);
// (undocumented)
backSpace(): void;
// (undocumented)
clearToEndOfRow(): void;
// (undocumented)
copy(other: CaptionScreen): void;
// (undocumented)
currRow: number;
// (undocumented)
equals(other: CaptionScreen): boolean;
getDisplayText(asOneRow?: boolean): string;
// (undocumented)
getTextAndFormat(): Row[];
insertChar(char: number): void;
// (undocumented)
isEmpty(): boolean;
// (undocumented)
lastOutputScreen: CaptionScreen | null;
// (undocumented)
logger: CaptionsLogger;
// (undocumented)
moveCursor(relPos: number): void;
// (undocumented)
nrRollUpRows: number | null;
// (undocumented)
reset(): void;
// (undocumented)
rollUp(): void;
// (undocumented)
rows: Row[];
setBkgData(bkgData: Partial<PenStyles>): void;
// (undocumented)
setCursor(absPos: number): void;
// Warning: (ae-forgotten-export) The symbol "PACData" needs to be exported by the entry point index.d.ts
//
// (undocumented)
setPAC(pacData: PACData): void;
// Warning: (ae-forgotten-export) The symbol "PenStyles" needs to be exported by the entry point index.d.ts
//
// (undocumented)
setPen(styles: Partial<PenStyles>): void;
// (undocumented)
setRollUpRows(nrRows: number | null): void;
}

// @public
export class CaptionsLogger {
// (undocumented)
log(severity: VerboseLevel, msg: string | (() => string)): void;
// (undocumented)
time: number | null;
// Warning: (ae-forgotten-export) The symbol "VerboseLevel" needs to be exported by the entry point index.d.ts
//
// (undocumented)
verboseLevel: VerboseLevel;
}

// @public
export class Cea608Channel {
constructor(channelNumber: number, outputFilter: any,
logger: CaptionsLogger);
// (undocumented)
ccAOF(): void;
// (undocumented)
ccAON(): void;
// (undocumented)
ccBS(): void;
// (undocumented)
ccCR(): void;
// (undocumented)
ccDER(): void;
// (undocumented)
ccEDM(): void;
// (undocumented)
ccENM(): void;
// (undocumented)
ccEOC(): void;
// (undocumented)
ccFON(): void;
// (undocumented)
ccMIDROW(secondByte: number): void;
// (undocumented)
ccRCL(): void;
// (undocumented)
ccRDC(): void;
// (undocumented)
ccRTD(): void;
// (undocumented)
ccRU(nrRows: number | null): void;
// (undocumented)
ccTO(nrCols: number): void;
// (undocumented)
ccTR(): void;
// (undocumented)
chNr: number;
// (undocumented)
cueSplitAtTime(t: number): void;
// (undocumented)
cueStartTime: number | null;
// (undocumented)
currRollUpRow: Row;
// (undocumented)
displayedMemory: CaptionScreen;
// (undocumented)
getHandler(): any;
// (undocumented)
insertChars(chars: number[]): void;
// (undocumented)
lastOutputScreen: CaptionScreen;
// (undocumented)
logger: CaptionsLogger;
// Warning: (ae-forgotten-export) The symbol "CaptionModes" needs to be exported by the entry point index.d.ts
//
// (undocumented)
mode: CaptionModes;
// (undocumented)
nonDisplayedMemory: CaptionScreen;
// (undocumented)
outputDataUpdate(dispatch?: boolean): void;
// (undocumented)
outputFilter: any;
// (undocumented)
reset(): void;
// (undocumented)
setBkgData(bkgData: Partial<PenStyles>): void;
// (undocumented)
setHandler(newHandler: any): void;
// (undocumented)
setMode(newMode: CaptionModes): void;
// (undocumented)
setPAC(pacData: PACData): void;
// (undocumented)
verbose: number;
// (undocumented)
writeScreen: CaptionScreen;
}

// @public
export class Cea608Parser {
// Warning: (ae-forgotten-export) The symbol "SupportedField" needs to be exported by the entry point index.d.ts
constructor(field: SupportedField, out1: any, out2: any);
addData(time: number | null, byteList: number[]): void;
// (undocumented)
channels: Array<Cea608Channel | null>;
// Warning: (ae-forgotten-export) The symbol "CmdHistory" needs to be exported by the entry point index.d.ts
//
// (undocumented)
cmdHistory: CmdHistory;
cueSplitAtTime(t: number): void;
// Warning: (ae-forgotten-export) The symbol "Channels" needs to be exported by the entry point index.d.ts
//
// (undocumented)
currentChannel: Channels;
// (undocumented)
getHandler(channel: number): any;
interpretPAC(row: number, byte: number): PACData;
// (undocumented)
logger: CaptionsLogger;
parseBackgroundAttributes(a: number, b: number): boolean;
parseChars(a: number, b: number): number[] | null;
parseCmd(a: number, b: number): boolean;
parseMidrow(a: number, b: number): boolean;
parsePAC(a: number, b: number): boolean;
reset(): void;
// (undocumented)
setHandler(channel: number, newHandler: any): void;
}

// @beta
export interface Cmcd {
[index: CmcdCustomKey]: CmcdValue;
Expand Down Expand Up @@ -287,6 +458,32 @@ export type Id3Frame = DecodedId3Frame<ArrayBuffer | string | number>;
// @internal
export function isId3TimestampFrame(frame: Id3Frame): boolean;

// @public
export class PenState {
// (undocumented)
background: string;
// (undocumented)
copy(newPenState: PenState): void;
// (undocumented)
equals(other: PenState): boolean;
// (undocumented)
flash: boolean;
// (undocumented)
foreground: string;
// (undocumented)
isDefault(): boolean;
// (undocumented)
italics: boolean;
// (undocumented)
reset(): void;
// (undocumented)
setStyles(styles: Partial<PenStyles>): void;
// (undocumented)
toString(): string;
// (undocumented)
underline: boolean;
}

// @beta
export type RequestInterceptor = (request: CommonMediaRequest) => Promise<CommonMediaRequest>;

Expand All @@ -310,6 +507,40 @@ export type ResponseInterceptor = (response: CommonMediaResponse) => Promise<Com
// @beta
export function roundToEven(value: number, precision: number): number;

// @public
export class Row {
constructor(logger: CaptionsLogger);
backSpace(): void;
// (undocumented)
chars: StyledUnicodeChar[];
// (undocumented)
clear(): void;
// (undocumented)
clearFromPos(startPos: number): void;
// (undocumented)
clearToEndOfRow(): void;
// (undocumented)
copy(other: Row): void;
// (undocumented)
cueStartTime: number | null;
// (undocumented)
currPenState: PenState;
// (undocumented)
equals(other: Row): boolean;
// (undocumented)
getTextString(): string;
// (undocumented)
insertChar(byte: number): void;
// (undocumented)
isEmpty(): boolean;
moveCursor(relPos: number): void;
// (undocumented)
pos: number;
setCursor(absPos: number): void;
// (undocumented)
setPenStyles(styles: Partial<PenStyles>): void;
}

// @beta
export type SfBareItem = string | Uint8Array | boolean | number | symbol | Date | SfToken;

Expand Down Expand Up @@ -354,6 +585,26 @@ export class SfToken {
description: string;
}

// @public
export class StyledUnicodeChar {
// (undocumented)
copy(newChar: StyledUnicodeChar): void;
// (undocumented)
equals(other: StyledUnicodeChar): boolean;
// (undocumented)
isEmpty(): boolean;
// (undocumented)
penState: PenState;
// (undocumented)
reset(): void;
// (undocumented)
setChar(uchar: string, newPenState: PenState): void;
// (undocumented)
setPenState(newPenState: PenState): void;
// (undocumented)
uchar: string;
}

// @beta
export function toCmcdHeaders(cmcd: Cmcd, options?: CmcdEncodeOptions): {};

Expand Down
Loading