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

build esm/cjs; fix jest #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 23 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = tab
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
max_line_length = 0
trim_trailing_whitespace = false

[*.js]
indent_style = space

[{*.json,*.yml}]
indent_style = space
indent_size = 2
11 changes: 8 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
node_modules
/dist/
/coverage/
node_modules/
dist/
coverage/

.vscode/
.idea/

.DS_Store
2 changes: 1 addition & 1 deletion lib/JitterBuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class InnerJitterBuffer<T> {
queue: [number, T][]

// TODO: replace with an actual jitterbuffer...
constructor(firstPts: number, firstData: T, queueSize: number) {
constructor(firstPts: number, firstData: T, _queueSize: number) {
this.lastPts = firstPts
this.queue = [ [firstPts, firstData] ]
}
Expand Down
2 changes: 1 addition & 1 deletion lib/NalUnits.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import BitReader from "./BitReader.js"
import type BitReader from "./BitReader.js"

// NAL
// ---
Expand Down
6 changes: 3 additions & 3 deletions lib/PPS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface PPS {
slice_group_change_rate_minus1?: number,
// for type === 6
slice_group_id?: number[],
},
} | undefined,

num_ref_idx_l0_default_active_minus1: number,
num_ref_idx_l1_default_active_minus1: number,
Expand All @@ -46,9 +46,9 @@ export interface PPS {

optionalTrailing?: {
transform_8x8_mode_flag: boolean,
pic_scaling_matrix?: ScalingMatrix,
pic_scaling_matrix?: ScalingMatrix | undefined,
second_chroma_qp_index_offset: number,
},
} | undefined,
}

export interface PPSParseOptions {
Expand Down
4 changes: 2 additions & 2 deletions lib/SPS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ export interface SPS {

// for certain profiles
chroma_format_idc?: number,
separate_colour_plane_flag?: boolean,
separate_colour_plane_flag?: boolean | undefined,
bit_depth_luma_minus8?: number,
bit_depth_chroma_minus8?: number,
qpprime_y_zero_transform_bypass_flag?: boolean,
seq_scaling_matrix?: ScalingMatrix,
seq_scaling_matrix?: ScalingMatrix | undefined,

log2_max_frame_num_minus4: number,
pic_order_cnt_type: number,
Expand Down
10 changes: 6 additions & 4 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// parsing

export { RawNALU, NALUType, NALU_TYPE_UNSPEC_START, sliceNALUs, parseNALU, decodeRBSP } from "./NalUnits.js"
export { parseSPS, SPS, VUIParameters, HRDParameters } from "./SPS.js"
export { parsePPS, PPS } from "./PPS.js"
export { NALUType, NALU_TYPE_UNSPEC_START, sliceNALUs, parseNALU, decodeRBSP } from "./NalUnits.js"
export type { RawNALU } from "./NalUnits.js"
export { parseSPS } from "./SPS.js"
export type { SPS, VUIParameters, HRDParameters } from "./SPS.js"
export { parsePPS } from "./PPS.js"
export type { PPS } from "./PPS.js"
export * from "./sei/index.js"

import SetManager from "./SetManager.js"
Expand Down
2 changes: 1 addition & 1 deletion lib/sei/Message.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import BitReader from "../BitReader.js"
import type BitReader from "../BitReader.js"

/** Raw SEI message, as a [type, payload] tuple. See [[seiMessageTypes]]. */
export type RawSEIMessage = [ number, Uint8Array ]
Expand Down
2 changes: 1 addition & 1 deletion lib/sei/PictureTiming.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BitReader from "../BitReader.js"
import { SPS } from "../SPS.js"
import type { SPS } from "../SPS.js"
import { validateSEITrailing } from "./Message.js"

// PICTURE TIMING SEI
Expand Down
3 changes: 2 additions & 1 deletion lib/sei/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export { RawSEIMessage, parseSEI } from "./Message.js"
export { parseSEI } from "./Message.js"
export type { RawSEIMessage } from "./Message.js"

export * from "./MessageType.js"

Expand Down
156 changes: 135 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading