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

Unverified Commit a67e2085 authored by Simon Chan's avatar Simon Chan
Browse files

feat(scrcpy): accept strings for complex options

parent fdf674a9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
import type { Init } from "./init.js";
import { CodecOptions, VideoOrientation } from "./init.js";
import { VideoOrientation } from "./init.js";

export const Defaults = /* #__PURE__ */ (() =>
    ({
@@ -15,5 +15,5 @@ export const Defaults = /* #__PURE__ */ (() =>
        displayId: 0,
        showTouches: false,
        stayAwake: false,
        codecOptions: CodecOptions.Empty,
        codecOptions: undefined,
    }) as const satisfies Required<Init>)();
+2 −2
Original line number Diff line number Diff line
@@ -142,7 +142,7 @@ export interface Init {
     */
    tunnelForward?: boolean;

    crop?: Crop | undefined;
    crop?: Crop | string | undefined;

    /**
     * Send PTS so that the client may record properly
@@ -168,5 +168,5 @@ export interface Init {

    stayAwake?: boolean;

    codecOptions?: CodecOptions;
    codecOptions?: CodecOptions | string | undefined;
}
+3 −4
Original line number Diff line number Diff line
import { omit } from "../../utils/index.js";

import type { Init } from "./init.js";
import { InstanceId } from "./init.js";
import { PrevImpl } from "./prev.js";

export const Defaults = /* #__PURE__ */ (() =>
    ({
        ...omit(PrevImpl.Defaults, "bitRate", "codecOptions", "encoderName"),
        scid: InstanceId.NONE,
        scid: undefined,

        videoCodec: "h264",
        videoBitRate: 8000000,
        videoCodecOptions: PrevImpl.CodecOptions.Empty,
        videoCodecOptions: undefined,
        videoEncoder: undefined,

        audio: true,
        audioCodec: "opus",
        audioBitRate: 128000,
        audioCodecOptions: PrevImpl.CodecOptions.Empty,
        audioCodecOptions: undefined,
        audioEncoder: undefined,

        listEncoders: false,
+3 −3
Original line number Diff line number Diff line
@@ -26,17 +26,17 @@ export class InstanceId implements ScrcpyOptionValue {

export interface Init
    extends Omit<PrevImpl.Init, "bitRate" | "codecOptions" | "encoderName"> {
    scid?: InstanceId;
    scid?: InstanceId | string | undefined;

    videoCodec?: "h264" | "h265" | "av1";
    videoBitRate?: number;
    videoCodecOptions?: PrevImpl.CodecOptions;
    videoCodecOptions?: PrevImpl.CodecOptions | string | undefined;
    videoEncoder?: string | undefined;

    audio?: boolean;
    audioCodec?: "raw" | "opus" | "aac";
    audioBitRate?: number;
    audioCodecOptions?: PrevImpl.CodecOptions;
    audioCodecOptions?: PrevImpl.CodecOptions | string | undefined;
    audioEncoder?: string | undefined;

    listEncoders?: boolean;
+1 −2
Original line number Diff line number Diff line
import { omit } from "../../utils/index.js";

import type { Init } from "./init.js";
import { CaptureOrientation } from "./init.js";
import { PrevImpl } from "./prev.js";

export const Defaults = /* #__PURE__ */ (() =>
    ({
        ...omit(PrevImpl.Defaults, "lockVideoOrientation"),
        captureOrientation: CaptureOrientation.Unlocked,
        captureOrientation: undefined,
        angle: 0,
        screenOffTimeout: undefined,
        listApps: false,
Loading