@yume-chan/scrcpy 0.0.17 → 0.0.18

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.
Files changed (214) hide show
  1. package/CHANGELOG.json +21 -3
  2. package/CHANGELOG.md +13 -4
  3. package/LICENSE +1 -1
  4. package/README.md +41 -24
  5. package/bin/scrcpy-server +0 -0
  6. package/bin/version.d.ts +1 -1
  7. package/bin/version.js +1 -1
  8. package/esm/adb/client.d.ts +15 -14
  9. package/esm/adb/client.d.ts.map +1 -1
  10. package/esm/adb/client.js +66 -41
  11. package/esm/adb/client.js.map +1 -1
  12. package/esm/adb/connection.d.ts +16 -7
  13. package/esm/adb/connection.d.ts.map +1 -1
  14. package/esm/adb/connection.js +21 -13
  15. package/esm/adb/connection.js.map +1 -1
  16. package/esm/adb/options/1_16.d.ts +4 -4
  17. package/esm/adb/options/1_16.d.ts.map +1 -1
  18. package/esm/adb/options/1_16.js +2 -2
  19. package/esm/adb/options/1_16.js.map +1 -1
  20. package/esm/adb/options/1_22.d.ts +4 -4
  21. package/esm/adb/options/1_22.d.ts.map +1 -1
  22. package/esm/adb/options/1_22.js +2 -2
  23. package/esm/adb/options/1_22.js.map +1 -1
  24. package/esm/adb/options/types.d.ts +10 -9
  25. package/esm/adb/options/types.d.ts.map +1 -1
  26. package/esm/adb/options/types.js +11 -4
  27. package/esm/adb/options/types.js.map +1 -1
  28. package/esm/control/back-or-screen-on.d.ts +3 -0
  29. package/esm/control/back-or-screen-on.d.ts.map +1 -0
  30. package/esm/control/back-or-screen-on.js +2 -0
  31. package/esm/control/back-or-screen-on.js.map +1 -0
  32. package/esm/control/hover-helper.d.ts +18 -0
  33. package/esm/control/hover-helper.d.ts.map +1 -0
  34. package/esm/control/hover-helper.js +44 -0
  35. package/esm/control/hover-helper.js.map +1 -0
  36. package/esm/control/index.d.ts +11 -7
  37. package/esm/control/index.d.ts.map +1 -1
  38. package/esm/control/index.js +11 -7
  39. package/esm/control/index.js.map +1 -1
  40. package/esm/control/inject-keycode.d.ts +12 -4
  41. package/esm/control/inject-keycode.d.ts.map +1 -1
  42. package/esm/control/inject-keycode.js +15 -7
  43. package/esm/control/inject-keycode.js.map +1 -1
  44. package/esm/control/inject-scroll.d.ts +3 -0
  45. package/esm/control/inject-scroll.d.ts.map +1 -0
  46. package/esm/control/inject-scroll.js +2 -0
  47. package/esm/control/inject-scroll.js.map +1 -0
  48. package/esm/control/inject-text.d.ts +2 -2
  49. package/esm/control/inject-text.d.ts.map +1 -1
  50. package/esm/control/inject-touch.d.ts +12 -4
  51. package/esm/control/inject-touch.d.ts.map +1 -1
  52. package/esm/control/inject-touch.js +44 -11
  53. package/esm/control/inject-touch.js.map +1 -1
  54. package/esm/control/rotate-device.d.ts +2 -2
  55. package/esm/control/rotate-device.d.ts.map +1 -1
  56. package/esm/control/serializer.d.ts +22 -11
  57. package/esm/control/serializer.d.ts.map +1 -1
  58. package/esm/control/serializer.js +32 -26
  59. package/esm/control/serializer.js.map +1 -1
  60. package/esm/control/set-clipboard.d.ts +3 -0
  61. package/esm/control/set-clipboard.d.ts.map +1 -0
  62. package/esm/control/set-clipboard.js +2 -0
  63. package/esm/control/set-clipboard.js.map +1 -0
  64. package/esm/control/set-screen-power-mode.d.ts +2 -2
  65. package/esm/control/set-screen-power-mode.d.ts.map +1 -1
  66. package/esm/device-message/ack-clipboard.d.ts +9 -0
  67. package/esm/device-message/ack-clipboard.d.ts.map +1 -0
  68. package/esm/device-message/ack-clipboard.js +6 -0
  69. package/esm/device-message/ack-clipboard.js.map +1 -0
  70. package/esm/device-message/clipboard.d.ts +3 -3
  71. package/esm/device-message/clipboard.d.ts.map +1 -1
  72. package/esm/device-message/clipboard.js +4 -4
  73. package/esm/device-message/clipboard.js.map +1 -1
  74. package/esm/device-message/index.d.ts +4 -3
  75. package/esm/device-message/index.d.ts.map +1 -1
  76. package/esm/device-message/index.js +4 -3
  77. package/esm/device-message/index.js.map +1 -1
  78. package/esm/device-message/stream.d.ts +4 -3
  79. package/esm/device-message/stream.d.ts.map +1 -1
  80. package/esm/device-message/stream.js +8 -4
  81. package/esm/device-message/stream.js.map +1 -1
  82. package/esm/options/1_16/codec-options.d.ts +3 -2
  83. package/esm/options/1_16/codec-options.d.ts.map +1 -1
  84. package/esm/options/1_16/codec-options.js +6 -7
  85. package/esm/options/1_16/codec-options.js.map +1 -1
  86. package/esm/options/1_16/h264-configuration.d.ts +49 -0
  87. package/esm/options/1_16/h264-configuration.d.ts.map +1 -0
  88. package/esm/options/1_16/h264-configuration.js +414 -0
  89. package/esm/options/1_16/h264-configuration.js.map +1 -0
  90. package/esm/options/1_16/index.d.ts +4 -3
  91. package/esm/options/1_16/index.d.ts.map +1 -1
  92. package/esm/options/1_16/index.js +4 -3
  93. package/esm/options/1_16/index.js.map +1 -1
  94. package/esm/options/1_16/options.d.ts +17 -20
  95. package/esm/options/1_16/options.d.ts.map +1 -1
  96. package/esm/options/1_16/options.js +51 -49
  97. package/esm/options/1_16/options.js.map +1 -1
  98. package/esm/options/1_16/scroll.d.ts +27 -0
  99. package/esm/options/1_16/scroll.d.ts.map +1 -0
  100. package/esm/options/1_16/scroll.js +56 -0
  101. package/esm/options/1_16/scroll.js.map +1 -0
  102. package/esm/options/1_16/sps.d.ts +1 -1
  103. package/esm/options/1_16/sps.d.ts.map +1 -1
  104. package/esm/options/1_16/sps.js +25 -17
  105. package/esm/options/1_16/sps.js.map +1 -1
  106. package/esm/options/1_18.d.ts +6 -6
  107. package/esm/options/1_18.d.ts.map +1 -1
  108. package/esm/options/1_18.js +5 -5
  109. package/esm/options/1_18.js.map +1 -1
  110. package/esm/options/1_21.d.ts +12 -1
  111. package/esm/options/1_21.d.ts.map +1 -1
  112. package/esm/options/1_21.js +14 -3
  113. package/esm/options/1_21.js.map +1 -1
  114. package/esm/options/1_22/index.d.ts +3 -0
  115. package/esm/options/1_22/index.d.ts.map +1 -0
  116. package/esm/options/1_22/index.js +3 -0
  117. package/esm/options/1_22/index.js.map +1 -0
  118. package/esm/options/{1_22.d.ts → 1_22/options.d.ts} +4 -15
  119. package/esm/options/1_22/options.d.ts.map +1 -0
  120. package/esm/options/{1_22.js → 1_22/options.js} +5 -9
  121. package/esm/options/1_22/options.js.map +1 -0
  122. package/esm/options/1_22/scroll.d.ts +17 -0
  123. package/esm/options/1_22/scroll.d.ts.map +1 -0
  124. package/esm/options/1_22/scroll.js +15 -0
  125. package/esm/options/1_22/scroll.js.map +1 -0
  126. package/esm/options/1_23.d.ts +3 -3
  127. package/esm/options/1_23.d.ts.map +1 -1
  128. package/esm/options/1_23.js +7 -6
  129. package/esm/options/1_23.js.map +1 -1
  130. package/esm/options/1_25/index.d.ts +3 -0
  131. package/esm/options/1_25/index.d.ts.map +1 -0
  132. package/esm/options/1_25/index.js +3 -0
  133. package/esm/options/1_25/index.js.map +1 -0
  134. package/esm/options/1_25/options.d.ts +6 -0
  135. package/esm/options/1_25/options.d.ts.map +1 -0
  136. package/esm/options/1_25/options.js +8 -0
  137. package/esm/options/1_25/options.js.map +1 -0
  138. package/esm/options/1_25/scroll.d.ts +19 -0
  139. package/esm/options/1_25/scroll.d.ts.map +1 -0
  140. package/esm/options/1_25/scroll.js +33 -0
  141. package/esm/options/1_25/scroll.js.map +1 -0
  142. package/esm/options/index.d.ts +5 -4
  143. package/esm/options/index.d.ts.map +1 -1
  144. package/esm/options/index.js +5 -4
  145. package/esm/options/index.js.map +1 -1
  146. package/esm/options/types.d.ts +14 -12
  147. package/esm/options/types.d.ts.map +1 -1
  148. package/esm/options/types.js +6 -4
  149. package/esm/options/types.js.map +1 -1
  150. package/package.json +19 -12
  151. package/scripts/fetch-server.cjs +19 -9
  152. package/src/adb/client.ts +142 -89
  153. package/src/adb/connection.ts +77 -30
  154. package/src/adb/options/1_16.ts +13 -6
  155. package/src/adb/options/1_22.ts +12 -6
  156. package/src/adb/options/types.ts +34 -14
  157. package/src/control/back-or-screen-on.ts +4 -0
  158. package/src/control/hover-helper.ts +56 -0
  159. package/src/control/index.ts +11 -7
  160. package/src/control/inject-keycode.ts +23 -10
  161. package/src/control/inject-scroll.ts +4 -0
  162. package/src/control/inject-touch.ts +58 -14
  163. package/src/control/serializer.ts +106 -41
  164. package/src/control/set-clipboard.ts +4 -0
  165. package/src/device-message/ack-clipboard.ts +10 -0
  166. package/src/device-message/clipboard.ts +8 -8
  167. package/src/device-message/index.ts +4 -3
  168. package/src/device-message/stream.ts +17 -7
  169. package/src/options/1_16/codec-options.ts +17 -10
  170. package/src/options/1_16/h264-configuration.ts +485 -0
  171. package/src/options/1_16/index.ts +4 -3
  172. package/src/options/1_16/options.ts +175 -130
  173. package/src/options/1_16/scroll.ts +76 -0
  174. package/src/options/1_18.ts +22 -12
  175. package/src/options/1_21.ts +31 -13
  176. package/src/options/1_22/index.ts +2 -0
  177. package/src/options/{1_22.ts → 1_22/options.ts} +8 -17
  178. package/src/options/1_22/scroll.ts +26 -0
  179. package/src/options/1_23.ts +32 -20
  180. package/src/options/1_25/index.ts +2 -0
  181. package/src/options/1_25/options.ts +12 -0
  182. package/src/options/1_25/scroll.ts +52 -0
  183. package/src/options/index.ts +5 -4
  184. package/src/options/types.ts +34 -17
  185. package/tsconfig.build.json +1 -1
  186. package/tsconfig.build.tsbuildinfo +1 -1
  187. package/esm/decoder/index.d.ts +0 -28
  188. package/esm/decoder/index.d.ts.map +0 -1
  189. package/esm/decoder/index.js +0 -2
  190. package/esm/decoder/index.js.map +0 -1
  191. package/esm/decoder/tinyh264/index.d.ts +0 -20
  192. package/esm/decoder/tinyh264/index.d.ts.map +0 -1
  193. package/esm/decoder/tinyh264/index.js +0 -86
  194. package/esm/decoder/tinyh264/index.js.map +0 -1
  195. package/esm/decoder/tinyh264/worker.d.ts +0 -2
  196. package/esm/decoder/tinyh264/worker.d.ts.map +0 -1
  197. package/esm/decoder/tinyh264/worker.js +0 -3
  198. package/esm/decoder/tinyh264/worker.js.map +0 -1
  199. package/esm/decoder/tinyh264/wrapper.d.ts +0 -21
  200. package/esm/decoder/tinyh264/wrapper.d.ts.map +0 -1
  201. package/esm/decoder/tinyh264/wrapper.js +0 -74
  202. package/esm/decoder/tinyh264/wrapper.js.map +0 -1
  203. package/esm/decoder/types.d.ts +0 -2
  204. package/esm/decoder/types.d.ts.map +0 -1
  205. package/esm/decoder/types.js +0 -2
  206. package/esm/decoder/types.js.map +0 -1
  207. package/esm/decoder/web-codecs/index.d.ts +0 -22
  208. package/esm/decoder/web-codecs/index.d.ts.map +0 -1
  209. package/esm/decoder/web-codecs/index.js +0 -81
  210. package/esm/decoder/web-codecs/index.js.map +0 -1
  211. package/esm/options/1_22.d.ts.map +0 -1
  212. package/esm/options/1_22.js.map +0 -1
  213. package/src/options/1_16/sps.ts +0 -300
  214. package/tsconfig.test.tsbuildinfo +0 -1
package/CHANGELOG.json CHANGED
@@ -1,6 +1,24 @@
1
1
  {
2
2
  "name": "@yume-chan/scrcpy",
3
3
  "entries": [
4
+ {
5
+ "version": "0.0.18",
6
+ "tag": "@yume-chan/scrcpy_v0.0.18",
7
+ "date": "Wed, 25 Jan 2023 21:33:49 GMT",
8
+ "comments": {
9
+ "none": [
10
+ {
11
+ "comment": "Move `@yume-chan/adb` to `peerDependencies`"
12
+ },
13
+ {
14
+ "comment": "Add support for Scrcpy server version 1.25"
15
+ },
16
+ {
17
+ "comment": "Add support for `SetClipboard` control message and `AckClipboard` device message"
18
+ }
19
+ ]
20
+ }
21
+ },
4
22
  {
5
23
  "version": "0.0.17",
6
24
  "tag": "@yume-chan/scrcpy_v0.0.17",
@@ -56,7 +74,7 @@
56
74
  "comments": {
57
75
  "none": [
58
76
  {
59
- "comment": "Add support for new option of 1.24"
77
+ "comment": "Add support for Scrcpy server version 1.24"
60
78
  }
61
79
  ]
62
80
  }
@@ -68,7 +86,7 @@
68
86
  "comments": {
69
87
  "none": [
70
88
  {
71
- "comment": "Add support for 1.23"
89
+ "comment": "Add support for Scrcpy server version 1.23"
72
90
  }
73
91
  ]
74
92
  }
@@ -86,7 +104,7 @@
86
104
  "comments": {
87
105
  "none": [
88
106
  {
89
- "comment": "Add support for 1.22 new server options"
107
+ "comment": "Add support for Scrcpy server version 1.22"
90
108
  },
91
109
  {
92
110
  "comment": "Update to use Web Streams API"
package/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
1
  # Change Log - @yume-chan/scrcpy
2
2
 
3
- This log was last generated on Tue, 18 Oct 2022 09:32:30 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 25 Jan 2023 21:33:49 GMT and should not be manually modified.
4
+
5
+ ## 0.0.18
6
+ Wed, 25 Jan 2023 21:33:49 GMT
7
+
8
+ ### Updates
9
+
10
+ - Move `@yume-chan/adb` to `peerDependencies`
11
+ - Add support for Scrcpy server version 1.25
12
+ - Add support for `SetClipboard` control message and `AckClipboard` device message
4
13
 
5
14
  ## 0.0.17
6
15
  Tue, 18 Oct 2022 09:32:30 GMT
@@ -32,14 +41,14 @@ Sat, 30 Apr 2022 14:05:48 GMT
32
41
 
33
42
  ### Updates
34
43
 
35
- - Add support for new option of 1.24
44
+ - Add support for Scrcpy server version 1.24
36
45
 
37
46
  ## 0.0.13
38
47
  Thu, 28 Apr 2022 01:23:53 GMT
39
48
 
40
49
  ### Updates
41
50
 
42
- - Add support for 1.23
51
+ - Add support for Scrcpy server version 1.23
43
52
 
44
53
  ## 0.0.12
45
54
  Sun, 03 Apr 2022 11:18:47 GMT
@@ -51,7 +60,7 @@ Sun, 03 Apr 2022 10:54:15 GMT
51
60
 
52
61
  ### Updates
53
62
 
54
- - Add support for 1.22 new server options
63
+ - Add support for Scrcpy server version 1.22
55
64
  - Update to use Web Streams API
56
65
  - Improve compatibility with Node.js 12 ESM format
57
66
  - Workaround a issue with server crash on Samsung ROM (https://github.com/Genymobile/scrcpy/issues/2841)
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020-2022 Simon Chan
3
+ Copyright (c) 2020-2023 Simon Chan
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -6,7 +6,7 @@ It's compatible with the official Scrcpy server binaries.
6
6
 
7
7
  **WARNING:** The public API is UNSTABLE. If you have any questions, please open an issue.
8
8
 
9
- - [Transport agnostic](#transport-agnostic)
9
+ - [Basic information](#basic-information)
10
10
  - [Prepare server binary](#prepare-server-binary)
11
11
  - [`fetch-scrcpy-server`](#fetch-scrcpy-server)
12
12
  - [Use the server binary](#use-the-server-binary)
@@ -15,7 +15,7 @@ It's compatible with the official Scrcpy server binaries.
15
15
  - [Webpack 4](#webpack-4)
16
16
  - [Webpack 5](#webpack-5)
17
17
  - [Read the server version](#read-the-server-version)
18
- - [Option versions](#option-versions)
18
+ - [Server versions](#server-versions)
19
19
  - [Use with `@yume-chan/adb`](#use-with-yume-chanadb)
20
20
  - [Push server binary](#push-server-binary)
21
21
  - [Start server on device](#start-server-on-device)
@@ -23,17 +23,25 @@ It's compatible with the official Scrcpy server binaries.
23
23
  - [Parsing video packets](#parsing-video-packets)
24
24
  - [Sending control messages](#sending-control-messages)
25
25
  - [Reading device messages](#reading-device-messages)
26
- - [Consume the streams](#consume-the-streams)
26
+ - [Always read the streams](#always-read-the-streams)
27
27
  - [Video stream](#video-stream)
28
28
  - [Decode video stream](#decode-video-stream)
29
29
 
30
- ## Transport agnostic
30
+ ## Basic information
31
31
 
32
- It was initially designed to be used with `@yume-chan/adb`, but now it can also to used with any other transportation.
32
+ Although Scrcpy doesn't install any App on the device, it does have a server binary executable to be run on the device.
33
+
34
+ With the official Scrcpy client and server, the client uses ADB to transfer the server binary file to the device, run it, and communicate with it via ADB tunnel (the bootstrap process).
35
+
36
+ This package provides types that can serialize and deserialize Scrcpy protocol messages, but it generally requires you to do the bootstrapping and provide the data stream to the server.
37
+
38
+ If you are also using `@yume-chan/adb`, this package has a helper class that can complete the bootstrap process using it, doing what the official client does.
39
+
40
+ **NOTE:** `@yume-chan/adb` is a peer dependency, you need to install it yourself. Only those types whose names begin with `Adb` requires `@yume-chan/adb`.
33
41
 
34
42
  ## Prepare server binary
35
43
 
36
- Scrcpy needs a server binary running on the device in order to work. This package doesn't ship with one.
44
+ This package doesn't include the server binary. It's compatible with many versions of the official server binary, but may not work with future versions due to protocol changes.
37
45
 
38
46
  You can download the server binary from official releases (https://github.com/Genymobile/scrcpy/releases), or use the built-in `fetch-scrcpy-server` script to automate the process.
39
47
 
@@ -41,9 +49,11 @@ The server binary is subject to [Apache License 2.0](https://github.com/Genymobi
41
49
 
42
50
  ### `fetch-scrcpy-server`
43
51
 
44
- To use the script, first add `gh-release-fetch@3` to `devDependencies` of your `package.json`. It's an optional peer dependency fpr minimized download size.
52
+ This package includes a script that downloads the server binary from official releases for you.
45
53
 
46
- Then you can invoke it in a terminal:
54
+ The `gh-release-fetch@3` package is a peer dependency for this script, thus requires separated installation.
55
+
56
+ Usage:
47
57
 
48
58
  ```
49
59
  $ npx fetch-scrcpy-server <version>
@@ -52,14 +62,14 @@ $ npx fetch-scrcpy-server <version>
52
62
  For example:
53
63
 
54
64
  ```
55
- $ npx fetch-scrcpy-server 1.24
65
+ $ npx fetch-scrcpy-server 1.25
56
66
  ```
57
67
 
58
- You can also add it to the `postinstall` script in your `package.json`. After that, running `npm install` will automatically invoke the script.
68
+ It can also be added to the `postinstall` script in `package.json`, so running `npm install` will automatically invoke the script:
59
69
 
60
70
  ```json
61
71
  "scripts": {
62
- "postinstall": "fetch-scrcpy-server 1.24",
72
+ "postinstall": "fetch-scrcpy-server 1.25",
63
73
  },
64
74
  ```
65
75
 
@@ -67,7 +77,7 @@ The server binary will be named `bin/scrcpy-server` in this package's installati
67
77
 
68
78
  ### Use the server binary
69
79
 
70
- The server binary file needs to be embedded into your application, the exact method depends on the runtime.
80
+ The server binary file needs to be embedded into your application, the exact method depends on the bundler and runtime.
71
81
 
72
82
  To name a few:
73
83
 
@@ -122,12 +132,12 @@ The correct version number is required to launch the server, so `fetch-scrcpy-se
122
132
  ```js
123
133
  import SCRCPY_SERVER_VERSION from '@yume-chan/scrcpy/bin/version.js';
124
134
 
125
- console.log(SCRCPY_SERVER_VERSION); // "1.24"
135
+ console.log(SCRCPY_SERVER_VERSION); // "1.25"
126
136
  ```
127
137
 
128
- ## Option versions
138
+ ## Server versions
129
139
 
130
- Scrcpy server options changes over time, and some of them are not backwards compatible. This package provides option types for each version (or range). Using wrong option version usually results in errors.
140
+ Scrcpy protocol change over time, and are usually not backwards compatible. This package supports multiple server versions (or ranges), and uses different option types to choose different behaviors. Using incorrect option version usually results in errors.
131
141
 
132
142
  The latest one may continue to work for future server versions, but there is no guarantee.
133
143
 
@@ -139,17 +149,18 @@ The latest one may continue to work for future server versions, but there is no
139
149
  | 1.22 | `ScrcpyOptions1_22` |
140
150
  | 1.23 | `ScrcpyOptions1_23` |
141
151
  | 1.24 | `ScrcpyOptions1_24` |
152
+ | 1.25 | `ScrcpyOptions1_25` |
142
153
 
143
- When using `AdbScrcpyClient`, there is another `AdbScrcpyOptions` contains `@yume-chan/adb` related logics:
154
+ When using `AdbScrcpyClient`, there are `AdbScrcpyOptions` containing `@yume-chan/adb` specific options:
144
155
 
145
156
  | Version | Type |
146
157
  | --------- | ---------------------- |
147
158
  | 1.16~1.21 | `AdbScrcpyOptions1_16` |
148
- | 1.22~1.24 | `AdbScrcpyOptions1_22` |
159
+ | 1.22~1.25 | `AdbScrcpyOptions1_22` |
149
160
 
150
161
  ## Use with `@yume-chan/adb`
151
162
 
152
- The the server binary needs to be copied to the device and run on it.
163
+ `@yume-chan/adb` is a TypeScript ADB implementation that can run on Web browser. It can be used to bootstrap the server on a device.
153
164
 
154
165
  ### Push server binary
155
166
 
@@ -193,7 +204,7 @@ import SCRCPY_SERVER_VERSION from '@yume-chan/scrcpy/bin/version.js';
193
204
  const client: AdbScrcpyClient = await AdbScrcpyClient.start(
194
205
  adb,
195
206
  DEFAULT_SERVER_PATH,
196
- SCRCPY_SERVER_VERSION, // Or provide your own version number
207
+ SCRCPY_SERVER_VERSION, // If server binary was downloaded manually, must provide the correct version
197
208
  new AdbScrcpyOptions1_22(ScrcpyOptions1_24({
198
209
  // options
199
210
  }))
@@ -216,6 +227,8 @@ If you push, start and connect to the server yourself, you can still use this pa
216
227
 
217
228
  Requires a `ReadableStream<Uint8Array>` that reads from the video socket, preserving packet boundaries.
218
229
 
230
+ **NOTE:** Because this package uses `web-streams-polyfill` NPM package's Web Streams API implementation, the provided `ReadableStream` must also be from `web-streams-polyfill` (or another polyfill that doesn't check object prototype when piping).
231
+
219
232
  ```ts
220
233
  import { ScrcpyOptions1_24, ScrcpyVideoStreamPacket } from '@yume-chan/scrcpy';
221
234
 
@@ -253,6 +266,8 @@ controlMessageSerializer.injectText("Hello World!");
253
266
 
254
267
  Requires a `ReadableStream<Uint8Array>` that reads from the control socket.
255
268
 
269
+ **NOTE:** Because this package uses `web-streams-polyfill` NPM package's Web Streams API implementation, the provided `ReadableStream` must also be from `web-streams-polyfill` (or another polyfill that doesn't check object prototype when piping).
270
+
256
271
  ```ts
257
272
  import { ScrcpyDeviceMessageDeserializeStream, ScrcpyOptions1_24 } from '@yume-chan/scrcpy';
258
273
 
@@ -261,9 +276,11 @@ const controlStream: ReadableWritablePair<Uint8Array, Uint8Array> | undefined //
261
276
  const deviceMessageStream: ReadableStream<ScrcpyDeviceMessage> = controlStream.readable.pipeThrough(new ScrcpyDeviceMessageDeserializeStream());
262
277
  ```
263
278
 
264
- ## Consume the streams
279
+ ## Always read the streams
280
+
281
+ In Web Streams API, `ReadableStream` will block its upstream when too many chunks are kept not read. If multiple streams are from the same upstream source, block one stream means blocking all of them.
265
282
 
266
- Any `ReadableStream` (`stdout` when using `AdbScrcpyClient`, `videoPacketStream` and `deviceMessageStream` when control is enabled) must be continuously read (even if you don't care about the data), otherwise the whole connection will stall.
283
+ For Scrcpy, usually all streams are originated from the same ADB connection (either USB or TCP), so it's important to always read from all streams, even if you don't care about their data.
267
284
 
268
285
  ```ts
269
286
  // when using `AdbScrcpyClient`
@@ -271,7 +288,7 @@ stdout
271
288
  .pipeTo(
272
289
  new WritableStream<string>({
273
290
  write: (line) => {
274
- // Handle the stdout line
291
+ // Handle or ignore the stdout line
275
292
  },
276
293
  }),
277
294
  )
@@ -283,7 +300,7 @@ stdout
283
300
  videoPacketStream
284
301
  .pipeTo(new WritableStream<ScrcpyVideoStreamPacket>({
285
302
  write: (packet) => {
286
- // Handle the video packet
303
+ // Handle or ignore the video packet
287
304
  },
288
305
  }))
289
306
  .catch(() => {});
@@ -291,7 +308,7 @@ videoPacketStream
291
308
  deviceMessageStream
292
309
  .pipeTo(new WritableStream<ScrcpyDeviceMessage>({
293
310
  write: (message) => {
294
- // Handle the device message
311
+ // Handle or ignore the device message
295
312
  },
296
313
  }))
297
314
  .catch(() => {});
package/bin/scrcpy-server CHANGED
Binary file
package/bin/version.d.ts CHANGED
@@ -1 +1 @@
1
- export default '1.24';
1
+ export default '1.25';
package/bin/version.js CHANGED
@@ -1 +1 @@
1
- export default '1.24';
1
+ export default '1.25';
@@ -1,21 +1,26 @@
1
- import { Adb, AdbSubprocessProtocol } from '@yume-chan/adb';
2
- import { ReadableStream, WrapWritableStream, type ReadableWritablePair } from '@yume-chan/stream-extra';
3
- import { ScrcpyControlMessageSerializer } from '../control/index.js';
4
- import { type ScrcpyVideoStreamPacket } from '../options/index.js';
5
- import type { AdbScrcpyOptions } from './options/index.js';
1
+ import { type Adb, type AdbSubprocessProtocol } from "@yume-chan/adb";
2
+ import { ReadableStream, WrapWritableStream, type ReadableWritablePair } from "@yume-chan/stream-extra";
3
+ import { ScrcpyControlMessageSerializer } from "../control/index.js";
4
+ import { type ScrcpyDeviceMessage } from "../device-message/index.js";
5
+ import { type ScrcpyVideoStreamPacket } from "../options/index.js";
6
+ import { type AdbScrcpyOptions } from "./options/index.js";
7
+ export declare class ScrcpyExitedError extends Error {
8
+ output: string[];
9
+ constructor(output: string[]);
10
+ }
6
11
  export declare class AdbScrcpyClient {
7
12
  static pushServer(adb: Adb, path?: string): WrapWritableStream<Uint8Array>;
8
- static start(adb: Adb, path: string, version: string, options: AdbScrcpyOptions<any>): Promise<AdbScrcpyClient>;
13
+ static start(adb: Adb, path: string, version: string, options: AdbScrcpyOptions<object>): Promise<AdbScrcpyClient>;
9
14
  /**
10
15
  * This method will modify the given `options`,
11
16
  * so don't reuse it elsewhere.
12
17
  */
13
- static getEncoders(adb: Adb, path: string, version: string, options: AdbScrcpyOptions<any>): Promise<string[]>;
18
+ static getEncoders(adb: Adb, path: string, version: string, options: AdbScrcpyOptions<object>): Promise<string[]>;
14
19
  /**
15
20
  * This method will modify the given `options`,
16
21
  * so don't reuse it elsewhere.
17
22
  */
18
- static getDisplays(adb: Adb, path: string, version: string, options: AdbScrcpyOptions<any>): Promise<number[]>;
23
+ static getDisplays(adb: Adb, path: string, version: string, options: AdbScrcpyOptions<object>): Promise<number[]>;
19
24
  private process;
20
25
  private _stdout;
21
26
  get stdout(): ReadableStream<string>;
@@ -29,12 +34,8 @@ export declare class AdbScrcpyClient {
29
34
  private _controlMessageSerializer;
30
35
  get controlMessageSerializer(): ScrcpyControlMessageSerializer | undefined;
31
36
  private _deviceMessageStream;
32
- get deviceMessageStream(): ReadableStream<{
33
- type: import("../device-message/type.js").ScrcpyDeviceMessageType.Clipboard;
34
- length: number;
35
- content: string;
36
- }> | undefined;
37
- constructor(options: AdbScrcpyOptions<any>, process: AdbSubprocessProtocol, stdout: ReadableStream<string>, videoStream: ReadableStream<Uint8Array>, controlStream: ReadableWritablePair<Uint8Array, Uint8Array> | undefined);
37
+ get deviceMessageStream(): ReadableStream<ScrcpyDeviceMessage> | undefined;
38
+ constructor(options: AdbScrcpyOptions<object>, process: AdbSubprocessProtocol, stdout: ReadableStream<string>, videoStream: ReadableStream<Uint8Array>, controlStream: ReadableWritablePair<Uint8Array, Uint8Array> | undefined);
38
39
  close(): Promise<void>;
39
40
  }
40
41
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources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,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAClC,OAAO,CAAC,MAAM,EAAE,CAAC;IA+BpB;;;OAGG;WACiB,WAAW,CAC3B,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAClC,OAAO,CAAC,MAAM,EAAE,CAAC;IA8BpB,OAAO,CAAC,OAAO,CAAwB;IAEvC,OAAO,CAAC,OAAO,CAAyB;IACxC,IAAW,MAAM,2BAEhB;IAED,IAAW,IAAI,oBAEd;IAED,OAAO,CAAC,YAAY,CAAqB;IACzC,IAAW,WAAW,uBAErB;IAED,OAAO,CAAC,aAAa,CAAqB;IAC1C,IAAW,YAAY,uBAEtB;IAED,OAAO,CAAC,YAAY,CAA0C;IAC9D,IAAW,WAAW,4CAErB;IAED,OAAO,CAAC,yBAAyB,CAEjB;IAChB,IAAW,wBAAwB,+CAElC;IAED,OAAO,CAAC,oBAAoB,CAEZ;IAChB,IAAW,mBAAmB,oDAE7B;gBAGG,OAAO,EAAE,gBAAgB,CAAC,MAAM,CAAC,EACjC,OAAO,EAAE,qBAAqB,EAC9B,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,EAC9B,WAAW,EAAE,cAAc,CAAC,UAAU,CAAC,EACvC,aAAa,EAAE,oBAAoB,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG,SAAS;IA2B9D,KAAK;CAGrB"}
package/esm/adb/client.js CHANGED
@@ -1,8 +1,8 @@
1
- import { AdbSubprocessNoneProtocol } from '@yume-chan/adb';
2
- import { AbortController, DecodeUtf8Stream, InspectStream, ReadableStream, SplitStringStream, WrapWritableStream, WritableStream } from '@yume-chan/stream-extra';
3
- import { ScrcpyControlMessageSerializer } from '../control/index.js';
4
- import { ScrcpyDeviceMessageDeserializeStream } from '../device-message/index.js';
5
- import { DEFAULT_SERVER_PATH } from '../options/index.js';
1
+ import { AdbSubprocessNoneProtocol, } from "@yume-chan/adb";
2
+ import { AbortController, DecodeUtf8Stream, InspectStream, ReadableStream, SplitStringStream, WrapWritableStream, WritableStream, } from "@yume-chan/stream-extra";
3
+ import { ScrcpyControlMessageSerializer } from "../control/index.js";
4
+ import { ScrcpyDeviceMessageDeserializeStream, } from "../device-message/index.js";
5
+ import { DEFAULT_SERVER_PATH, } from "../options/index.js";
6
6
  class ArrayToStream extends ReadableStream {
7
7
  array;
8
8
  index = 0;
@@ -42,7 +42,7 @@ class ConcatStream extends ReadableStream {
42
42
  return;
43
43
  }
44
44
  this.advance(controller);
45
- }
45
+ },
46
46
  });
47
47
  }
48
48
  advance(controller) {
@@ -55,6 +55,13 @@ class ConcatStream extends ReadableStream {
55
55
  }
56
56
  }
57
57
  }
58
+ export class ScrcpyExitedError extends Error {
59
+ output;
60
+ constructor(output) {
61
+ super("scrcpy server exited prematurely");
62
+ this.output = output;
63
+ }
64
+ }
58
65
  export class AdbScrcpyClient {
59
66
  static pushServer(adb, path = DEFAULT_SERVER_PATH) {
60
67
  let sync;
@@ -76,9 +83,9 @@ export class AdbScrcpyClient {
76
83
  process = await adb.subprocess.spawn([
77
84
  // cspell: disable-next-line
78
85
  `CLASSPATH=${path}`,
79
- 'app_process',
80
- /* unused */ '/',
81
- 'com.genymobile.scrcpy.Server',
86
+ "app_process",
87
+ /* unused */ "/",
88
+ "com.genymobile.scrcpy.Server",
82
89
  version,
83
90
  ...options.formatServerArguments(),
84
91
  ], {
@@ -88,7 +95,7 @@ export class AdbScrcpyClient {
88
95
  });
89
96
  const stdout = process.stdout
90
97
  .pipeThrough(new DecodeUtf8Stream())
91
- .pipeThrough(new SplitStringStream('\n'));
98
+ .pipeThrough(new SplitStringStream("\n"));
92
99
  // Read stdout, otherwise `process.exit` won't resolve.
93
100
  const output = [];
94
101
  const abortController = new AbortController();
@@ -96,20 +103,20 @@ export class AdbScrcpyClient {
96
103
  .pipeTo(new WritableStream({
97
104
  write(chunk) {
98
105
  output.push(chunk);
99
- }
106
+ },
100
107
  }), {
101
108
  signal: abortController.signal,
102
109
  preventCancel: true,
103
110
  })
104
- .catch(() => { });
111
+ .catch((e) => {
112
+ void e;
113
+ });
105
114
  const result = await Promise.race([
106
115
  process.exit,
107
116
  connection.getStreams(),
108
117
  ]);
109
- if (typeof result === 'number') {
110
- const error = new Error('scrcpy server exited prematurely');
111
- error.output = output;
112
- throw error;
118
+ if (typeof result === "number") {
119
+ throw new ScrcpyExitedError(output);
113
120
  }
114
121
  abortController.abort();
115
122
  await pipe;
@@ -129,13 +136,15 @@ export class AdbScrcpyClient {
129
136
  * so don't reuse it elsewhere.
130
137
  */
131
138
  static async getEncoders(adb, path, version, options) {
132
- // Provide an invalid encoder name
133
- // So the server will return all available encoders
134
- options.value.encoderName = '_';
135
- // Disable control for faster connection in 1.22+
136
- options.value.control = false;
137
- options.value.sendDeviceMeta = false;
138
- options.value.sendDummyByte = false;
139
+ Object.assign(options.value, {
140
+ // Provide an invalid encoder name
141
+ // So the server will return all available encoders
142
+ encoderName: "_",
143
+ // Disable control for faster connection in 1.22+
144
+ control: false,
145
+ sendDeviceMeta: false,
146
+ sendDummyByte: false,
147
+ });
139
148
  // Scrcpy server will open connections, before initializing encoder
140
149
  // Thus although an invalid encoder name is given, the start process will success
141
150
  const client = await AdbScrcpyClient.start(adb, path, version, options);
@@ -156,21 +165,23 @@ export class AdbScrcpyClient {
156
165
  * so don't reuse it elsewhere.
157
166
  */
158
167
  static async getDisplays(adb, path, version, options) {
159
- // Similar to `getEncoders`, pass an invalid option and parse the output
160
- options.value.displayId = -1;
161
- options.value.control = false;
162
- options.value.sendDeviceMeta = false;
163
- options.value.sendDummyByte = false;
168
+ Object.assign(options.value, {
169
+ // Similar to `getEncoders`, pass an invalid option and parse the output
170
+ displayId: -1,
171
+ // Disable control for faster connection in 1.22+
172
+ control: false,
173
+ sendDeviceMeta: false,
174
+ sendDummyByte: false,
175
+ });
164
176
  try {
165
177
  // Server will exit before opening connections when an invalid display id was given.
166
178
  await AdbScrcpyClient.start(adb, path, version, options);
167
179
  }
168
180
  catch (e) {
169
- if (e instanceof Error) {
170
- const output = e.output;
181
+ if (e instanceof ScrcpyExitedError) {
171
182
  const displayIdRegex = /\s+scrcpy --display (\d+)/;
172
183
  const displays = [];
173
- for (const line of output) {
184
+ for (const line of e.output) {
174
185
  const match = line.match(displayIdRegex);
175
186
  if (match) {
176
187
  displays.push(Number.parseInt(match[1], 10));
@@ -179,29 +190,43 @@ export class AdbScrcpyClient {
179
190
  return displays;
180
191
  }
181
192
  }
182
- throw new Error('failed to get displays');
193
+ throw new Error("failed to get displays");
183
194
  }
184
195
  process;
185
196
  _stdout;
186
- get stdout() { return this._stdout; }
187
- get exit() { return this.process.exit; }
197
+ get stdout() {
198
+ return this._stdout;
199
+ }
200
+ get exit() {
201
+ return this.process.exit;
202
+ }
188
203
  _screenWidth;
189
- get screenWidth() { return this._screenWidth; }
204
+ get screenWidth() {
205
+ return this._screenWidth;
206
+ }
190
207
  _screenHeight;
191
- get screenHeight() { return this._screenHeight; }
208
+ get screenHeight() {
209
+ return this._screenHeight;
210
+ }
192
211
  _videoStream;
193
- get videoStream() { return this._videoStream; }
212
+ get videoStream() {
213
+ return this._videoStream;
214
+ }
194
215
  _controlMessageSerializer;
195
- get controlMessageSerializer() { return this._controlMessageSerializer; }
216
+ get controlMessageSerializer() {
217
+ return this._controlMessageSerializer;
218
+ }
196
219
  _deviceMessageStream;
197
- get deviceMessageStream() { return this._deviceMessageStream; }
220
+ get deviceMessageStream() {
221
+ return this._deviceMessageStream;
222
+ }
198
223
  constructor(options, process, stdout, videoStream, controlStream) {
199
224
  this.process = process;
200
225
  this._stdout = stdout;
201
226
  this._videoStream = videoStream
202
227
  .pipeThrough(options.createVideoStreamTransformer())
203
- .pipeThrough(new InspectStream(packet => {
204
- if (packet.type === 'configuration') {
228
+ .pipeThrough(new InspectStream((packet) => {
229
+ if (packet.type === "configuration") {
205
230
  this._screenWidth = packet.data.croppedWidth;
206
231
  this._screenHeight = packet.data.croppedHeight;
207
232
  }
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/adb/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,yBAAyB,EAAkC,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,cAAc,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,cAAc,EAAqG,MAAM,yBAAyB,CAAC;AAErQ,OAAO,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,oCAAoC,EAA4B,MAAM,4BAA4B,CAAC;AAC5G,OAAO,EAAE,mBAAmB,EAAgC,MAAM,qBAAqB,CAAC;AAGxF,MAAM,aAAiB,SAAQ,cAAiB;IACpC,KAAK,CAAO;IACZ,KAAK,GAAG,CAAC,CAAC;IAElB,YAAY,KAAU;QAClB,KAAK,CAAC;YACF,KAAK,EAAE,KAAK,IAAI,EAAE;gBACd,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;gBACxB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACvB,CAAC;YACD,IAAI,EAAE,CAAC,UAAU,EAAE,EAAE;gBACjB,IAAI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;oBAChC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAE,CAAC,CAAC;oBAC5C,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC;iBACnB;qBAAM;oBACH,UAAU,CAAC,KAAK,EAAE,CAAC;iBACtB;YACL,CAAC;SACJ,CAAC,CAAC;IACP,CAAC;CACJ;AAED,MAAM,YAAgB,SAAQ,cAAiB;IACnC,OAAO,CAAuB;IAC9B,KAAK,GAAG,CAAC,CAAC;IACV,MAAM,CAAkC;IAEhD,YAAY,GAAG,OAA4B;QACvC,KAAK,CAAC;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4B,EAAE,CAAC;aACnD,WAAW,CACR,IAAI,aAAa,CAAC,CAAC,MAAM,EAAE,EAAE;YACzB,IAAI,MAAM,CAAC,IAAI,KAAK,eAAe,EAAE;gBACjC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;gBAC7C,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;aAClD;QACL,CAAC,CAAC,CACL,CAAC;QAEN,IAAI,aAAa,EAAE;YACf,IAAI,CAAC,yBAAyB,GAAG,IAAI,8BAA8B,CAC/D,aAAa,CAAC,QAAQ,EACtB,OAAO,CACV,CAAC;YACF,IAAI,CAAC,oBAAoB,GAAG,aAAa,CAAC,QAAQ,CAAC,WAAW,CAC1D,IAAI,oCAAoC,EAAE,CAC7C,CAAC;SACL;IACL,CAAC;IAEM,KAAK,CAAC,KAAK;QACd,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IAC9B,CAAC;CACJ"}
@@ -1,7 +1,7 @@
1
- import type { Adb } from '@yume-chan/adb';
2
- import type { Disposable } from '@yume-chan/event';
3
- import { type ReadableStream, type ReadableWritablePair } from '@yume-chan/stream-extra';
4
- import type { ValueOrPromise } from '@yume-chan/struct';
1
+ import { type Adb } from "@yume-chan/adb";
2
+ import { type Disposable } from "@yume-chan/event";
3
+ import { type ReadableStream, type ReadableWritablePair } from "@yume-chan/stream-extra";
4
+ import { type ValueOrPromise } from "@yume-chan/struct";
5
5
  export interface AdbScrcpyConnectionOptions {
6
6
  control: boolean;
7
7
  /**
@@ -18,21 +18,30 @@ export declare abstract class AdbScrcpyConnection implements Disposable {
18
18
  protected options: AdbScrcpyConnectionOptions;
19
19
  constructor(adb: Adb, options: AdbScrcpyConnectionOptions);
20
20
  initialize(): ValueOrPromise<void>;
21
- abstract getStreams(): ValueOrPromise<[videoSteam: ReadableStream<Uint8Array>, controlStream: ReadableWritablePair<Uint8Array, Uint8Array> | undefined]>;
21
+ abstract getStreams(): ValueOrPromise<[
22
+ videoSteam: ReadableStream<Uint8Array>,
23
+ controlStream: ReadableWritablePair<Uint8Array, Uint8Array> | undefined
24
+ ]>;
22
25
  dispose(): void;
23
26
  }
24
27
  export declare class AdbScrcpyForwardConnection extends AdbScrcpyConnection {
25
28
  private connect;
26
29
  private connectAndRetry;
27
30
  private connectVideoStream;
28
- getStreams(): Promise<[videoSteam: ReadableStream<Uint8Array>, controlStream: ReadableWritablePair<Uint8Array, Uint8Array> | undefined]>;
31
+ getStreams(): Promise<[
32
+ videoSteam: ReadableStream<Uint8Array>,
33
+ controlStream: ReadableWritablePair<Uint8Array, Uint8Array> | undefined
34
+ ]>;
29
35
  }
30
36
  export declare class AdbScrcpyReverseConnection extends AdbScrcpyConnection {
31
37
  private streams;
32
38
  private address;
33
39
  initialize(): Promise<void>;
34
40
  private accept;
35
- getStreams(): Promise<[videoSteam: ReadableStream<Uint8Array>, controlStream: ReadableWritablePair<Uint8Array, Uint8Array> | undefined]>;
41
+ getStreams(): Promise<[
42
+ videoSteam: ReadableStream<Uint8Array>,
43
+ controlStream: ReadableWritablePair<Uint8Array, Uint8Array> | undefined
44
+ ]>;
36
45
  dispose(): void;
37
46
  }
38
47
  //# sourceMappingURL=connection.d.ts.map