fix(scrcpy): fix UHID output stream from server version 2.6

This commit also replaced `ScrcpyOptions`'s `parseDeviceMessage`/`endDeviceMessageStream` methods with `deviceMessageParsers`. If you are using that two methods directly, you need to move to the new API
This commit is contained in:
Simon Chan 2025-06-21 18:28:33 +08:00
parent eff718ce36
commit 7edd616b43
No known key found for this signature in database
GPG key ID: A8B69F750B9BCEDD
28 changed files with 341 additions and 555 deletions

View file

@ -29,18 +29,15 @@ export class AckClipboardHandler implements ScrcpyDeviceMessageParser {
#closed = false;
async parse(id: number, stream: AsyncExactReadable) {
if (id !== 1) {
return false;
}
readonly id = 1;
async parse(_id: number, stream: AsyncExactReadable): Promise<undefined> {
const message = await AckClipboardDeviceMessage.deserialize(stream);
const resolver = this.#resolvers.get(message.sequence);
if (resolver) {
resolver.resolve();
this.#resolvers.delete(message.sequence);
}
return true;
}
close(): void {