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

Unverified Commit 88a3c10a authored by Simon Chan's avatar Simon Chan
Browse files

refactor(scrcpy): move decoders to own packages

parent db079b42
Loading
Loading
Loading
Loading
+13 −11
Original line number Original line Diff line number Diff line
@@ -16,19 +16,21 @@
        "@fluentui/react-icons": "^2.0.166-rc.3",
        "@fluentui/react-icons": "^2.0.166-rc.3",
        "@fluentui/style-utilities": "^8.6.5",
        "@fluentui/style-utilities": "^8.6.5",
        "@griffel/react": "^1.0.4",
        "@griffel/react": "^1.0.4",
        "@yume-chan/adb": "^0.0.16",
        "@yume-chan/adb": "workspace:^0.0.16",
        "@yume-chan/adb-backend-direct-sockets": "^0.0.9",
        "@yume-chan/adb-backend-direct-sockets": "workspace:^0.0.9",
        "@yume-chan/adb-backend-webusb": "^0.0.16",
        "@yume-chan/adb-backend-webusb": "workspace:^0.0.16",
        "@yume-chan/adb-backend-ws": "^0.0.9",
        "@yume-chan/adb-backend-ws": "workspace:^0.0.9",
        "@yume-chan/adb-credential-web": "^0.0.16",
        "@yume-chan/adb-credential-web": "workspace:^0.0.16",
        "@yume-chan/android-bin": "^0.0.16",
        "@yume-chan/android-bin": "workspace:^0.0.16",
        "@yume-chan/async": "^2.2.0",
        "@yume-chan/async": "^2.2.0",
        "@yume-chan/b-tree": "^0.0.16",
        "@yume-chan/b-tree": "workspace:^0.0.16",
        "@yume-chan/event": "^0.0.16",
        "@yume-chan/event": "workspace:^0.0.16",
        "@yume-chan/scrcpy": "^0.0.16",
        "@yume-chan/scrcpy": "workspace:^0.0.16",
        "@yume-chan/stream-extra": "^0.0.16",
        "@yume-chan/scrcpy-decoder-tinyh264": "workspace:^0.0.16",
        "@yume-chan/scrcpy-decoder-webcodecs": "workspace:^0.0.16",
        "@yume-chan/stream-extra": "workspace:^0.0.16",
        "@yume-chan/stream-saver": "^2.0.6",
        "@yume-chan/stream-saver": "^2.0.6",
        "@yume-chan/struct": "^0.0.16",
        "@yume-chan/struct": "workspace:^0.0.16",
        "mobx": "^6.6.1",
        "mobx": "^6.6.1",
        "mobx-react-lite": "^3.4.0",
        "mobx-react-lite": "^3.4.0",
        "next": "12.2.0",
        "next": "12.2.0",
+17 −2
Original line number Original line Diff line number Diff line
@@ -8,8 +8,10 @@ import Head from "next/head";
import { CSSProperties, ReactNode, useEffect, useState } from "react";
import { CSSProperties, ReactNode, useEffect, useState } from "react";


import { ADB_SYNC_MAX_PACKET_SIZE } from '@yume-chan/adb';
import { ADB_SYNC_MAX_PACKET_SIZE } from '@yume-chan/adb';
import { EventEmitter } from "@yume-chan/event";
import { Disposable, EventEmitter } from "@yume-chan/event";
import { AdbScrcpyClient, AdbScrcpyOptions1_22, AndroidKeyCode, AndroidKeyEventAction, AndroidMotionEventAction, AndroidScreenPowerMode, CodecOptions, DEFAULT_SERVER_PATH, ScrcpyDeviceMessageType, ScrcpyLogLevel, ScrcpyOptions1_24, ScrcpyOptionsInit1_24, ScrcpyVideoOrientation, TinyH264Decoder, WebCodecsDecoder, type H264Decoder, type H264DecoderConstructor, type ScrcpyVideoStreamPacket } from "@yume-chan/scrcpy";
import { AdbScrcpyClient, AdbScrcpyOptions1_22, AndroidCodecLevel, AndroidCodecProfile, AndroidKeyCode, AndroidKeyEventAction, AndroidMotionEventAction, AndroidScreenPowerMode, CodecOptions, DEFAULT_SERVER_PATH, ScrcpyDeviceMessageType, ScrcpyLogLevel, ScrcpyOptions1_24, ScrcpyOptionsInit1_24, ScrcpyVideoOrientation, type ScrcpyVideoStreamPacket } from "@yume-chan/scrcpy";
import { TinyH264Decoder } from '@yume-chan/scrcpy-decoder-tinyh264';
import { WebCodecsDecoder } from '@yume-chan/scrcpy-decoder-webcodecs';
import SCRCPY_SERVER_VERSION from '@yume-chan/scrcpy/bin/version';
import SCRCPY_SERVER_VERSION from '@yume-chan/scrcpy/bin/version';
import { ChunkStream, InspectStream, ReadableStream, WritableStream } from '@yume-chan/stream-extra';
import { ChunkStream, InspectStream, ReadableStream, WritableStream } from '@yume-chan/stream-extra';


@@ -92,6 +94,19 @@ function clamp(value: number, min: number, max: number): number {
    return value;
    return value;
}
}


export interface H264Decoder extends Disposable {
    readonly maxProfile: AndroidCodecProfile | undefined;
    readonly maxLevel: AndroidCodecLevel | undefined;

    readonly renderer: HTMLElement;
    readonly frameRendered: number;
    readonly writable: WritableStream<ScrcpyVideoStreamPacket>;
}

export interface H264DecoderConstructor {
    new(): H264Decoder;
}

interface DecoderDefinition {
interface DecoderDefinition {
    key: string;
    key: string;
    name: string;
    name: string;
+2500 −2490

File changed.

Preview size limit exceeded, changes collapsed.

+2 −1
Original line number Original line Diff line number Diff line
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
{
{
  "pnpmShrinkwrapHash": "41dc17a0b131b81fff103f5c891e6b22f6eb87fb"
  "pnpmShrinkwrapHash": "20c5e87dd869580ef14e1d0c32c950b3bb75c84f",
  "preferredVersionsHash": "bf21a9e8fbc5a3846fb05b4fa0859e0917b2202f"
}
}
+3 −3
Original line number Original line Diff line number Diff line
@@ -32,11 +32,11 @@
    },
    },
    "devDependencies": {
    "devDependencies": {
        "typescript": "^4.7.4",
        "typescript": "^4.7.4",
        "@yume-chan/ts-package-builder": "^1.0.0"
        "@yume-chan/ts-package-builder": "workspace:^1.0.0"
    },
    },
    "dependencies": {
    "dependencies": {
        "@yume-chan/adb": "^0.0.16",
        "@yume-chan/adb": "workspace:^0.0.16",
        "@yume-chan/stream-extra": "^0.0.16",
        "@yume-chan/stream-extra": "workspace:^0.0.16",
        "tslib": "^2.4.0"
        "tslib": "^2.4.0"
    }
    }
}
}
Loading