Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 6f00fd56 authored by Simon Chan's avatar Simon Chan
Browse files

feat(adb-scrcpy): accept string-typed scid

parent 0f5af05a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ import {
} from "@yume-chan/stream-extra";

export interface AdbScrcpyConnectionOptions {
    scid: number;
    scid: string | undefined;

    video: boolean;

@@ -60,8 +60,8 @@ export abstract class AdbScrcpyConnection implements Disposable {

    protected getSocketName(): string {
        let socketName = "localabstract:" + SCRCPY_SOCKET_NAME_PREFIX;
        if (this.options.scid !== undefined && this.options.scid >= 0) {
            socketName += "_" + this.options.scid.toString(16).padStart(8, "0");
        if (this.options.scid !== undefined) {
            socketName += "_" + this.options.scid.padStart(8, "0");
        }
        return socketName;
    }
+1 −1
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ export class AdbScrcpyOptions1_16 extends AdbScrcpyOptions<
        return AdbScrcpyOptions1_16.createConnection(
            adb,
            {
                scid: -1, // Not Supported
                scid: undefined, // Not Supported
                video: true, // Always enabled
                audio: false, // Not Supported
                control: true, // Always enabled even when `--no-control` is specified
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ export class AdbScrcpyOptions1_22 extends AdbScrcpyOptions<
        return AdbScrcpyOptions1_16.createConnection(
            adb,
            {
                scid: -1, // Not Supported
                scid: undefined, // Not Supported
                video: true, // Always enabled
                audio: false, // Not Supported
                control: this.value.control,
+2 −1
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ import type {
    ScrcpyOptions1_16Impl,
    ScrcpyOptions2_0Impl,
} from "@yume-chan/scrcpy";
import { toScrcpyOptionValue } from "@yume-chan/scrcpy";

import { AdbScrcpyClient, AdbScrcpyExitedError } from "../client.js";
import type { AdbScrcpyConnection } from "../connection.js";
@@ -77,7 +78,7 @@ export class AdbScrcpyOptions2_0 extends AdbScrcpyOptions<
        return AdbScrcpyOptions1_16.createConnection(
            adb,
            {
                scid: this.value.scid.value,
                scid: toScrcpyOptionValue(this.value.scid, undefined),
                video: true, // Always enabled
                audio: this.value.audio,
                control: this.value.control,
+2 −1
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ import type {
    ScrcpyEncoder,
    ScrcpyOptions2_1Impl,
} from "@yume-chan/scrcpy";
import { toScrcpyOptionValue } from "@yume-chan/scrcpy";

import type { AdbScrcpyConnection } from "../connection.js";

@@ -44,7 +45,7 @@ export class AdbScrcpyOptions2_1 extends AdbScrcpyOptions<
        return AdbScrcpyOptions1_16.createConnection(
            adb,
            {
                scid: this.value.scid.value,
                scid: toScrcpyOptionValue(this.value.scid, undefined),
                video: this.value.video,
                audio: this.value.audio,
                control: this.value.control,