@yume-chan/scrcpy-decoder-webcodecs 0.0.24 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -1
- package/README.md +49 -29
- package/esm/video/codec/h265.d.ts.map +1 -1
- package/esm/video/codec/h265.js +3 -0
- package/esm/video/codec/h265.js.map +1 -1
- package/esm/video/decoder.d.ts +14 -7
- package/esm/video/decoder.d.ts.map +1 -1
- package/esm/video/decoder.js +166 -67
- package/esm/video/decoder.js.map +1 -1
- package/esm/video/render/bitmap.d.ts +4 -4
- package/esm/video/render/bitmap.d.ts.map +1 -1
- package/esm/video/render/bitmap.js +9 -11
- package/esm/video/render/bitmap.js.map +1 -1
- package/esm/video/render/canvas.d.ts +9 -0
- package/esm/video/render/canvas.d.ts.map +1 -0
- package/esm/video/render/canvas.js +22 -0
- package/esm/video/render/canvas.js.map +1 -0
- package/esm/video/render/index.d.ts +2 -0
- package/esm/video/render/index.d.ts.map +1 -1
- package/esm/video/render/index.js +3 -0
- package/esm/video/render/index.js.map +1 -1
- package/esm/video/render/insertable-stream.d.ts +10 -0
- package/esm/video/render/insertable-stream.d.ts.map +1 -0
- package/esm/video/render/insertable-stream.js +45 -0
- package/esm/video/render/insertable-stream.js.map +1 -0
- package/esm/video/render/type.d.ts +4 -2
- package/esm/video/render/type.d.ts.map +1 -1
- package/esm/video/render/webgl.d.ts +5 -4
- package/esm/video/render/webgl.d.ts.map +1 -1
- package/esm/video/render/webgl.js +26 -14
- package/esm/video/render/webgl.js.map +1 -1
- package/package.json +11 -14
- package/src/video/codec/h265.ts +3 -0
- package/src/video/decoder.ts +197 -69
- package/src/video/render/bitmap.ts +11 -17
- package/src/video/render/canvas.ts +27 -0
- package/src/video/render/index.ts +4 -0
- package/src/video/render/insertable-stream.ts +60 -0
- package/src/video/render/type.ts +6 -2
- package/src/video/render/webgl.ts +47 -19
- package/tsconfig.build.json +4 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/CHANGELOG.json +0 -89
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { VideoFrameRenderer } from "./type.js";
|
|
2
|
+
export declare abstract class CanvasVideoFrameRenderer implements VideoFrameRenderer {
|
|
3
|
+
#private;
|
|
4
|
+
get canvas(): HTMLCanvasElement | OffscreenCanvas;
|
|
5
|
+
constructor(canvas?: HTMLCanvasElement | OffscreenCanvas);
|
|
6
|
+
setSize(width: number, height: number): void;
|
|
7
|
+
abstract draw(frame: VideoFrame): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=canvas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canvas.d.ts","sourceRoot":"","sources":["../../../src/video/render/canvas.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD,8BAAsB,wBAAyB,YAAW,kBAAkB;;IAExE,IAAI,MAAM,wCAET;gBAEW,MAAM,CAAC,EAAE,iBAAiB,GAAG,eAAe;IAQxD,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAO5C,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAClD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createCanvas } from "@yume-chan/scrcpy-decoder-tinyh264";
|
|
2
|
+
export class CanvasVideoFrameRenderer {
|
|
3
|
+
#canvas;
|
|
4
|
+
get canvas() {
|
|
5
|
+
return this.#canvas;
|
|
6
|
+
}
|
|
7
|
+
constructor(canvas) {
|
|
8
|
+
if (canvas) {
|
|
9
|
+
this.#canvas = canvas;
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
this.#canvas = createCanvas();
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
setSize(width, height) {
|
|
16
|
+
if (this.#canvas.width !== width || this.#canvas.height !== height) {
|
|
17
|
+
this.#canvas.width = width;
|
|
18
|
+
this.#canvas.height = height;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=canvas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canvas.js","sourceRoot":"","sources":["../../../src/video/render/canvas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAIlE,MAAM,OAAgB,wBAAwB;IAC1C,OAAO,CAAsC;IAC7C,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,YAAY,MAA4C;QACpD,IAAI,MAAM,EAAE,CAAC;YACT,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAC1B,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,OAAO,GAAG,YAAY,EAAE,CAAC;QAClC,CAAC;IACL,CAAC;IAED,OAAO,CAAC,KAAa,EAAE,MAAc;QACjC,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,KAAK,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;YACjE,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;YAC3B,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;QACjC,CAAC;IACL,CAAC;CAGJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/video/render/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/video/render/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/video/render/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/video/render/index.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAE5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { VideoFrameRenderer } from "./type.js";
|
|
2
|
+
export declare class InsertableStreamVideoFrameRenderer implements VideoFrameRenderer {
|
|
3
|
+
#private;
|
|
4
|
+
static get isSupported(): boolean;
|
|
5
|
+
get element(): HTMLVideoElement;
|
|
6
|
+
constructor(element?: HTMLVideoElement);
|
|
7
|
+
setSize(width: number, height: number): void;
|
|
8
|
+
draw(frame: VideoFrame): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=insertable-stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insertable-stream.d.ts","sourceRoot":"","sources":["../../../src/video/render/insertable-stream.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAQpD,qBAAa,kCAAmC,YAAW,kBAAkB;;IACzE,MAAM,KAAK,WAAW,YAErB;IAGD,IAAI,OAAO,qBAEV;gBAMW,OAAO,CAAC,EAAE,gBAAgB;IAyBtC,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAOtC,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/C"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// cspell: ignore insertable
|
|
2
|
+
export class InsertableStreamVideoFrameRenderer {
|
|
3
|
+
static get isSupported() {
|
|
4
|
+
return typeof MediaStreamTrackGenerator !== "undefined";
|
|
5
|
+
}
|
|
6
|
+
#element;
|
|
7
|
+
get element() {
|
|
8
|
+
return this.#element;
|
|
9
|
+
}
|
|
10
|
+
#generator;
|
|
11
|
+
#writer;
|
|
12
|
+
#stream;
|
|
13
|
+
constructor(element) {
|
|
14
|
+
if (element) {
|
|
15
|
+
this.#element = element;
|
|
16
|
+
}
|
|
17
|
+
else if (typeof document !== "undefined") {
|
|
18
|
+
this.#element = document.createElement("video");
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
throw new Error("no video element input found nor any video element can be created");
|
|
22
|
+
}
|
|
23
|
+
this.#element.muted = true;
|
|
24
|
+
this.#element.autoplay = true;
|
|
25
|
+
this.#element.disablePictureInPicture = true;
|
|
26
|
+
this.#element.disableRemotePlayback = true;
|
|
27
|
+
// The spec replaced `MediaStreamTrackGenerator` with `VideoTrackGenerator`.
|
|
28
|
+
// But Chrome has not implemented it yet.
|
|
29
|
+
// https://issues.chromium.org/issues/40058895
|
|
30
|
+
this.#generator = new MediaStreamTrackGenerator({ kind: "video" });
|
|
31
|
+
this.#writer = this.#generator.writable.getWriter();
|
|
32
|
+
this.#stream = new MediaStream([this.#generator]);
|
|
33
|
+
this.#element.srcObject = this.#stream;
|
|
34
|
+
}
|
|
35
|
+
setSize(width, height) {
|
|
36
|
+
if (this.#element.width !== width || this.#element.height !== height) {
|
|
37
|
+
this.#element.width = width;
|
|
38
|
+
this.#element.height = height;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
async draw(frame) {
|
|
42
|
+
await this.#writer.write(frame);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=insertable-stream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insertable-stream.js","sourceRoot":"","sources":["../../../src/video/render/insertable-stream.ts"],"names":[],"mappings":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AAE,MAAc;QACjC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,KAAK,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;YACnE,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;YAC5B,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC;QAClC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,KAAiB;QACxB,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;CACJ"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { MaybePromiseLike } from "@yume-chan/async";
|
|
2
|
+
export interface VideoFrameRenderer {
|
|
3
|
+
setSize(width: number, height: number): void;
|
|
4
|
+
draw(frame: VideoFrame): MaybePromiseLike<void>;
|
|
3
5
|
}
|
|
4
6
|
//# sourceMappingURL=type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/video/render/type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/video/render/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,WAAW,kBAAkB;IAC/B,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7C,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;CACnD"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare class
|
|
1
|
+
import { CanvasVideoFrameRenderer } from "./canvas.js";
|
|
2
|
+
export declare class WebGLVideoFrameRenderer extends CanvasVideoFrameRenderer {
|
|
3
3
|
#private;
|
|
4
4
|
static vertexShaderSource: string;
|
|
5
5
|
static fragmentShaderSource: string;
|
|
6
|
+
static get isSupported(): boolean;
|
|
6
7
|
/**
|
|
7
8
|
* Create a new WebGL frame renderer.
|
|
8
9
|
* @param canvas The canvas to render frames to.
|
|
@@ -10,7 +11,7 @@ export declare class WebGLFrameRenderer implements FrameRenderer {
|
|
|
10
11
|
* Whether to allow capturing the canvas content using APIs like `readPixels` and `toDataURL`.
|
|
11
12
|
* Enable this option may reduce performance.
|
|
12
13
|
*/
|
|
13
|
-
constructor(canvas
|
|
14
|
-
draw(frame: VideoFrame): void
|
|
14
|
+
constructor(canvas?: HTMLCanvasElement | OffscreenCanvas, enableCapture?: boolean);
|
|
15
|
+
draw(frame: VideoFrame): Promise<void>;
|
|
15
16
|
}
|
|
16
17
|
//# sourceMappingURL=webgl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl.d.ts","sourceRoot":"","sources":["../../../src/video/render/webgl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webgl.d.ts","sourceRoot":"","sources":["../../../src/video/render/webgl.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAwBvD,qBAAa,uBAAwB,SAAQ,wBAAwB;;IACjE,MAAM,CAAC,kBAAkB,SAW3B;IAEE,MAAM,CAAC,oBAAoB,SAQ7B;IAEE,MAAM,KAAK,WAAW,YAGrB;IAID;;;;;;OAMG;gBAEC,MAAM,CAAC,EAAE,iBAAiB,GAAG,eAAe,EAC5C,aAAa,CAAC,EAAE,OAAO;IA6D3B,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAgBzC"}
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
import { createCanvas } from "@yume-chan/scrcpy-decoder-tinyh264";
|
|
2
|
+
import { CanvasVideoFrameRenderer } from "./canvas.js";
|
|
3
|
+
const Resolved = Promise.resolve();
|
|
4
|
+
function createContext(canvas, enableCapture) {
|
|
5
|
+
const attributes = {
|
|
6
|
+
// Low-power GPU should be enough for video rendering.
|
|
7
|
+
powerPreference: "low-power",
|
|
8
|
+
alpha: false,
|
|
9
|
+
// Disallow software rendering.
|
|
10
|
+
// Other rendering methods are faster than software-based WebGL.
|
|
11
|
+
failIfMajorPerformanceCaveat: true,
|
|
12
|
+
preserveDrawingBuffer: !!enableCapture,
|
|
13
|
+
};
|
|
14
|
+
return (canvas.getContext("webgl2", attributes) ||
|
|
15
|
+
canvas.getContext("webgl", attributes));
|
|
16
|
+
}
|
|
17
|
+
export class WebGLVideoFrameRenderer extends CanvasVideoFrameRenderer {
|
|
2
18
|
static vertexShaderSource = `
|
|
3
19
|
attribute vec2 xy;
|
|
4
20
|
|
|
@@ -20,6 +36,10 @@ export class WebGLFrameRenderer {
|
|
|
20
36
|
gl_FragColor = texture2D(texture, uv);
|
|
21
37
|
}
|
|
22
38
|
`;
|
|
39
|
+
static get isSupported() {
|
|
40
|
+
const canvas = createCanvas();
|
|
41
|
+
return !!createContext(canvas);
|
|
42
|
+
}
|
|
23
43
|
#context;
|
|
24
44
|
/**
|
|
25
45
|
* Create a new WebGL frame renderer.
|
|
@@ -29,28 +49,20 @@ export class WebGLFrameRenderer {
|
|
|
29
49
|
* Enable this option may reduce performance.
|
|
30
50
|
*/
|
|
31
51
|
constructor(canvas, enableCapture) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
failIfMajorPerformanceCaveat: true,
|
|
35
|
-
preserveDrawingBuffer: enableCapture,
|
|
36
|
-
}) ||
|
|
37
|
-
canvas.getContext("webgl", {
|
|
38
|
-
alpha: false,
|
|
39
|
-
failIfMajorPerformanceCaveat: true,
|
|
40
|
-
preserveDrawingBuffer: enableCapture,
|
|
41
|
-
});
|
|
52
|
+
super(canvas);
|
|
53
|
+
const gl = createContext(this.canvas, enableCapture);
|
|
42
54
|
if (!gl) {
|
|
43
55
|
throw new Error("WebGL not supported");
|
|
44
56
|
}
|
|
45
57
|
this.#context = gl;
|
|
46
58
|
const vertexShader = gl.createShader(gl.VERTEX_SHADER);
|
|
47
|
-
gl.shaderSource(vertexShader,
|
|
59
|
+
gl.shaderSource(vertexShader, WebGLVideoFrameRenderer.vertexShaderSource);
|
|
48
60
|
gl.compileShader(vertexShader);
|
|
49
61
|
if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {
|
|
50
62
|
throw new Error(gl.getShaderInfoLog(vertexShader));
|
|
51
63
|
}
|
|
52
64
|
const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
|
|
53
|
-
gl.shaderSource(fragmentShader,
|
|
65
|
+
gl.shaderSource(fragmentShader, WebGLVideoFrameRenderer.fragmentShaderSource);
|
|
54
66
|
gl.compileShader(fragmentShader);
|
|
55
67
|
if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {
|
|
56
68
|
throw new Error(gl.getShaderInfoLog(fragmentShader));
|
|
@@ -81,9 +93,9 @@ export class WebGLFrameRenderer {
|
|
|
81
93
|
draw(frame) {
|
|
82
94
|
const gl = this.#context;
|
|
83
95
|
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, frame);
|
|
84
|
-
frame.close();
|
|
85
96
|
gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
|
|
86
97
|
gl.drawArrays(gl.TRIANGLE_FAN, 0, 4);
|
|
98
|
+
return Resolved;
|
|
87
99
|
}
|
|
88
100
|
}
|
|
89
101
|
//# sourceMappingURL=webgl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl.js","sourceRoot":"","sources":["../../../src/video/render/webgl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webgl.js","sourceRoot":"","sources":["../../../src/video/render/webgl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,E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C;QACzB,EAAE,CAAC,UAAU,CACT,EAAE,CAAC,UAAU,EACb,CAAC,EACD,EAAE,CAAC,IAAI,EACP,EAAE,CAAC,IAAI,EACP,EAAE,CAAC,aAAa,EAChB,KAAK,CACR,CAAC;QAEF,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,kBAAkB,EAAE,EAAE,CAAC,mBAAmB,CAAC,CAAC;QACjE,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,YAAY,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAErC,OAAO,QAAQ,CAAC;IACpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yume-chan/scrcpy-decoder-webcodecs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Raw H.264 stream decoder and renderer using WebCodecs API (requires modern browser).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adb",
|
|
@@ -26,26 +26,23 @@
|
|
|
26
26
|
"type": "module",
|
|
27
27
|
"main": "esm/index.js",
|
|
28
28
|
"types": "esm/index.d.ts",
|
|
29
|
+
"sideEffects": false,
|
|
29
30
|
"dependencies": {
|
|
30
|
-
"@yume-chan/
|
|
31
|
-
"@yume-chan/
|
|
32
|
-
"@yume-chan/
|
|
33
|
-
"@yume-chan/scrcpy
|
|
34
|
-
"@yume-chan/stream-extra": "^0.0
|
|
31
|
+
"@yume-chan/async": "^4.0.2",
|
|
32
|
+
"@yume-chan/event": "^1.0.0",
|
|
33
|
+
"@yume-chan/no-data-view": "^1.0.0",
|
|
34
|
+
"@yume-chan/scrcpy": "^1.1.0",
|
|
35
|
+
"@yume-chan/stream-extra": "^1.0.0",
|
|
36
|
+
"@yume-chan/scrcpy-decoder-tinyh264": "^1.1.0"
|
|
35
37
|
},
|
|
36
38
|
"devDependencies": {
|
|
37
|
-
"
|
|
39
|
+
"prettier": "^3.4.2",
|
|
40
|
+
"typescript": "^5.7.2",
|
|
38
41
|
"@yume-chan/eslint-config": "^1.0.0",
|
|
39
|
-
"@yume-chan/tsconfig": "^1.0.0"
|
|
40
|
-
"cross-env": "^7.0.3",
|
|
41
|
-
"jest": "^30.0.0-alpha.4",
|
|
42
|
-
"prettier": "^3.3.2",
|
|
43
|
-
"ts-jest": "^29.1.4",
|
|
44
|
-
"typescript": "^5.4.5"
|
|
42
|
+
"@yume-chan/tsconfig": "^1.0.0"
|
|
45
43
|
},
|
|
46
44
|
"scripts": {
|
|
47
45
|
"build": "tsc -b tsconfig.build.json",
|
|
48
|
-
"build:watch": "tsc -b tsconfig.build.json",
|
|
49
46
|
"lint": "run-eslint && prettier src/**/*.ts --write --tab-width 4"
|
|
50
47
|
}
|
|
51
48
|
}
|
package/src/video/codec/h265.ts
CHANGED