mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-03 09:49:24 +02:00
feat(scrcpy): add client version 3.3.2
This commit is contained in:
parent
1764a6da16
commit
f34724fdd1
7 changed files with 80 additions and 8 deletions
6
.changeset/breezy-hornets-glow.md
Normal file
6
.changeset/breezy-hornets-glow.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
"@yume-chan/adb-scrcpy": minor
|
||||
"@yume-chan/scrcpy": minor
|
||||
---
|
||||
|
||||
Add support for Scrcpy server version 3.3.2 (no protocol changes)
|
50
libraries/adb-scrcpy/src/3_3_2.ts
Normal file
50
libraries/adb-scrcpy/src/3_3_2.ts
Normal file
|
@ -0,0 +1,50 @@
|
|||
import type { Adb, AdbNoneProtocolSpawner } from "@yume-chan/adb";
|
||||
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
|
||||
import { ScrcpyOptions3_3_2 } from "@yume-chan/scrcpy";
|
||||
|
||||
import {
|
||||
createConnection,
|
||||
getDisplays,
|
||||
getEncoders,
|
||||
} from "./2_1/impl/index.js";
|
||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||
import type { AdbScrcpyConnection } from "./connection.js";
|
||||
import type { AdbScrcpyOptions, AdbScrcpyOptionsGetEncoders } from "./types.js";
|
||||
|
||||
export class AdbScrcpyOptions3_3_2<TVideo extends boolean>
|
||||
extends ScrcpyOptions3_3_2<TVideo>
|
||||
implements
|
||||
AdbScrcpyOptions<ScrcpyOptions3_3_2.Init<TVideo>>,
|
||||
AdbScrcpyOptionsGetEncoders
|
||||
{
|
||||
readonly version: string;
|
||||
|
||||
readonly spawner: AdbNoneProtocolSpawner | undefined;
|
||||
|
||||
constructor(
|
||||
init: ScrcpyOptions3_3_2.Init<TVideo>,
|
||||
clientOptions?: AdbScrcpyClientOptions,
|
||||
) {
|
||||
super(init);
|
||||
|
||||
this.version = clientOptions?.version ?? "3.3.1";
|
||||
this.spawner = clientOptions?.spawner;
|
||||
}
|
||||
|
||||
getEncoders(adb: Adb, path: string): Promise<ScrcpyEncoder[]> {
|
||||
return getEncoders(adb, path, this);
|
||||
}
|
||||
|
||||
getDisplays(adb: Adb, path: string): Promise<ScrcpyDisplay[]> {
|
||||
return getDisplays(adb, path, this);
|
||||
}
|
||||
|
||||
createConnection(adb: Adb): AdbScrcpyConnection {
|
||||
return createConnection(adb, this.value);
|
||||
}
|
||||
}
|
||||
|
||||
export namespace AdbScrcpyOptions3_3_2 {
|
||||
export type Init<TVideo extends boolean = boolean> =
|
||||
ScrcpyOptions3_3_2.Init<TVideo>;
|
||||
}
|
|
@ -25,6 +25,7 @@ export * from "./3_1.js";
|
|||
export * from "./3_2.js";
|
||||
export * from "./3_3.js";
|
||||
export * from "./3_3_1.js";
|
||||
export * from "./3_3_2.js";
|
||||
export * from "./client-options.js";
|
||||
export * from "./client.js";
|
||||
export * from "./connection.js";
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { AdbScrcpyOptions3_3_1 } from "./3_3_1.js";
|
||||
import { AdbScrcpyOptions3_3_2 } from "./3_3_2.js";
|
||||
import type { AdbScrcpyClientOptions } from "./client-options.js";
|
||||
|
||||
export class AdbScrcpyOptionsLatest<
|
||||
TVideo extends boolean,
|
||||
> extends AdbScrcpyOptions3_3_1<TVideo> {
|
||||
> extends AdbScrcpyOptions3_3_2<TVideo> {
|
||||
constructor(
|
||||
init: AdbScrcpyOptions3_3_1.Init<TVideo>,
|
||||
init: AdbScrcpyOptions3_3_2.Init<TVideo>,
|
||||
clientOptions?: AdbScrcpyClientOptions,
|
||||
) {
|
||||
super(init, clientOptions);
|
||||
|
@ -14,5 +14,5 @@ export class AdbScrcpyOptionsLatest<
|
|||
|
||||
export namespace AdbScrcpyOptionsLatest {
|
||||
export type Init<TVideo extends boolean = boolean> =
|
||||
AdbScrcpyOptions3_3_1.Init<TVideo>;
|
||||
AdbScrcpyOptions3_3_2.Init<TVideo>;
|
||||
}
|
||||
|
|
14
libraries/scrcpy/src/3_3_2.ts
Normal file
14
libraries/scrcpy/src/3_3_2.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
import { ScrcpyOptions3_3_1 } from "./3_3_1/index.js";
|
||||
|
||||
export class ScrcpyOptions3_3_2<
|
||||
TVideo extends boolean,
|
||||
> extends ScrcpyOptions3_3_1<TVideo> {
|
||||
constructor(init: ScrcpyOptions3_3_1.Init<TVideo>) {
|
||||
super(init);
|
||||
}
|
||||
}
|
||||
|
||||
export namespace ScrcpyOptions3_3_2 {
|
||||
export type Init<TVideo extends boolean = boolean> =
|
||||
ScrcpyOptions3_3_1.Init<TVideo>;
|
||||
}
|
|
@ -28,6 +28,7 @@ export * from "./3_1/index.js";
|
|||
export * from "./3_2/index.js";
|
||||
export * from "./3_3.js";
|
||||
export * from "./3_3_1/index.js";
|
||||
export * from "./3_3_2.js";
|
||||
export * from "./android/index.js";
|
||||
export * from "./base/index.js";
|
||||
export * from "./codec/index.js";
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import { ScrcpyOptions3_3_1 } from "./3_3_1/index.js";
|
||||
import { ScrcpyOptions3_3_2 } from "./3_3_2.js";
|
||||
|
||||
export class ScrcpyOptionsLatest<
|
||||
TVideo extends boolean,
|
||||
> extends ScrcpyOptions3_3_1<TVideo> {
|
||||
constructor(init: ScrcpyOptions3_3_1.Init<TVideo>) {
|
||||
> extends ScrcpyOptions3_3_2<TVideo> {
|
||||
constructor(init: ScrcpyOptions3_3_2.Init<TVideo>) {
|
||||
super(init);
|
||||
}
|
||||
}
|
||||
|
||||
export namespace ScrcpyOptionsLatest {
|
||||
export type Init<TVideo extends boolean = boolean> =
|
||||
ScrcpyOptions3_3_1.Init<TVideo>;
|
||||
ScrcpyOptions3_3_2.Init<TVideo>;
|
||||
}
|
||||
|
||||
export {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue