mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-03 09:49:24 +02:00
chore: fix review comments
This commit is contained in:
parent
4e2fcb83ba
commit
cf276c5b9c
4 changed files with 3 additions and 15 deletions
|
@ -143,16 +143,6 @@ export class AdbDaemonWebUsbConnection
|
||||||
new MaybeConsumable.WritableStream({
|
new MaybeConsumable.WritableStream({
|
||||||
write: async (chunk) => {
|
write: async (chunk) => {
|
||||||
try {
|
try {
|
||||||
if (
|
|
||||||
typeof SharedArrayBuffer !== "undefined" &&
|
|
||||||
chunk.buffer instanceof SharedArrayBuffer
|
|
||||||
) {
|
|
||||||
// Copy data to a non-shared ArrayBuffer
|
|
||||||
const copy = new Uint8Array(chunk.byteLength);
|
|
||||||
copy.set(chunk);
|
|
||||||
chunk = copy;
|
|
||||||
}
|
|
||||||
|
|
||||||
await device.raw.transferOut(
|
await device.raw.transferOut(
|
||||||
outEndpoint.endpointNumber,
|
outEndpoint.endpointNumber,
|
||||||
// WebUSB doesn't support SharedArrayBuffer
|
// WebUSB doesn't support SharedArrayBuffer
|
||||||
|
|
|
@ -27,7 +27,7 @@ export class AdbScrcpyOptions3_3_2<TVideo extends boolean>
|
||||||
) {
|
) {
|
||||||
super(init);
|
super(init);
|
||||||
|
|
||||||
this.version = clientOptions?.version ?? "3.3.1";
|
this.version = clientOptions?.version ?? "3.3.2";
|
||||||
this.spawner = clientOptions?.spawner;
|
this.spawner = clientOptions?.spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,5 @@ export function toLocalUint8Array(value: Uint8Array): Uint8Array<ArrayBuffer> {
|
||||||
return value as Uint8Array<ArrayBuffer>;
|
return value as Uint8Array<ArrayBuffer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const copy = new Uint8Array(value.length);
|
return new Uint8Array(value);
|
||||||
copy.set(value);
|
|
||||||
return copy;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as ScrcpyControlMessageType from "./control-message-type-value.js";
|
import * as ScrcpyControlMessageType from "./control-message-type-value.js";
|
||||||
|
|
||||||
// These IDs change between versions, so always use `options.getControlMessageTypes()`
|
// These IDs change between versions, so always use `options.controlMessageTypes`
|
||||||
// biome-ignore lint/suspicious/noRedeclare: TypeScript declaration merging for enum-like object
|
// biome-ignore lint/suspicious/noRedeclare: TypeScript declaration merging for enum-like object
|
||||||
type ScrcpyControlMessageType =
|
type ScrcpyControlMessageType =
|
||||||
(typeof ScrcpyControlMessageType)[keyof typeof ScrcpyControlMessageType];
|
(typeof ScrcpyControlMessageType)[keyof typeof ScrcpyControlMessageType];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue