@yume-chan/scrcpy 0.0.15 → 0.0.16

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.json CHANGED
@@ -1,6 +1,24 @@
1
1
  {
2
2
  "name": "@yume-chan/scrcpy",
3
3
  "entries": [
4
+ {
5
+ "version": "0.0.16",
6
+ "tag": "@yume-chan/scrcpy_v0.0.16",
7
+ "date": "Sat, 28 May 2022 03:56:37 GMT",
8
+ "comments": {
9
+ "none": [
10
+ {
11
+ "comment": "Upgrade TypeScript to 4.7.2 to enable Node.js ESM"
12
+ },
13
+ {
14
+ "comment": "Add support for more `CodecOptions` keys"
15
+ },
16
+ {
17
+ "comment": "Add support for `CodecOptions` value types other than `int`"
18
+ }
19
+ ]
20
+ }
21
+ },
4
22
  {
5
23
  "version": "0.0.15",
6
24
  "tag": "@yume-chan/scrcpy_v0.0.15",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
1
  # Change Log - @yume-chan/scrcpy
2
2
 
3
- This log was last generated on Mon, 02 May 2022 04:18:01 GMT and should not be manually modified.
3
+ This log was last generated on Sat, 28 May 2022 03:56:37 GMT and should not be manually modified.
4
+
5
+ ## 0.0.16
6
+ Sat, 28 May 2022 03:56:37 GMT
7
+
8
+ ### Updates
9
+
10
+ - Upgrade TypeScript to 4.7.2 to enable Node.js ESM
11
+ - Add support for more `CodecOptions` keys
12
+ - Add support for `CodecOptions` value types other than `int`
4
13
 
5
14
  ## 0.0.15
6
15
  Mon, 02 May 2022 04:18:01 GMT
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2020-2022 Simon Chan
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2020-2022 Simon Chan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,89 +1,90 @@
1
- # @yume-chan/scrcpy
2
-
3
- TypeScript implementation of [Scrcpy](https://github.com/Genymobile/scrcpy) client.
4
-
5
- It uses the official Scrcpy server releases.
6
-
7
- **WARNING:** The public API is UNSTABLE. If you have any questions, please open an issue.
8
-
9
- ## Download Server Binary
10
-
11
- This package has a script `fetch-scrcpy-server` to help you download the official server binary.
12
-
13
- The server binary is subject to [Apache License 2.0](https://github.com/Genymobile/scrcpy/blob/master/LICENSE).
14
-
15
- Usage:
16
-
17
- ```
18
- $ npx fetch-scrcpy-server <version>
19
- ```
20
-
21
- For example:
22
-
23
- ```
24
- $ npx fetch-scrcpy-server 1.21
25
- ```
26
-
27
- You can also add it to the `postinstall` script of your `package.json` so it will run automatically when you do `npm install`:
28
-
29
- ```json
30
- "scripts": {
31
- "postinstall": "fetch-scrcpy-server 1.21",
32
- },
33
- ```
34
-
35
- It will download the binary to `bin/scrcpy` and write the version string to `bin/version.js`. You can import the version string with
36
-
37
- ```js
38
- import SCRCPY_SERVER_VERSION from '@yume-chan/scrcpy/bin/version';
39
- ```
40
-
41
- And import the server binary with [file-loader](https://v4.webpack.js.org/loaders/file-loader/) (Webpack 4) or [Asset Modules](https://webpack.js.org/guides/asset-modules/) (Webpack 5).
42
-
43
- ## Option versions
44
-
45
- Scrcpy server has no backward compatibility on options input format. Currently the following versions are supported:
46
-
47
- | versions | type |
48
- | --------- | ------------------- |
49
- | 1.16~1.17 | `ScrcpyOptions1_16` |
50
- | 1.18~1.20 | `ScrcpyOptions1_18` |
51
- | 1.21 | `ScrcpyOptions1_21` |
52
- | 1.22 | `ScrcpyOptions1_22` |
53
- | 1.23 | `ScrcpyOptions1_23` |
54
-
55
- You must use the correct type according to the server version.
56
-
57
- ## Video stream
58
-
59
- The data from `onVideoData` event is a raw H.264 stream. You can process it as you want, or use the following built-in decoders to render it in browsers:
60
-
61
- * WebCodecs decoder: Uses the [WebCodecs API](https://developer.mozilla.org/en-US/docs/Web/API/WebCodecs_API). The video stream will be decoded into `VideoFrame`s and drawn on a 2D canvas.
62
- * TinyH264 decoder: TinyH264 compiles the old Android H.264 software decoder (now deprecated and removed) into WebAssembly, and wrap it in Web Worker to prevent blocking the main thread. The video stream will be decoded into YUV frames, then converted to RGB using a WebGL shader.
63
-
64
- | Name | Chrome | Firefox | Safari | Performance | Supported H.264 profile/level |
65
- | ----------------- | ------ | ------- | ------ | ------------------------------- | ----------------------------- |
66
- | WebCodecs decoder | 94 | No | No | High with Hardware acceleration | High level 5 |
67
- | TinyH264 decoder | 57 | 52 | 11 | Poor | Baseline level 4 |
68
-
69
- TinyH264 decoder needs some extra setup:
70
-
71
- 1. `tinyh264`, `yuv-buffer` and `yuv-canvas` packages are peer dependencies. You must install them separately.
72
- 2. The bundler you use must support the `new Worker(new URL('./worker.js', import.meta.url))` syntax. It's known to work with Webpack 5.
73
-
74
- Example usage:
75
-
76
- ```ts
77
- const client = new ScrcpyClient(adb);
78
- const decoder = new WebCodecsDecoder(); // Or `new TinyH264Decoder()`
79
- client.onSizeChanged(size => decoder.setSize(size));
80
- client.onVideoData(data => decoder.feed(data));
81
- client.start(serverPath, serverVersion, new ScrcpyOptionsX_XX({
82
- ...options,
83
- codecOptions: new CodecOptions({
84
- profile: decoder.maxProfile,
85
- level: decoder.maxLevel,
86
- }),
87
- }));
88
- document.body.appendChild(decoder.element);
89
- ```
1
+ # @yume-chan/scrcpy
2
+
3
+ TypeScript implementation of [Scrcpy](https://github.com/Genymobile/scrcpy) client.
4
+
5
+ It uses the official Scrcpy server releases.
6
+
7
+ **WARNING:** The public API is UNSTABLE. If you have any questions, please open an issue.
8
+
9
+ ## Download Server Binary
10
+
11
+ This package has a script `fetch-scrcpy-server` to help you download the official server binary.
12
+
13
+ The server binary is subject to [Apache License 2.0](https://github.com/Genymobile/scrcpy/blob/master/LICENSE).
14
+
15
+ Usage:
16
+
17
+ ```
18
+ $ npx fetch-scrcpy-server <version>
19
+ ```
20
+
21
+ For example:
22
+
23
+ ```
24
+ $ npx fetch-scrcpy-server 1.21
25
+ ```
26
+
27
+ You can also add it to the `postinstall` script of your `package.json` so it will run automatically when you do `npm install`:
28
+
29
+ ```json
30
+ "scripts": {
31
+ "postinstall": "fetch-scrcpy-server 1.21",
32
+ },
33
+ ```
34
+
35
+ It will download the binary to `bin/scrcpy` and write the version string to `bin/version.js`. You can import the version string with
36
+
37
+ ```js
38
+ import SCRCPY_SERVER_VERSION from '@yume-chan/scrcpy/bin/version';
39
+ ```
40
+
41
+ And import the server binary with [file-loader](https://v4.webpack.js.org/loaders/file-loader/) (Webpack 4) or [Asset Modules](https://webpack.js.org/guides/asset-modules/) (Webpack 5).
42
+
43
+ ## Option versions
44
+
45
+ Scrcpy server has no backward compatibility on options input format. Currently the following versions are supported:
46
+
47
+ | versions | type |
48
+ | --------- | ------------------- |
49
+ | 1.16~1.17 | `ScrcpyOptions1_16` |
50
+ | 1.18~1.20 | `ScrcpyOptions1_18` |
51
+ | 1.21 | `ScrcpyOptions1_21` |
52
+ | 1.22 | `ScrcpyOptions1_22` |
53
+ | 1.23 | `ScrcpyOptions1_23` |
54
+ | 1.24 | `ScrcpyOptions1_24` |
55
+
56
+ You must use the correct type according to the server version.
57
+
58
+ ## Video stream
59
+
60
+ The data from `onVideoData` event is a raw H.264 stream. You can process it as you want, or use the following built-in decoders to render it in browsers:
61
+
62
+ * WebCodecs decoder: Uses the [WebCodecs API](https://developer.mozilla.org/en-US/docs/Web/API/WebCodecs_API). The video stream will be decoded into `VideoFrame`s and drawn on a 2D canvas.
63
+ * TinyH264 decoder: TinyH264 compiles the old Android H.264 software decoder (now deprecated and removed) into WebAssembly, and wrap it in Web Worker to prevent blocking the main thread. The video stream will be decoded into YUV frames, then converted to RGB using a WebGL shader.
64
+
65
+ | Name | Chrome | Firefox | Safari | Performance | Supported H.264 profile/level |
66
+ | ----------------- | ------ | ------- | ------ | ------------------------------- | ----------------------------- |
67
+ | WebCodecs decoder | 94 | No | No | High with Hardware acceleration | High level 5 |
68
+ | TinyH264 decoder | 57 | 52 | 11 | Poor | Baseline level 4 |
69
+
70
+ TinyH264 decoder needs some extra setup:
71
+
72
+ 1. `tinyh264`, `yuv-buffer` and `yuv-canvas` packages are peer dependencies. You must install them separately.
73
+ 2. The bundler you use must support the `new Worker(new URL('./worker.js', import.meta.url))` syntax. It's known to work with Webpack 5.
74
+
75
+ Example usage:
76
+
77
+ ```ts
78
+ const client = new ScrcpyClient(adb);
79
+ const decoder = new WebCodecsDecoder(); // Or `new TinyH264Decoder()`
80
+ client.onSizeChanged(size => decoder.setSize(size));
81
+ client.onVideoData(data => decoder.feed(data));
82
+ client.start(serverPath, serverVersion, new ScrcpyOptionsX_XX({
83
+ ...options,
84
+ codecOptions: new CodecOptions({
85
+ profile: decoder.maxProfile,
86
+ level: decoder.maxLevel,
87
+ }),
88
+ }));
89
+ document.body.appendChild(decoder.element);
90
+ ```
package/esm/message.d.ts CHANGED
@@ -83,6 +83,7 @@ export declare enum AndroidKeyCode {
83
83
  Y = 53,
84
84
  Z = 54,
85
85
  Space = 62,
86
+ Enter = 66,
86
87
  Delete = 67,
87
88
  AppSwitch = 187
88
89
  }
@@ -1 +1 @@
1
- {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../src/message.ts"],"names":[],"mappings":"AAAA,OAAO,MAAuB,MAAM,mBAAmB,CAAC;AAIxD,oBAAY,wBAAwB;IAChC,aAAa,IAAA;IACb,UAAU,IAAA;IACV,WAAW,IAAA;IACX,YAAY,IAAA;IACZ,cAAc,IAAA;IACd,uBAAuB,IAAA;IACvB,kBAAkB,IAAA;IAClB,yBAAyB,IAAA;IACzB,YAAY,IAAA;IACZ,YAAY,IAAA;IACZ,kBAAkB,KAAA;IAClB,YAAY,KAAA;CACf;AAGD,oBAAY,wBAAwB;IAChC,IAAI,IAAA;IACJ,EAAE,IAAA;IACF,IAAI,IAAA;IACJ,MAAM,IAAA;IACN,OAAO,IAAA;IACP,WAAW,IAAA;IACX,SAAS,IAAA;IACT,SAAS,IAAA;IACT,MAAM,IAAA;IACN,UAAU,IAAA;IACV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AA;IACD,CAAC,KAAA;IACD,KAAK,KAAK;IACV,KAAK,KAAK;IACV,MAAM,KAAK;IACX,SAAS,MAAM;CAClB;AAED,eAAO,MAAM,iCAAiC;;;;;;wBAMlB,CAAC;AAE7B,oBAAY,iCAAiC,GACzC,OAAO,iCAAiC,CAAC,OAAO,CAAC,CAAC"}
package/esm/message.js CHANGED
@@ -85,6 +85,7 @@ export var AndroidKeyCode;
85
85
  AndroidKeyCode[AndroidKeyCode["Y"] = 53] = "Y";
86
86
  AndroidKeyCode[AndroidKeyCode["Z"] = 54] = "Z";
87
87
  AndroidKeyCode[AndroidKeyCode["Space"] = 62] = "Space";
88
+ AndroidKeyCode[AndroidKeyCode["Enter"] = 66] = "Enter";
88
89
  AndroidKeyCode[AndroidKeyCode["Delete"] = 67] = "Delete";
89
90
  AndroidKeyCode[AndroidKeyCode["AppSwitch"] = 187] = "AppSwitch";
90
91
  })(AndroidKeyCode || (AndroidKeyCode = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"message.js","sourceRoot":"","sources":["../src/message.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAExD,+GAA+G;AAC/G,6IAA6I;AAC7I,MAAM,CAAN,IAAY,wBAaX;AAbD,WAAY,wBAAwB;IAChC,yFAAa,CAAA;IACb,mFAAU,CAAA;IACV,qFAAW,CAAA;IACX,uFAAY,CAAA;IACZ,2FAAc,CAAA;IACd,6GAAuB,CAAA;IACvB,mGAAkB,CAAA;IAClB,iHAAyB,CAAA;IACzB,uFAAY,CAAA;IACZ,uFAAY,CAAA;IACZ,oGAAkB,CAAA;IAClB,wFAAY,CAAA;AAChB,CAAC,EAbW,wBAAwB,KAAxB,wBAAwB,QAanC;AAED,+EAA+E;AAC/E,MAAM,CAAN,IAAY,wBAcX;AAdD,WAAY,wBAAwB;IAChC,uEAAI,CAAA;IACJ,mEAAE,CAAA;IACF,uEAAI,CAAA;IACJ,2EAAM,CA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CAAC,CAAA;IACD,8CAAC,CAAA;IACD,8CAAC,CAAA;IACD,8CAAC,CAAA;IACD,8CAAC,CAAA;IACD,8CAAC,CAAA;IACD,8CAAC,CAAA;IACD,8CAAC,CAAA;IACD,8CAAC,CAAA;IACD,8CAAC,CAAA;IACD,8CAAC,CAAA;IACD,8CAAC,CAAA;IACD,8CAAC,CAAA;IACD,8CAAC,CAAA;IACD,8CAAC,CAAA;IACD,8CAAC,CAAA;IACD,8CAAC,CAAA;IACD,8CAAC,CAAA;IACD,8CAAC,CAAA;IACD,8CAAC,CAAA;IACD,8CAAC,CAAA;IACD,sDAAU,CAAA;IACV,sDAAU,CAAA;IACV,wDAAW,CAAA;IACX,+DAAe,CAAA;AACnB,CAAC,EAjCW,cAAc,KAAd,cAAc,QAiCzB;AAED,MAAM,CAAC,MAAM,iCAAiC,GAC1C,IAAI,MAAM,EAAE;KACP,MAAM,CAAC,0BAA0B,CAAC;KAClC,KAAK,CAAC,QAAQ,EAAE,WAAW,EAAyB,CAAC;KACrD,MAAM,CAAC,SAAS,CAAC;KACjB,MAAM,CAAC,QAAQ,CAAC;KAChB,MAAM,CAAC,WAAW,CAAC,CAAC"}
@@ -24,6 +24,9 @@ export declare enum ScrcpyVideoOrientation {
24
24
  export interface CodecOptionsInit {
25
25
  profile: AndroidCodecProfile;
26
26
  level: AndroidCodecLevel;
27
+ iFrameInterval: number;
28
+ repeatPreviousFrameAfter: number;
29
+ maxPtsGapToEncoder: number;
27
30
  }
28
31
  export declare class CodecOptions implements ScrcpyOptionValue {
29
32
  value: Partial<CodecOptionsInit>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/options/1_16/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,eAAe,EAAE,KAAK,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACpF,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,M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;;;;;;;;;OAUG;IACH,aAAa,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB,SAAS,EAAE,MAAM,CAAC;IAElB,WAAW,EAAE,OAAO,CAAC;IAErB,SAAS,EAAE,OAAO,CAAC;IAEnB,YAAY,EAAE,YAAY,CAAC;IAE3B,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,WAAW;;;;yBAI4B,CAAC;AAErD,eAAO,MAAM,MAAM,QAA0B,CAAC;AAE9C,eAAO,MAAM,6BAA6B;;wBACZ,CAAC;AAE/B,eAAO,MAAM,oCAAoC;;;;;;;;wBAQxB,CAAC;AAE1B,qBAAa,iBAAiB,CAAC,CAAC,SAAS,qBAAqB,GAAG,qBAAqB,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;IACxG,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;gBAEN,KAAK,EAAE,OAAO,CAAC,qBAAqB,CAAC;IAcxD,SAAS,CAAC,gBAAgB,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE;IAmBzC,SAAS,CAAC,eAAe,IAAI,CAAC;IAmBvB,qBAAqB,IAAI,MAAM,EAAE;IAMjC,gBAAgB,CAAC,GAAG,EAAE,GAAG,GAAG,sBAAsB;IAclD,yBAAyB,IAAI,MAAM;IAInC,4BAA4B,IAAI,eAAe,CAAC,UAAU,EAAE,iBAAiB,CAAC;IAsF9E,sBAAsB,IAAI,wBAAwB,EAAE;IAgBpD,qCAAqC,CACxC,OAAO,EAAE,6BAA6B;IASnC,mCAAmC,CACtC,OAAO,EAAE,oCAAoC,GAC9C,UAAU;CAGhB"}
@@ -21,6 +21,13 @@ export var ScrcpyVideoOrientation;
21
21
  ScrcpyVideoOrientation[ScrcpyVideoOrientation["PortraitFlipped"] = 2] = "PortraitFlipped";
22
22
  ScrcpyVideoOrientation[ScrcpyVideoOrientation["LandscapeFlipped"] = 3] = "LandscapeFlipped";
23
23
  })(ScrcpyVideoOrientation || (ScrcpyVideoOrientation = {}));
24
+ function toDashCase(input) {
25
+ return input.replace(/([A-Z])/g, '-$1').toLowerCase();
26
+ }
27
+ const CODEC_OPTION_TYPES = {
28
+ repeatPreviousFrameAfter: 'long',
29
+ maxPtsGapToEncoder: 'long',
30
+ };
24
31
  export class CodecOptions {
25
32
  value;
26
33
  constructor(value) {
@@ -33,7 +40,10 @@ export class CodecOptions {
33
40
  return undefined;
34
41
  }
35
42
  return entries
36
- .map(([key, value]) => `${key}=${value}`)
43
+ .map(([key, value]) => {
44
+ const type = CODEC_OPTION_TYPES[key];
45
+ return `${toDashCase(key)}${type ? `:${type}` : ''}=${value}`;
46
+ })
37
47
  .join(',');
38
48
  }
39
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/options/1_16/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAY,MAAM,gBAAgB,CAAC;AACpF,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAA0B,6BAA6B,EAAE,6BAA6B,EAAsC,MAAM,qBAAqB,CAAC;AAC/J,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAG/G,OAAO,EAAE,mBAAmB,EAAsE,MAAM,cAAc,CAAC;AACvH,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACtB,qCAAmB,CAAA;IACnB,iCAAe,CAAA;IACf,+BAAa,CAAA;IACb,+BAAa,CAAA;IACb,iCAAe,CAAA;AACnB,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AAED,MAAM,CAAN,IAAY,sBAOX;AAPD,WAAY,sBAAsB;IAC9B,0EAAY,CAAA;IACZ,4EAAa,CAAA;IACb,2EAAY,CAAA;IACZ,6EAAa,CAAA;IACb,yFAAmB,CAAA;IAC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",
5
5
  "keywords": [
6
6
  "adb",
@@ -29,20 +29,20 @@
29
29
  "main": "esm/index.js",
30
30
  "types": "esm/index.d.ts",
31
31
  "dependencies": {
32
- "@yume-chan/adb": "^0.0.15",
32
+ "@yume-chan/adb": "^0.0.16",
33
33
  "@yume-chan/async": "^2.1.4",
34
- "@yume-chan/event": "^0.0.15",
35
- "@yume-chan/struct": "^0.0.15",
34
+ "@yume-chan/event": "^0.0.16",
35
+ "@yume-chan/struct": "^0.0.16",
36
36
  "tslib": "^2.3.1"
37
37
  },
38
38
  "devDependencies": {
39
+ "@jest/globals": "^28.1.0",
39
40
  "@types/dom-webcodecs": "^0.1.3",
40
- "@types/jest": "^27.4.1",
41
41
  "@yume-chan/ts-package-builder": "^1.0.0",
42
42
  "gh-release-fetch": "^2.0.4",
43
- "jest": "^27.5.1",
43
+ "jest": "^28.1.0",
44
44
  "tinyh264": "^0.0.7",
45
- "typescript": "4.7.0-beta",
45
+ "typescript": "4.7.2",
46
46
  "yuv-buffer": "^1.0.0",
47
47
  "yuv-canvas": "^1.2.7"
48
48
  },
@@ -57,5 +57,5 @@
57
57
  "build:watch": "build-ts-package --incremental",
58
58
  "test": "jest --coverage"
59
59
  },
60
- "readme": "# @yume-chan/scrcpy\r\n\r\nTypeScript implementation of [Scrcpy](https://github.com/Genymobile/scrcpy) client.\r\n\r\nIt uses the official Scrcpy server releases.\r\n\r\n**WARNING:** The public API is UNSTABLE. If you have any questions, please open an issue.\r\n\r\n## Download Server Binary\r\n\r\nThis package has a script `fetch-scrcpy-server` to help you download the official server binary.\r\n\r\nThe server binary is subject to [Apache License 2.0](https://github.com/Genymobile/scrcpy/blob/master/LICENSE).\r\n\r\nUsage:\r\n\r\n```\r\n$ npx fetch-scrcpy-server <version>\r\n```\r\n\r\nFor example:\r\n\r\n```\r\n$ npx fetch-scrcpy-server 1.21\r\n```\r\n\r\nYou can also add it to the `postinstall` script of your `package.json` so it will run automatically when you do `npm install`:\r\n\r\n```json\r\n\"scripts\": {\r\n \"postinstall\": \"fetch-scrcpy-server 1.21\",\r\n},\r\n```\r\n\r\nIt will download the binary to `bin/scrcpy` and write the version string to `bin/version.js`. You can import the version string with\r\n\r\n```js\r\nimport SCRCPY_SERVER_VERSION from '@yume-chan/scrcpy/bin/version';\r\n```\r\n\r\nAnd import the server binary with [file-loader](https://v4.webpack.js.org/loaders/file-loader/) (Webpack 4) or [Asset Modules](https://webpack.js.org/guides/asset-modules/) (Webpack 5).\r\n\r\n## Option versions\r\n\r\nScrcpy server has no backward compatibility on options input format. Currently the following versions are supported:\r\n\r\n| versions | type |\r\n| --------- | ------------------- |\r\n| 1.16~1.17 | `ScrcpyOptions1_16` |\r\n| 1.18~1.20 | `ScrcpyOptions1_18` |\r\n| 1.21 | `ScrcpyOptions1_21` |\r\n| 1.22 | `ScrcpyOptions1_22` |\r\n| 1.23 | `ScrcpyOptions1_23` |\r\n\r\nYou must use the correct type according to the server version.\r\n\r\n## Video stream\r\n\r\nThe data from `onVideoData` event is a raw H.264 stream. You can process it as you want, or use the following built-in decoders to render it in browsers:\r\n\r\n* WebCodecs decoder: Uses the [WebCodecs API](https://developer.mozilla.org/en-US/docs/Web/API/WebCodecs_API). The video stream will be decoded into `VideoFrame`s and drawn on a 2D canvas.\r\n* TinyH264 decoder: TinyH264 compiles the old Android H.264 software decoder (now deprecated and removed) into WebAssembly, and wrap it in Web Worker to prevent blocking the main thread. The video stream will be decoded into YUV frames, then converted to RGB using a WebGL shader.\r\n\r\n| Name | Chrome | Firefox | Safari | Performance | Supported H.264 profile/level |\r\n| ----------------- | ------ | ------- | ------ | ------------------------------- | ----------------------------- |\r\n| WebCodecs decoder | 94 | No | No | High with Hardware acceleration | High level 5 |\r\n| TinyH264 decoder | 57 | 52 | 11 | Poor | Baseline level 4 |\r\n\r\nTinyH264 decoder needs some extra setup:\r\n\r\n1. `tinyh264`, `yuv-buffer` and `yuv-canvas` packages are peer dependencies. You must install them separately.\r\n2. The bundler you use must support the `new Worker(new URL('./worker.js', import.meta.url))` syntax. It's known to work with Webpack 5.\r\n\r\nExample usage:\r\n\r\n```ts\r\nconst client = new ScrcpyClient(adb);\r\nconst decoder = new WebCodecsDecoder(); // Or `new TinyH264Decoder()`\r\nclient.onSizeChanged(size => decoder.setSize(size));\r\nclient.onVideoData(data => decoder.feed(data));\r\nclient.start(serverPath, serverVersion, new ScrcpyOptionsX_XX({\r\n ...options,\r\n codecOptions: new CodecOptions({\r\n profile: decoder.maxProfile,\r\n level: decoder.maxLevel,\r\n }),\r\n}));\r\ndocument.body.appendChild(decoder.element);\r\n```\r\n"
60
+ "readme": "# @yume-chan/scrcpy\n\nTypeScript implementation of [Scrcpy](https://github.com/Genymobile/scrcpy) client.\n\nIt uses the official Scrcpy server releases.\n\n**WARNING:** The public API is UNSTABLE. If you have any questions, please open an issue.\n\n## Download Server Binary\n\nThis package has a script `fetch-scrcpy-server` to help you download the official server binary.\n\nThe server binary is subject to [Apache License 2.0](https://github.com/Genymobile/scrcpy/blob/master/LICENSE).\n\nUsage:\n\n```\n$ npx fetch-scrcpy-server <version>\n```\n\nFor example:\n\n```\n$ npx fetch-scrcpy-server 1.21\n```\n\nYou can also add it to the `postinstall` script of your `package.json` so it will run automatically when you do `npm install`:\n\n```json\n\"scripts\": {\n \"postinstall\": \"fetch-scrcpy-server 1.21\",\n},\n```\n\nIt will download the binary to `bin/scrcpy` and write the version string to `bin/version.js`. You can import the version string with\n\n```js\nimport SCRCPY_SERVER_VERSION from '@yume-chan/scrcpy/bin/version';\n```\n\nAnd import the server binary with [file-loader](https://v4.webpack.js.org/loaders/file-loader/) (Webpack 4) or [Asset Modules](https://webpack.js.org/guides/asset-modules/) (Webpack 5).\n\n## Option versions\n\nScrcpy server has no backward compatibility on options input format. Currently the following versions are supported:\n\n| versions | type |\n| --------- | ------------------- |\n| 1.16~1.17 | `ScrcpyOptions1_16` |\n| 1.18~1.20 | `ScrcpyOptions1_18` |\n| 1.21 | `ScrcpyOptions1_21` |\n| 1.22 | `ScrcpyOptions1_22` |\n| 1.23 | `ScrcpyOptions1_23` |\n| 1.24 | `ScrcpyOptions1_24` |\n\nYou must use the correct type according to the server version.\n\n## Video stream\n\nThe data from `onVideoData` event is a raw H.264 stream. You can process it as you want, or use the following built-in decoders to render it in browsers:\n\n* WebCodecs decoder: Uses the [WebCodecs API](https://developer.mozilla.org/en-US/docs/Web/API/WebCodecs_API). The video stream will be decoded into `VideoFrame`s and drawn on a 2D canvas.\n* TinyH264 decoder: TinyH264 compiles the old Android H.264 software decoder (now deprecated and removed) into WebAssembly, and wrap it in Web Worker to prevent blocking the main thread. The video stream will be decoded into YUV frames, then converted to RGB using a WebGL shader.\n\n| Name | Chrome | Firefox | Safari | Performance | Supported H.264 profile/level |\n| ----------------- | ------ | ------- | ------ | ------------------------------- | ----------------------------- |\n| WebCodecs decoder | 94 | No | No | High with Hardware acceleration | High level 5 |\n| TinyH264 decoder | 57 | 52 | 11 | Poor | Baseline level 4 |\n\nTinyH264 decoder needs some extra setup:\n\n1. `tinyh264`, `yuv-buffer` and `yuv-canvas` packages are peer dependencies. You must install them separately.\n2. The bundler you use must support the `new Worker(new URL('./worker.js', import.meta.url))` syntax. It's known to work with Webpack 5.\n\nExample usage:\n\n```ts\nconst client = new ScrcpyClient(adb);\nconst decoder = new WebCodecsDecoder(); // Or `new TinyH264Decoder()`\nclient.onSizeChanged(size => decoder.setSize(size));\nclient.onVideoData(data => decoder.feed(data));\nclient.start(serverPath, serverVersion, new ScrcpyOptionsX_XX({\n ...options,\n codecOptions: new CodecOptions({\n profile: decoder.maxProfile,\n level: decoder.maxLevel,\n }),\n}));\ndocument.body.appendChild(decoder.element);\n```\n"
61
61
  }